File path: /jruby-1.4.0/src/org/jruby/RubyFile.java | File path: /jruby-1.4.0/src/org/jruby/RubyFile.java | |||
Method name: IRubyObject lchmod(ThreadContext, IRubyObject, IRubyObject[])
|
Method name: IRubyObject chown(ThreadContext, IRubyObject, IRubyObject[])
|
|||
Number of AST nodes: 7 | Number of AST nodes: 7 | |||
1 | for (int i = 1; i < args.length; i++) {↵ | 1 | for (int i = 2; i < args.length; i++) {↵ | |
2 | RubyString filename = get_path(context, args[i]);↵ | 2 | RubyString filename = get_path(context, args[i]);↵ | |
3 | ↵ | |||
4 | if (!RubyFileTest.exist_p(filename, filename).isTrue()) {↵ | 3 | if (!RubyFileTest.exist_p(filename, filename).isTrue()) {↵ | |
5 | throw runtime.newErrnoENOENTError("No such file or directory - " + filename);↵ | 4 | throw runtime.newErrnoENOENTError("No such file or directory - " + filename);↵ | |
6 | }↵ | 5 | }↵ | |
7 | ↵ | 6 | ↵ | |
8 | boolean result = 0 == runtime.getPosix().lchmod(filename.getUnicodeValue(), (int)mode.getLongValue());↵ | 7 | boolean result = 0 == runtime.getPosix().chown(filename.getUnicodeValue(), owner, group);↵ | |
9 | if (result) {↵ | 8 | if (result) {↵ | |
10 | count++;↵ | 9 | count++;↵ | |
11 | }↵ | 10 | }↵ | |
12 | } | 11 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.5 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 22 |
Number of mapped statements | 7 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 2.1 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4 | for (int i = 1; i < args.length; i++) |
| 9 | for (int i = 2; i < args.length; i++) | |||||||||||||||||
5 | RubyString filename = get_path(context, args[i]); | 10 | RubyString filename = get_path(context, args[i]); | ||||||||||||||||||
6 | if (!RubyFileTest.exist_p(filename, filename).isTrue()) | 11 | if (!RubyFileTest.exist_p(filename, filename).isTrue()) | ||||||||||||||||||
7 | throw runtime.newErrnoENOENTError("No such file or directory - " + filename); | 12 | throw runtime.newErrnoENOENTError("No such file or directory - " + filename); | ||||||||||||||||||
8 | boolean result = 0 == runtime.getPosix().lchmod(filename.getUnicodeValue(), (int)mode.getLongValue()); |
| 13 | boolean result = 0 == runtime.getPosix().chown(filename.getUnicodeValue(), owner, group); | |||||||||||||||||
9 | if (result) | 14 | if (result) | ||||||||||||||||||
10 | count++; | 15 | count++; |
Row | Violation |
---|---|
1 | Expression runtime.getPosix().lchmod(filename.getUnicodeValue(),(int)mode.getLongValue()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression runtime.getPosix().chown(filename.getUnicodeValue(),owner,group) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression runtime.getPosix().lchmod(filename.getUnicodeValue(),(int)mode.getLongValue()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression runtime.getPosix().chown(filename.getUnicodeValue(),owner,group) cannot be parameterized, because it has dependencies to/from statements that will be extracted |