File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/ssh/Scp.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/ssh/Scp.java | |||
Method name: void download(String, String)
|
Method name: void upload(String, String)
|
|||
Number of AST nodes: 11 | Number of AST nodes: 10 | |||
1 | String file = parseUri(fromSshUri);↵ | 1 | String file = parseUri(toSshUri);↵ | |
2 | Session session = null;↵ | 2 | Session session = null;↵ | |
3 | try {↵ | 3 | try {↵ | |
4 | session = openSession();↵ | 4 | session = openSession();↵ | |
5 | ScpFromMessage message = null;↵ | 5 | ScpToMessage message = null;↵ | |
6 | if (!isSftp) {↵ | 6 | if (!isSftp) {↵ | |
7 | message =↵ | 7 | message =↵ | |
8 | new ScpFromMessage(getVerbose(), session, file,↵ | 8 | new ScpToMessage(getVerbose(), session,↵ | |
9 | ↵ | |||
10 | getProject().resolveFile(toPath),↵ | 9 | getProject().resolveFile(fromPath),↵ | |
11 | fromSshUri.endsWith("*"));↵ | 10 | file);↵ | |
12 | } else {↵ | 11 | } else {↵ | |
13 | message =↵ | 12 | message =↵ | |
14 | new ScpFromMessageBySftp(getVerbose(), session, file,↵ | 13 | new ScpToMessageBySftp(getVerbose(), session,↵ | |
15 | ↵ | |||
16 | getProject().resolveFile(toPath),↵ | 14 | getProject().resolveFile(fromPath),↵ | |
17 | fromSshUri.endsWith("*"));↵ | 15 | ↵ | |
18 | }↵ | |||
19 | log("Receiving file: " + file);↵ | 16 | file);↵ | |
17 | }↵ | |||
20 | message.setLogListener(this);↵ | 18 | message.setLogListener(this);↵ | |
21 | message.execute();↵ | 19 | message.execute();↵ | |
22 | } finally {↵ | 20 | } finally {↵ | |
23 | if (session != null) {↵ | 21 | if (session != null) {↵ | |
24 | session.disconnect();↵ | 22 | session.disconnect();↵ | |
25 | }↵ | 23 | }↵ | |
26 | } | 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.3 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 43 |
Number of mapped statements | 10 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 4.2 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | String file = parseUri(fromSshUri); |
| 1 | String file = parseUri(toSshUri); | ||||||||||||||||||||
2 | Session session = null; | 2 | Session session = null; | |||||||||||||||||||||
3 | try | 3 | try | |||||||||||||||||||||
4 | session = openSession(); | 4 | session = openSession(); | |||||||||||||||||||||
5 | ScpFromMessage message = null; |
| 5 | ScpToMessage message = null; | ||||||||||||||||||||
6 | if (!isSftp) | 6 | if (!isSftp) | |||||||||||||||||||||
7 | message = new ScpFromMessage(getVerbose(), session, file, getProject().resolveFile(toPath), fromSshUri.endsWith("*")); |
| 7 | message = new ScpToMessage(getVerbose(), session, getProject().resolveFile(fromPath), file); | ||||||||||||||||||||
else | else | |||||||||||||||||||||||
8 | message = new ScpFromMessageBySftp(getVerbose(), session, file, getProject().resolveFile(toPath), fromSshUri.endsWith("*")); |
| 8 | message = new ScpToMessageBySftp(getVerbose(), session, getProject().resolveFile(fromPath), file); | ||||||||||||||||||||
9 | log("Receiving file: " + file); | | ||||||||||||||||||||||
10 | message.setLogListener(this); |
| 9 | message.setLogListener(this); | ||||||||||||||||||||
11 | message.execute(); |
| 10 | message.execute(); |
Row | Violation |
---|---|
1 | Expression new ScpFromMessage(getVerbose(),session,file,getProject().resolveFile(toPath),fromSshUri.endsWith("*")) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression new ScpToMessage(getVerbose(),session,getProject().resolveFile(fromPath),file) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression new ScpFromMessage(getVerbose(),session,file,getProject().resolveFile(toPath),fromSshUri.endsWith("*")) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression new ScpToMessage(getVerbose(),session,getProject().resolveFile(fromPath),file) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression new ScpFromMessageBySftp(getVerbose(),session,file,getProject().resolveFile(toPath),fromSshUri.endsWith("*")) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Expression new ScpToMessageBySftp(getVerbose(),session,getProject().resolveFile(fromPath),file) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Expression new ScpFromMessageBySftp(getVerbose(),session,file,getProject().resolveFile(toPath),fromSshUri.endsWith("*")) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
8 | Expression new ScpToMessageBySftp(getVerbose(),session,getProject().resolveFile(fromPath),file) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
9 | Clone fragment #1 returns variables file , while Clone fragment #2 returns variables |