File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/junit/JMeterTest.java | File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/junit/JMeterTest.java | |||
Method name: void runGUITitle()
|
Method name: void runFunction()
|
|||
Number of AST nodes: 11 | Number of AST nodes: 10 | |||
1 | if (guiTitles.size() > 0) {↵ | 1 | if (funcTitles.size() > 0) {↵ | |
2 | String title = guiItem.getDocAnchor();↵ | 2 | String title = funcItem.getReferenceKey();↵ | |
3 | boolean ct = guiTitles.containsKey(title);↵ | 3 | boolean ct = funcTitles.containsKey(title);↵ | |
4 | if (ct) {↵ | 4 | if (ct) {↵ | |
5 | guiTitles.put(title, Boolean.TRUE);// So we can detect extra entries↵ | 5 | funcTitles.put(title, Boolean.TRUE);// For detecting extra entries↵ | |
6 | }↵ | |||
7 | String name = guiItem.getClass().getName();↵ | |||
8 | if (// Is this a work in progress or an internal GUI component?↵ | |||
9 | (title != null && title.length() > 0) // Will be "" for internal components↵ | |||
10 | && (title.toUpperCase(java.util.Locale.ENGLISH)↵ | 6 | }↵ | |
7 | if (// Is this a work in progress ?↵ | |||
11 | .indexOf("(ALPHA") == -1) ↵ | 8 | title.indexOf("(ALPHA") == -1↵ | |
12 | && (title.toUpperCase(java.util.Locale.ENGLISH).indexOf("(BETA") == -1)↵ | 9 | && title.indexOf("(EXPERIMENTAL") == -1)↵ | |
13 | && (!title.equals("Example1")) // Skip the example samplers ...↵ | |||
14 | && (!title.equals("Example2"))↵ | |||
15 | && (!name.startsWith("org.apache.jmeter.examples."))↵ | |||
16 | )↵ | |||
17 | {// No, not a work in progress ...↵ | |||
18 | String s = "component_reference↵ | 10 | {// No,↵ | |
11 | // not↵ | |||
12 | // a↵ | |||
13 | // work↵ | |||
14 | // in↵ | |||
15 | // progress↵ | |||
16 | // ...↵ | |||
19 | .xml needs '" + title + "' anchor for " + name;↵ | 17 | String s = "function.xml needs '" + title + "' entry for " + funcItem.getClass().getName();↵ | |
20 | if (!ct) {↵ | 18 | if (!ct) {↵ | |
21 | log.warn(s); // Record in log as well↵ | 19 | log.warn(s); // Record in log as well↵ | |
22 | }↵ | 20 | }↵ | |
23 | assertTrue(s, ct);↵ | 21 | assertTrue(s, ct);↵ | |
24 | }↵ | 22 | }↵ | |
25 | } | 23 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.5 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 29 |
Number of mapped statements | 9 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 2.9 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (guiTitles.size() > 0) |
| 1 | if (funcTitles.size() > 0) | ||||||||||||||||
| 2 | String title = funcItem.getReferenceKey(); | ||||||||||||||||||
2 | String title = guiItem.getDocAnchor(); | | ||||||||||||||||||
3 | boolean ct = guiTitles.containsKey(title); |
| 3 | boolean ct = funcTitles.containsKey(title); | ||||||||||||||||
4 | if (ct) | 4 | if (ct) | |||||||||||||||||
5 | guiTitles.put(title, Boolean.TRUE); |
| 5 | funcTitles.put(title, Boolean.TRUE); | ||||||||||||||||
6 | String name = guiItem.getClass().getName(); | | ||||||||||||||||||
7 | if ((title != null && title.length() > 0) && (title.toUpperCase(java.util.Locale.ENGLISH).indexOf("(ALPHA") == -1) && (title.toUpperCase(java.util.Locale.ENGLISH).indexOf("(BETA") == -1) && (!title.equals("Example1")) && (!title.equals("Example2")) && (!name.startsWith("org.apache.jmeter.examples."))) |
| 6 | if (title.indexOf("(ALPHA") == -1 && title.indexOf("(EXPERIMENTAL") == -1) | ||||||||||||||||
8 | String s = "component_reference.xml needs '" + title + "' anchor for " + name; |
| 7 | String s = "function.xml needs '" + title + "' entry for " + funcItem.getClass().getName(); | ||||||||||||||||
9 | if (!ct) | 8 | if (!ct) | |||||||||||||||||
10 | log.warn(s); | 9 | log.warn(s); | |||||||||||||||||
11 | assertTrue(s, ct); | 10 | assertTrue(s, ct); |
Row | Violation |
---|