File path: /columba-1.4-src/core/src/main/java/org/columba/core/gui/context/ContextDebugProvider.java | File path: /columba-1.4-src/mail/src/test/java/org/columba/mail/folder/FolderTstHelper.java | |||
Method name: void search(ISemanticContext, int, int)
|
Method name: String getStringFromInputStream(InputStream)
|
|||
Number of AST nodes: 8 | Number of AST nodes: 8 | |||
1 | IStructureValue value = context.getValue();↵ | 1 | Str↵ | |
2 | if ( value == null ) return;↵ | |||
3 | ↵ | |||
4 | StringBuffer buf = new StringBuffer();↵ | |||
5 | buf.append(value.getName());↵ | |||
6 | DefaultMutableTreeNode root = new DefaultMutableTreeNode(buf.toString());↵ | |||
7 | createTree(root, value);↵ | |||
8 | treeModel = new DefaultTreeModel(root↵ | 2 | ingBuffer result = new StringBuffer();↵ | |
3 | BufferedReader reader = new BufferedReader(new InputStreamReader(is));↵ | |||
4 | String nextLine = reader.readLine();↵ | |||
5 | while (nextLine != null) {↵ | |||
6 | result.append(nextLine);↵ | |||
7 | result.append("\r\n");↵ | |||
8 | nextLine = reader.readLine();↵ | |||
9 | }↵ | |||
9 | ); | 10 | return result.toString(); | |
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.0 |
Clones location | Clones are in different classes |
Number of node comparisons | 23 |
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 7 |
Number of unmapped statements in the second code fragment | 7 |
Time elapsed for statement mapping (ms) | 2.4 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | IStructureValue value = context.getValue(); | | ||||||||||||
| 2 | BufferedReader reader = new BufferedReader(new InputStreamReader(is)); | ||||||||||||
2 | if (value == null) | | ||||||||||||
3 | return; |
| | |||||||||||
4 | StringBuffer buf = new StringBuffer(); |
| 1 | StringBuffer result = new StringBuffer(); | ||||||||||
|
| 3 | String nextLine = reader.readLine(); | |||||||||||
| 4 | while (nextLine != null) | ||||||||||||
|
| 5 | result.append(nextLine); | |||||||||||
|
| 6 | result.append("\r\n"); | |||||||||||
|
| 7 | nextLine = reader.readLine(); | |||||||||||
5 | buf.append(value.getName()); |
| | |||||||||||
6 | DefaultMutableTreeNode root = new DefaultMutableTreeNode(buf.toString()); |
| | |||||||||||
7 | createTree(root, value); |
| | |||||||||||
|
| 8 | return result.toString(); | |||||||||||
8 | treeModel = new DefaultTreeModel(root); |
| |
Row | Violation |
---|---|
1 | Unmatched return; |
2 | Unmatched statement String nextLine=reader.readLine(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
3 | Unmatched statement result.append(nextLine); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Unmatched statement result.append("\r\n"); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
5 | Unmatched statement nextLine=reader.readLine(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
6 | Unmatched statement buf.append(value.getName()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
7 | Unmatched statement DefaultMutableTreeNode root=new DefaultMutableTreeNode(buf.toString()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
8 | Unmatched statement createTree(root,value); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
9 | Unmatched statement return result.toString(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
10 | Unmatched return result.toString(); |
11 | Unmatched statement treeModel=new DefaultTreeModel(root); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |