File path: /emf-2.4.1/src/org/eclipse/emf/common/command/CompoundCommand.java | File path: /emf-2.4.1/src/org/eclipse/emf/common/command/CompoundCommand.java | |||
Method name: String getLabel()
|
Method name: String getDescription()
|
|||
Number of AST nodes: 9 | Number of AST nodes: 9 | |||
1 | if (label != null)↵ | 1 | if (description != null)↵ | |
2 | {↵ | 2 | {↵ | |
3 | return label;↵ | 3 | return description;↵ | |
4 | } ↵ | 4 | } ↵ | |
5 | else if (commandList.isEmpty())↵ | 5 | else if (commandList.isEmpty())↵ | |
6 | {↵ | 6 | {↵ | |
7 | return CommonPlugin.INSTANCE.getString("_UI_CompoundCommand_label");↵ | 7 | return CommonPlugin.INSTANCE.getString("_UI_CompoundCommand_description");↵ | |
8 | }↵ | 8 | }↵ | |
9 | else if (resultIndex == LAST_COMMAND_ALL || resultIndex == MERGE_COMMAND_ALL)↵ | 9 | else if (resultIndex == LAST_COMMAND_ALL || resultIndex == MERGE_COMMAND_ALL)↵ | |
10 | {↵ | 10 | {↵ | |
11 | return commandList.get(commandList.size() - 1).getLabel();↵ | 11 | return commandList.get(commandList.size() - 1).getDescription();↵ | |
12 | }↵ | 12 | }↵ | |
13 | else if (resultIndex < commandList.size())↵ | 13 | else if (resultIndex < commandList.size())↵ | |
14 | {↵ | 14 | {↵ | |
15 | return commandList.get(resultIndex).getLabel();↵ | 15 | return commandList.get(resultIndex).getDescription();↵ | |
16 | }↵ | 16 | }↵ | |
17 | else↵ | 17 | else↵ | |
18 | {↵ | 18 | {↵ | |
19 | return CommonPlugin.INSTANCE.getString("_UI_CompoundCommand_label");↵ | 19 | return CommonPlugin.INSTANCE.getString("_UI_CompoundCommand_description");↵ | |
20 | } | 20 |
| |
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.8 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 57 |
Number of mapped statements | 9 |
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) | 15.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (label != null) |
| 1 | if (description != null) | ||||||||||||
2 | return label; |
| 2 | return description; | ||||||||||||
3 | else if (commandList.isEmpty()) | 3 | else if (commandList.isEmpty()) | |||||||||||||
4 | return CommonPlugin.INSTANCE.getString("_UI_CompoundCommand_label"); |
| 4 | return CommonPlugin.INSTANCE.getString("_UI_CompoundCommand_description"); | ||||||||||||
5 | else if (resultIndex == LAST_COMMAND_ALL || resultIndex == MERGE_COMMAND_ALL) | 5 | else if (resultIndex == LAST_COMMAND_ALL || resultIndex == MERGE_COMMAND_ALL) | |||||||||||||
6 | return commandList.get(commandList.size() - 1).getLabel(); |
| 6 | return commandList.get(commandList.size() - 1).getDescription(); | ||||||||||||
7 | else if (resultIndex < commandList.size()) | 7 | else if (resultIndex < commandList.size()) | |||||||||||||
8 | return commandList.get(resultIndex).getLabel(); |
| 8 | return commandList.get(resultIndex).getDescription(); | ||||||||||||
else | else | |||||||||||||||
9 | return CommonPlugin.INSTANCE.getString("_UI_CompoundCommand_label"); |
| 9 | return CommonPlugin.INSTANCE.getString("_UI_CompoundCommand_description"); |
Row | Violation |
---|---|
1 | Expression commandList.get(resultIndex).getLabel() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression commandList.get(resultIndex).getDescription() cannot be parameterized, because it has dependencies to/from statements that will be extracted |