1 |
1 |
package cz.zcu.fav.kiv.antipatterndetectionapp.detecting.detectors;
|
2 |
2 |
|
3 |
3 |
import cz.zcu.fav.kiv.antipatterndetectionapp.detecting.DatabaseConnection;
|
4 |
|
import cz.zcu.fav.kiv.antipatterndetectionapp.model.AntiPattern;
|
5 |
|
import cz.zcu.fav.kiv.antipatterndetectionapp.model.Project;
|
6 |
|
import cz.zcu.fav.kiv.antipatterndetectionapp.model.QueryResultItem;
|
7 |
|
import cz.zcu.fav.kiv.antipatterndetectionapp.model.ResultDetail;
|
|
4 |
import cz.zcu.fav.kiv.antipatterndetectionapp.model.*;
|
8 |
5 |
import org.slf4j.Logger;
|
9 |
6 |
import org.slf4j.LoggerFactory;
|
10 |
7 |
|
... | ... | |
21 |
18 |
"Business As Usual",
|
22 |
19 |
"BusinessAsUsual",
|
23 |
20 |
"Absence of a retrospective after individual " +
|
24 |
|
"iterations or after the completion project.");
|
|
21 |
"iterations or after the completion project.",
|
|
22 |
new HashMap<>() {{
|
|
23 |
put("divisionOfIterationsWithRetrospective", new Configuration<Float>("divisionOfIterationsWithRetrospective",
|
|
24 |
"Division of iterations with retrospective",
|
|
25 |
"Minimum percentage of the total number of iterations with a retrospective (0,1)", 0.66666f));
|
|
26 |
}});
|
25 |
27 |
|
26 |
28 |
private final String sqlFileName = "business_as_usual.sql";
|
27 |
29 |
|
28 |
30 |
// sql queries loaded from sql file
|
29 |
31 |
private List<String> sqlQueries;
|
30 |
|
|
31 |
|
/**
|
32 |
|
* SETTINGS
|
33 |
|
*/
|
34 |
|
private final float DIVISION_BUSINESS_AS_USUAL_ITERATIONS = (float) 1/3;
|
|
32 |
|
|
33 |
private float getDivisionOfIterationsWithRetrospective() {
|
|
34 |
return (float) antiPattern.getConfigurations().get("divisionOfIterationsWithRetrospective").getValue();
|
|
35 |
}
|
35 |
36 |
|
36 |
37 |
@Override
|
37 |
38 |
public AntiPattern getAntiPatternModel() {
|
... | ... | |
99 |
100 |
|
100 |
101 |
}
|
101 |
102 |
|
102 |
|
int minRetrospectiveLimit = totalNumberIterations.intValue() - Math.round(totalNumberIterations * DIVISION_BUSINESS_AS_USUAL_ITERATIONS);
|
|
103 |
int minRetrospectiveLimit = Math.round(totalNumberIterations * getDivisionOfIterationsWithRetrospective());
|
103 |
104 |
|
104 |
105 |
resultDetails.add(new ResultDetail("Min retrospective limit", String.valueOf(minRetrospectiveLimit)));
|
105 |
106 |
resultDetails.add(new ResultDetail("Found retrospectives", String.valueOf(iterationsResults.size())));
|
Configuration - Business As Usual