File path: /jruby-1.4.0/src/org/jruby/util/Dir.java | File path: /jruby-1.4.0/src/org/jruby/util/Dir.java | |||
Method name: int glob_helper(String, byte[], int, int, int, int, GlobFunc, GlobArgs)
|
Method name: int glob_helper(String, byte[], int, int, int, int, GlobFunc, GlobArgs)
|
|||
Number of AST nodes: 12 | Number of AST nodes: 12 | |||
1 | if(fnmatch(magic,0,magic.length,bs,0, bs.length,flags) == 0) {↵ | 1 | if(fnmatch(magic,0,magic.length,bs,0,len,flags) == 0) {↵ | |
2 | buf.length(0);↵ | 2 | buf.length(0);↵ | |
3 | buf.append(base);↵ | 3 | buf.append(base↵ | |
4 | , 0, base.length - jar.length());↵ | |||
4 | buf.append( BASE(base) ? SLASH : EMPTY );↵ | 5 | buf.append( BASE(base) ? SLASH : EMPTY );↵ | |
5 | buf.append(getBytesInUTF8(dirp[i]));↵ | 6 | buf.append(↵ | |
7 | bs, 0, len);↵ | |||
6 | if(m == -1) {↵ | 8 | if(m == -1) {↵ | |
7 | status = func.call(buf.bytes,0,buf.realSize,arg);↵ | 9 | status = func.call(buf.bytes,0,buf.realSize,arg);↵ | |
8 | if(status != 0) {↵ | 10 | if(status != 0) {↵ | |
9 | break;↵ | 11 | break;↵ | |
10 | }↵ | 12 | ↵ | |
13 | }↵ | |||
11 | continue;↵ | 14 | continue;↵ | |
12 | }↵ | 15 | ↵ | |
16 | }↵ | |||
13 | link.add(buf);↵ | 17 | link.add(buf);↵ | |
14 | buf = new ByteList(20);↵ | 18 | buf = new ByteList(20);↵ | |
15 | } | 19 | } | |
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 in the same method |
Number of node comparisons | 71 |
Number of mapped statements | 12 |
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) | 24.5 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
104 | if (fnmatch(magic, 0, magic.length, bs, 0, bs.length, flags) == 0) |
| 146 | if (fnmatch(magic, 0, magic.length, bs, 0, len, flags) == 0) | ||||||||||||||
105 | buf.length(0); | 147 | buf.length(0); | |||||||||||||||
106 | buf.append(base); |
| 150 | buf.append(bs, 0, len); | ||||||||||||||
107 | buf.append(BASE(base) ? SLASH : EMPTY); | 149 | buf.append(BASE(base) ? SLASH : EMPTY); | |||||||||||||||
108 | buf.append(getBytesInUTF8(dirp[i])); |
| 148 | buf.append(base, 0, base.length - jar.length()); | ||||||||||||||
109 | if (m == -1) | 151 | if (m == -1) | |||||||||||||||
110 | status = func.call(buf.bytes, 0, buf.realSize, arg); | 152 | status = func.call(buf.bytes, 0, buf.realSize, arg); | |||||||||||||||
111 | if (status != 0) | 153 | if (status != 0) | |||||||||||||||
112 | break; |
| 154 | break; | ||||||||||||||
113 | continue; |
| 155 | continue; | ||||||||||||||
114 | link.add(buf); | 156 | link.add(buf); | |||||||||||||||
115 | buf = new ByteList(20); | 157 | buf = new ByteList(20); |
Row | Violation |
---|---|
1 | Expression buf.append(base) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression buf.append(bs,0,len) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression buf.append(base) is a void method call, and thus it cannot be parameterized |
4 | Expression buf.append(bs,0,len) is a void method call, and thus it cannot be parameterized |
5 | Expression buf.append(getBytesInUTF8(dirp[i])) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Expression buf.append(base,0,base.length - jar.length()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Expression buf.append(getBytesInUTF8(dirp[i])) is a void method call, and thus it cannot be parameterized |
8 | Expression buf.append(base,0,base.length - jar.length()) is a void method call, and thus it cannot be parameterized |
9 | Statement break; without innermost loop |
10 | Statement break; without innermost loop |
11 | Statement continue; without innermost loop |
12 | Statement continue; without innermost loop |
13 | Clone fragment #1 returns variables status, buf , while Clone fragment #2 returns variables status, buf |