File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/visualizers/StatVisualizer.java | File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/visualizers/SummaryReport.java | |||
Method name: void add(SampleResult)
|
Method name: void add(SampleResult)
|
|||
Number of AST nodes: 14 | Number of AST nodes: 14 | |||
1 | SamplingStatCalculator row = null;↵ | 1 | Calculator row = null;↵ | |
2 | final String sampleLabel = res.getSampleLabel(useGroupName.isSelected());↵ | 2 | final String sampleLabel = res.getSampleLabel(useGroupName.isSelected());↵ | |
3 | synchronized (tableRows) {↵ | 3 | synchronized (tableRows) {↵ | |
4 | row = (SamplingStatCalculator) tableRows.get(sampleLabel);↵ | 4 | row = (Calculator) tableRows.get(sampleLabel);↵ | |
5 | if (row == null) {↵ | 5 | if (row == null) {↵ | |
6 | row = new SamplingStatCalculator(sampleLabel);↵ | 6 | row = new Calculator(sampleLabel);↵ | |
7 | tableRows.put(row.getLabel(), row);↵ | 7 | tableRows.put(row.getLabel(), row);↵ | |
8 | model.insertRow(row, model.getRowCount() - 1);↵ | 8 | model.insertRow(row, model.getRowCount() - 1);↵ | |
9 | }↵ | 9 | }↵ | |
10 | }↵ | 10 | }↵ | |
11 | /*↵ | |||
12 | ↵ | 11 | /*↵ | |
13 | * Synch is needed because multiple threads can update the counts.↵ | 12 | * Synch is needed because multiple threads can update the counts.↵ | |
14 | */↵ | |||
15 | ↵ | 13 | */↵ | |
16 | synchronized(row) { ↵ | 14 | synchronized(row) {↵ | |
17 | row.addSample(res);↵ | 15 | row.addSample(res);↵ | |
18 | }↵ | |||
19 | SamplingStat↵ | 16 | }↵ | |
20 | Calculator tot = (SamplingStatCalculator) tableRows.get(TOTAL_ROW_LABEL);↵ | 17 | Calculator tot = ((Calculator) tableRows.get(TOTAL_ROW_LABEL));↵ | |
21 | synchronized(tot) {↵ | 18 | synchronized(tot) {↵ | |
22 | tot.addSample(res);↵ | 19 | tot.addSample(res);↵ | |
23 | }↵ | 20 | }↵ | |
24 | model.fireTableDataChanged(); | 21 |
| |
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 different classes having the same super class |
Number of node comparisons | 49 |
Number of mapped statements | 12 |
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) | 6.2 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | SamplingStatCalculator row = null; | 1 | Calculator row = null; | |||||||||||||
2 | final String sampleLabel = res.getSampleLabel(useGroupName.isSelected()); | 2 | final String sampleLabel = res.getSampleLabel(useGroupName.isSelected()); | |||||||||||||
3 | synchronized (tableRows) | 3 | synchronized (tableRows) | |||||||||||||
4 | row = (SamplingStatCalculator)tableRows.get(sampleLabel); | 4 | row = (Calculator)tableRows.get(sampleLabel); | |||||||||||||
5 | if (row == null) | 5 | if (row == null) | |||||||||||||
6 | row = new SamplingStatCalculator(sampleLabel); | 6 | row = new Calculator(sampleLabel); | |||||||||||||
7 | tableRows.put(row.getLabel(), row); | 7 | tableRows.put(row.getLabel(), row); | |||||||||||||
8 | model.insertRow(row, model.getRowCount() - 1); | 8 | model.insertRow(row, model.getRowCount() - 1); | |||||||||||||
9 | synchronized (row) | 9 | synchronized (row) | |||||||||||||
| 10 | row.addSample(res); | ||||||||||||||
10 | row.addSample(res); | | ||||||||||||||
11 | SamplingStatCalculator tot = (SamplingStatCalculator)tableRows.get(TOTAL_ROW_LABEL); |
| 11 | Calculator tot = ((Calculator)tableRows.get(TOTAL_ROW_LABEL)); | ||||||||||||
12 | synchronized (tot) | 12 | synchronized (tot) | |||||||||||||
| 13 | tot.addSample(res); | ||||||||||||||
13 | tot.addSample(res); | | ||||||||||||||
14 | model.fireTableDataChanged(); | 14 | model.fireTableDataChanged(); |
Row | Violation |
---|---|
1 | Expression (SamplingStatCalculator)tableRows.get(TOTAL_ROW_LABEL) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression ((Calculator)tableRows.get(TOTAL_ROW_LABEL)) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Clone fragment #1 returns variables row, tot , while Clone fragment #2 returns variables row, tot |