File path: /emf-2.4.1/src/org/eclipse/emf/importer/rose/parser/RoseLexer.java | File path: /emf-2.4.1/src/org/eclipse/emf/importer/rose/parser/RoseLexer.java | |||
Method name: void readLines()
|
Method name: void processToTheEnd(String, int)
|
|||
Number of AST nodes: 14 | Number of AST nodes: 14 | |||
1 | while (temp.charAt(temp.length() - 1) == ')')↵ | 1 | while (temp.charAt(temp.length() - 1) == ')')↵ | |
2 | {↵ | 2 | ↵ | |
3 | ↵ | 3 | {↵ | |
4 | rightParenNum++;↵ | 4 | rightParenNum++;↵ | |
5 | temp = temp.substring(0, temp.length() - 1);↵ | 5 | temp = temp.substring(0, temp.length() - 1);↵ | |
6 | }↵ | 6 | ↵ | |
7 | if (currentLine.charAt(0) == '(')↵ | |||
8 | {↵ | |||
9 | ↵ | 7 | }↵ | |
8 | if (temp.charAt(0) == '(')↵ | |||
9 | {↵ | |||
10 | rightParenNum--;↵ | 10 | rightParenNum--;↵ | |
11 | temp += ")";↵ | 11 | temp += ")";↵ | |
12 | }↵ | 12 | ↵ | |
13 | ↵ | 13 | }↵ | |
14 | RoseToken roseToken = new RoseToken(RoseToken.STRING, temp);↵ | 14 | RoseToken roseToken = new RoseToken(RoseToken.STRING, temp);↵ | |
15 | roseToken.lineNum = lineCounter;↵ | 15 | roseToken.lineNum = lineCounter;↵ | |
16 | tokens.add(roseToken);↵ | 16 | tokens.add(roseToken);↵ | |
17 | for (int j = 0; j < rightParenNum; j++)↵ | 17 | for (int i = 0; i < rightParenNum; i++)↵ | |
18 | {↵ | 18 | ↵ | |
19 | ↵ | 19 | {↵ | |
20 | isList = false;↵ | 20 | isList = false;↵ | |
21 | roseToken = new RoseToken(RoseToken.RIGHT_PAREN, "");↵ | 21 | roseToken = new RoseToken(RoseToken.RIGHT_PAREN, "");↵ | |
22 | roseToken.lineNum = lineCounter;↵ | 22 | roseToken.lineNum = lineCounter;↵ | |
23 | tokens.add(roseToken);↵ | 23 | tokens.add(roseToken);↵ | |
24 | } | 24 |
| |
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.4 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 93 |
Number of mapped statements | 14 |
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) | 22.4 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
73 | while (temp.charAt(temp.length() - 1) == ')') | 15 | while (temp.charAt(temp.length() - 1) == ')') | |||||||||||||||||
74 | rightParenNum++; | 16 | rightParenNum++; | |||||||||||||||||
75 | temp = temp.substring(0, temp.length() - 1); | 17 | temp = temp.substring(0, temp.length() - 1); | |||||||||||||||||
76 | if (currentLine.charAt(0) == '(') |
| 18 | if (temp.charAt(0) == '(') | ||||||||||||||||
77 | rightParenNum--; | 19 | rightParenNum--; | |||||||||||||||||
78 | temp += ")"; | 20 | temp += ")"; | |||||||||||||||||
79 | RoseToken roseToken = new RoseToken(RoseToken.STRING, temp); | 21 | RoseToken roseToken = new RoseToken(RoseToken.STRING, temp); | |||||||||||||||||
80 | roseToken.lineNum = lineCounter; | 22 | roseToken.lineNum = lineCounter; | |||||||||||||||||
81 | tokens.add(roseToken); | 23 | tokens.add(roseToken); | |||||||||||||||||
82 | for (int j = 0; j < rightParenNum; j++) |
| 24 | for (int i = 0; i < rightParenNum; i++) | ||||||||||||||||
83 | isList = false; | 25 | isList = false; | |||||||||||||||||
84 | roseToken = new RoseToken(RoseToken.RIGHT_PAREN, ""); | 26 | roseToken = new RoseToken(RoseToken.RIGHT_PAREN, ""); | |||||||||||||||||
85 | roseToken.lineNum = lineCounter; | 27 | roseToken.lineNum = lineCounter; | |||||||||||||||||
86 | tokens.add(roseToken); | 28 | tokens.add(roseToken); |
Row | Violation |
---|---|
1 | Expression temp cannot be parameterized, because it has dependencies to/from statements that will be extracted |