File path: /columba-1.4-src/calendar/src/main/java/org/columba/calendar/ui/action/SaveAsAction.java | File path: /columba-1.4-src/core/src/main/java/org/columba/core/gui/globalactions/ViewLogAction.java | |||
Method name: void actionPerformed(ActionEvent)
|
Method name: void actionPerformed(ActionEvent)
|
|||
Number of AST nodes: 4 | Number of AST nodes: 4 | |||
1 | File destFile = fc.getSelectedFile();↵ | 1 | File file = ↵ | |
2 | ICalendarStore store = CalendarStoreFactory.getInstance()↵ | |||
3 | .getLocaleStore();↵ | 2 | DefaultConfigDirectory.getInstance().getCurrentPath();↵ | |
4 | Command command = new SaveEventToFileCommand(↵ | 3 | ↵ | |
5 | new CalendarCommandReference(s↵ | 4 | File logDirectory = new File(file, "log");↵ | |
6 | tore, activity), destFile);↵ | 5 | File logFile = new File(logDirectory, "columba.log");↵ | |
7 | CommandProcessor.getInstance().addOp(command); | 6 | ColumbaDesktop.getInstance().open(logFile); | |
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 having the same super class |
Number of node comparisons | 16 |
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 3 |
Time elapsed for statement mapping (ms) | 0.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | File file = DefaultConfigDirectory.getInstance().getCurrentPath(); | ||||||||||||||||
13 | File destFile = fc.getSelectedFile(); |
| 2 | File logDirectory = new File(file, "log"); | ||||||||||||||
|
| 3 | File logFile = new File(logDirectory, "columba.log"); | |||||||||||||||
| 4 | ColumbaDesktop.getInstance().open(logFile); | ||||||||||||||||
14 | ICalendarStore store = CalendarStoreFactory.getInstance().getLocaleStore(); | | ||||||||||||||||
15 | Command command = new SaveEventToFileCommand(new CalendarCommandReference(store, activity), destFile); |
| | |||||||||||||||
16 | CommandProcessor.getInstance().addOp(command); | |
Row | Violation |
---|---|
1 | Expression new File(file,"log") cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement File logFile=new File(logDirectory,"columba.log"); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Unmatched statement Command command=new SaveEventToFileCommand(new CalendarCommandReference(store,activity),destFile); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |