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 chown(ThreadContext, IRubyObject, IRubyObject[])
|
Method name: IRubyObject chmod(ThreadContext, IRubyObject, IRubyObject[])
|
|||
Number of AST nodes: 7 | Number of AST nodes: 7 | |||
1 | for (int i = 2; i < args.length; i++) {↵ | 1 | for (int i = 1; i < args.length; i++) {↵ | |
2 | RubyString filename = get_path(context, args[i]);↵ | 2 | RubyString filename = get_path(context, args[i]);↵ | |
3 | ↵ | |||
3 | if (!RubyFileTest.exist_p(filename, filename).isTrue()) {↵ | 4 | if (!RubyFileTest.exist_p(filename, filename).isTrue()) {↵ | |
4 | throw runtime.newErrnoENOENTError("No such file or directory - " + filename);↵ | 5 | throw runtime.newErrnoENOENTError("No such file or directory - " + filename);↵ | |
5 | }↵ | 6 | }↵ | |
6 | ↵ | 7 | ↵ | |
7 | boolean result = 0 == runtime.getPosix().chown(filename.getUnicodeValue(), owner, group);↵ | 8 | boolean result = 0 == runtime.getPosix().chmod(filename.getUnicodeValue(), (int)mode.getLongValue());↵ | |
8 | if (result) {↵ | 9 | if (result) {↵ | |
9 | count++;↵ | 10 | count++;↵ | |
10 | }↵ | 11 | }↵ | |
11 | } | 12 |
| |
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.3 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
9 | for (int i = 2; i < args.length; i++) |
| 4 | for (int i = 1; i < args.length; i++) | |||||||||||||||||
10 | RubyString filename = get_path(context, args[i]); | 5 | RubyString filename = get_path(context, args[i]); | ||||||||||||||||||
11 | if (!RubyFileTest.exist_p(filename, filename).isTrue()) | 6 | if (!RubyFileTest.exist_p(filename, filename).isTrue()) | ||||||||||||||||||
12 | throw runtime.newErrnoENOENTError("No such file or directory - " + filename); | 7 | throw runtime.newErrnoENOENTError("No such file or directory - " + filename); | ||||||||||||||||||
13 | boolean result = 0 == runtime.getPosix().chown(filename.getUnicodeValue(), owner, group); |
| 8 | boolean result = 0 == runtime.getPosix().chmod(filename.getUnicodeValue(), (int)mode.getLongValue()); | |||||||||||||||||
14 | if (result) | 9 | if (result) | ||||||||||||||||||
15 | count++; | 10 | count++; |
Row | Violation |
---|---|
1 | Expression runtime.getPosix().chown(filename.getUnicodeValue(),owner,group) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression runtime.getPosix().chmod(filename.getUnicodeValue(),(int)mode.getLongValue()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression runtime.getPosix().chown(filename.getUnicodeValue(),owner,group) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression runtime.getPosix().chmod(filename.getUnicodeValue(),(int)mode.getLongValue()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |