File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/http/proxy/HttpRequestHdr.java | File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/http/proxy/HttpRequestHdr.java | |||
Method name: int serverPort()
|
Method name: String serverName()
|
|||
Number of AST nodes: 11 | Number of AST nodes: 11 | |||
1 | String str = url;↵ | 1 | String str = url;↵ | |
2 | // chop to "server.name:x/thing"↵ | 2 | ↵ | |
3 | int i = str.indexOf("//");↵ | 3 | int i = str.indexOf("//"); // $NON-NLS-1$↵ | |
4 | if (i > 0) {↵ | 4 | if (i > 0) {↵ | |
5 | str = str.substring(i + 2);↵ | 5 | str = str.substring(i + 2);↵ | |
6 | }↵ | 6 | }↵ | |
7 | // chop to server.name:xx↵ | 7 | // chop to server.name:xx↵ | |
8 | i = str.indexOf("/");↵ | 8 | i = str.indexOf("/"); // $NON-NLS-1$↵ | |
9 | if (0 < i) {↵ | 9 | if (0 < i) {↵ | |
10 | str = str.substring(0, i);↵ | 10 | str = str.substring(0, i);↵ | |
11 | }↵ | 11 | }↵ | |
12 | // chop XX↵ | 12 | // chop to server.name↵ | |
13 | i = str.indexOf(":");↵ | 13 | i = str.indexOf(":"); // $NON-NLS-1$↵ | |
14 | if (0 < i) {↵ | 14 | if (0 < i) {↵ | |
15 | return Integer.parseInt(str.substring(i + 1).trim());↵ | 15 | str = str.substring(0, i);↵ | |
16 | }↵ | 16 | }↵ | |
17 | return HTTPSamplerBase.UNSPECIFIED_PORT; | 17 | return str; | |
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.6 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 52 |
Number of mapped statements | 9 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 2.2 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||
---|---|---|---|---|---|---|---|
1 | String str = url; | 1 | String str = url; | ||||
2 | int i = str.indexOf("//"); | 2 | int i = str.indexOf("//"); | ||||
3 | if (i > 0) | 3 | if (i > 0) | ||||
4 | str = str.substring(i + 2); | 4 | str = str.substring(i + 2); | ||||
5 | i = str.indexOf("/"); | 5 | i = str.indexOf("/"); | ||||
6 | if (0 < i) | 6 | if (0 < i) | ||||
7 | str = str.substring(0, i); | 7 | str = str.substring(0, i); | ||||
8 | i = str.indexOf(":"); | 8 | i = str.indexOf(":"); | ||||
9 | if (0 < i) | 9 | if (0 < i) | ||||
| 10 | str = str.substring(0, i); | |||||
10 | return Integer.parseInt(str.substring(i + 1).trim()); | | |||||
| 11 | return str; | |||||
11 | return HTTPSamplerBase.UNSPECIFIED_PORT; |
| |
Row | Violation |
---|---|
1 | Unmatched return HTTPSamplerBase.UNSPECIFIED_PORT; |
2 | Clone fragment #1 returns variables str, i , while Clone fragment #2 returns variables str, i |