File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/ldap/sampler/LDAPExtSampler.java | File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/ldap/sampler/LDAPExtSampler.java | |||
Method name: void writeSearchResults(XMLBuffer, NamingEnumeration)
|
Method name: void writeSearchResults(XMLBuffer, NamingEnumeration)
|
|||
Number of AST nodes: 4 | Number of AST nodes: 4 | |||
1 | while (srch.hasMore()) { // If there's anything left ...↵ | 1 | while (srch.hasMore()↵ | |
2 | ↵ | 2 | && (sortedResults.size() < MAX_SORTED_RESULTS)) {↵ | |
3 | final SearchResult sr = (SearchResult) srch.next();↵ | 3 | final SearchResult sr = (SearchResult) srch.next();↵ | |
4 | ↵ | 4 | // must be done prior to sorting↵ | |
5 | normaliseSearchDN(sr, searchBase, rootDn);↵ | 5 | normaliseSearchDN(sr, searchBase, rootDn);↵ | |
6 | writeSearchResult(sr, xmlb);↵ | 6 | ↵ | |
7 | ↵ | 7 | sortedResults.add(sr);↵ | |
8 | } | 8 | } | |
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 in the same method |
Number of node comparisons | 16 |
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 2.7 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
9 | while (srch.hasMore()) |
| 5 | while (srch.hasMore() && (sortedResults.size() < MAX_SORTED_RESULTS)) | |||||||||||
10 | final SearchResult sr = (SearchResult)srch.next(); | 6 | final SearchResult sr = (SearchResult)srch.next(); | ||||||||||||
11 | normaliseSearchDN(sr, searchBase, rootDn); | 7 | normaliseSearchDN(sr, searchBase, rootDn); | ||||||||||||
|
| 8 | sortedResults.add(sr); | ||||||||||||
12 | writeSearchResult(sr, xmlb); |
| |
Row | Violation |
---|---|
1 | Expression srch.hasMore() && (sortedResults.size() < MAX_SORTED_RESULTS) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement sortedResults.add(sr); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Unmatched statement writeSearchResult(sr,xmlb); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Unmatched statement writeSearchResult(sr,xmlb); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted |