File path: /jakarta-jmeter-2.3.2/src/org/apache/jorphan/util/JOrphanUtils.java | File path: /jakarta-jmeter-2.3.2/src/org/apache/jorphan/util/JOrphanUtils.java | |||
Method name: StringBuffer rightAlign(StringBuffer, int)
|
Method name: StringBuffer leftAlign(StringBuffer, int)
|
|||
Number of AST nodes: 7 | Number of AST nodes: 7 | |||
1 | int pfx = len - in.length();↵ | 1 | int sfx = len - in.length();↵ | |
2 | if (pfx <= 0) {↵ | 2 | if (sfx <= 0) {↵ | |
3 | return in;↵ | 3 | return in;↵ | |
4 | }↵ | 4 | }↵ | |
5 | if (pfx > SPACES_LEN) {↵ | 5 | if (sfx > SPACES_LEN) {↵ | |
6 | pfx = SPACES_LEN;↵ | 6 | sfx = SPACES_LEN;↵ | |
7 | }↵ | 7 | }↵ | |
8 | in.insert(0, SPACES.substring(0, pfx));↵ | 8 | in.append(SPACES.substring(0, sfx));↵ | |
9 | return in; | 9 |
| |
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.2 |
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) | 1.1 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | int pfx = len - in.length(); |
| 1 | int sfx = len - in.length(); | |||||||||||||||||
2 | if (pfx <= 0) |
| 2 | if (sfx <= 0) | |||||||||||||||||
3 | return in; | 3 | return in; | ||||||||||||||||||
4 | if (pfx > SPACES_LEN) |
| 4 | if (sfx > SPACES_LEN) | |||||||||||||||||
5 | pfx = SPACES_LEN; |
| 5 | sfx = SPACES_LEN; | |||||||||||||||||
6 | in.insert(0, SPACES.substring(0, pfx)); |
| 6 | in.append(SPACES.substring(0, sfx)); | |||||||||||||||||
7 | return in; | 7 | return in; |
Row | Violation |
---|---|
1 | Expression in.insert(0,SPACES.substring(0,pfx)) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression in.append(SPACES.substring(0,sfx)) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression in.insert(0,SPACES.substring(0,pfx)) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression in.append(SPACES.substring(0,sfx)) cannot be parameterized, because it has dependencies to/from statements that will be extracted |