Revize 7fa6bc86
Přidáno uživatelem Ondřej Váně před téměř 3 roky(ů)
src/main/java/cz/zcu/fav/kiv/antipatterndetectionapp/Constants.java | ||
---|---|---|
1 |
package cz.zcu.fav.kiv.antipatterndetectionapp; |
|
2 |
|
|
3 |
public class Constants { |
|
4 |
public static final String ANTI_PATTERN_CATALOGUE_URL = "https://github.com/ReliSA/Software-process-antipatterns-catalogue/blob/master/catalogue/"; |
|
5 |
} |
src/main/java/cz/zcu/fav/kiv/antipatterndetectionapp/detecting/detectors/BusinessAsUsualDetectorImpl.java | ||
---|---|---|
23 | 23 |
put("divisionOfIterationsWithRetrospective", new Configuration<Float>("divisionOfIterationsWithRetrospective", |
24 | 24 |
"Division of iterations with retrospective", |
25 | 25 |
"Minimum percentage of the total number of iterations with a retrospective (0,1)", 0.66666f)); |
26 |
}}); |
|
26 |
}}, |
|
27 |
"Business_As_Usual.md"); |
|
27 | 28 |
|
28 | 29 |
private final String sqlFileName = "business_as_usual.sql"; |
29 | 30 |
|
src/main/java/cz/zcu/fav/kiv/antipatterndetectionapp/detecting/detectors/RoadToNowhereDetectorImpl.java | ||
---|---|---|
28 | 28 |
put("minNumberOfActivitiesWithProjectPlan", new Configuration<Integer>("minNumberOfActivitiesWithProjectPlan", |
29 | 29 |
"Minimum number of activities with project plan", |
30 | 30 |
"Number of activities", 1)); |
31 |
}}); |
|
31 |
}}, |
|
32 |
"Road_To_Nowhere.md"); |
|
32 | 33 |
|
33 | 34 |
private final String sqlFileName = "road_to_nowhere.sql"; |
34 | 35 |
// sql queries loaded from sql file |
src/main/java/cz/zcu/fav/kiv/antipatterndetectionapp/detecting/detectors/SpecifyNothingDetectorImpl.java | ||
---|---|---|
30 | 30 |
put("minAvgLengthOfActivityDescription", new Configuration<Integer>("minAvgLengthOfActivityDescription", |
31 | 31 |
"Minimum average length of activity description", |
32 | 32 |
"Minimum average number of character of activity description", 150)); |
33 |
}}); |
|
33 |
}}, |
|
34 |
"Specify_Nothing.md"); |
|
34 | 35 |
|
35 | 36 |
private final String sqlFileName = "specify_nothing.sql"; |
36 | 37 |
// sql queries loaded from sql file |
src/main/java/cz/zcu/fav/kiv/antipatterndetectionapp/model/AntiPattern.java | ||
---|---|---|
1 | 1 |
package cz.zcu.fav.kiv.antipatterndetectionapp.model; |
2 | 2 |
|
3 |
import cz.zcu.fav.kiv.antipatterndetectionapp.Constants; |
|
4 |
|
|
3 | 5 |
import java.util.Map; |
4 | 6 |
|
5 | 7 |
public class AntiPattern { |
... | ... | |
9 | 11 |
private String name; |
10 | 12 |
private String description; |
11 | 13 |
private Map<String, Configuration> configurations; |
14 |
private String catalogueFileName; |
|
12 | 15 |
|
13 | 16 |
public AntiPattern(Long id, String printName, String name, String description) { |
14 | 17 |
this.id = id; |
... | ... | |
25 | 28 |
this.configurations = configurations; |
26 | 29 |
} |
27 | 30 |
|
31 |
public AntiPattern(Long id, String printName, String name, String description, Map<String, Configuration> configurations, String catalogueFileName) { |
|
32 |
this.id = id; |
|
33 |
this.printName = printName; |
|
34 |
this.name = name; |
|
35 |
this.description = description; |
|
36 |
this.configurations = configurations; |
|
37 |
this.catalogueFileName = catalogueFileName; |
|
38 |
} |
|
39 |
|
|
28 | 40 |
public Long getId() { |
29 | 41 |
return id; |
30 | 42 |
} |
... | ... | |
69 | 81 |
return "<a href='/anti-patterns/" + this.id.toString() + "'>Detail</a>"; |
70 | 82 |
} |
71 | 83 |
|
84 |
public String getCatalogueFileName() { |
|
85 |
return catalogueFileName; |
|
86 |
} |
|
87 |
|
|
88 |
public void setCatalogueFileName(String catalogueFileName) { |
|
89 |
this.catalogueFileName = catalogueFileName; |
|
90 |
} |
|
91 |
|
|
92 |
public String getFullCatalogueUrl() { |
|
93 |
return Constants.ANTI_PATTERN_CATALOGUE_URL + this.catalogueFileName; |
|
94 |
} |
|
95 |
|
|
72 | 96 |
@Override |
73 | 97 |
public String toString() { |
74 | 98 |
return "AntiPattern{" + |
... | ... | |
77 | 101 |
", name='" + name + '\'' + |
78 | 102 |
", description='" + description + '\'' + |
79 | 103 |
", configurations=" + configurations + |
104 |
", catalogueFileName='" + catalogueFileName + '\'' + |
|
80 | 105 |
'}'; |
81 | 106 |
} |
82 | 107 |
} |
src/main/webapp/WEB-INF/templates/anti-pattern.html | ||
---|---|---|
22 | 22 |
<!-- Navigation bar imported --> |
23 | 23 |
<div th:replace="fragments/navbar :: navBar"></div> |
24 | 24 |
<!-- ./Navigation bar imported --> |
25 |
|
|
26 |
<!-- Card for anti pattern details--> |
|
25 | 27 |
<div class="card"> |
26 | 28 |
<h3 class="card-header">Anti Pattern</h3> |
27 | 29 |
<div class="card-body"> |
30 |
|
|
31 |
<!-- Anti pattern id --> |
|
28 | 32 |
<div class="form-group"> |
29 |
<label for="projectId">Anti Pattern Id:</label>
|
|
30 |
<input disabled type="text" class="form-control" id="projectId" th:value="${antiPattern.id}">
|
|
33 |
<label for="antiPatternId">Anti Pattern Id:</label>
|
|
34 |
<input disabled type="text" class="form-control" id="antiPatternId" th:value="${antiPattern.id}">
|
|
31 | 35 |
</div> |
36 |
<!-- ./Anti pattern id --> |
|
37 |
|
|
38 |
<!-- Anti pattern name --> |
|
32 | 39 |
<div class="form-group"> |
33 |
<label for="projectId">Anti Pattern name:</label>
|
|
34 |
<input disabled type="text" class="form-control" id="projectName" th:value="${antiPattern.printName}">
|
|
40 |
<label for="antiPatternName">Anti Pattern name:</label>
|
|
41 |
<input disabled type="text" class="form-control" id="antiPatternName" th:value="${antiPattern.printName}">
|
|
35 | 42 |
</div> |
43 |
<!-- ./Anti pattern name --> |
|
44 |
|
|
45 |
<!-- Anti pattern description --> |
|
36 | 46 |
<div class="form-group"> |
37 |
<label for="projectId">Anti Pattern description:</label>
|
|
38 |
<textarea disabled class="form-control" id="projectDescription" rows="5"
|
|
47 |
<label for="antiPatternDescription">Anti Pattern description:</label>
|
|
48 |
<textarea disabled class="form-control" id="antiPatternDescription" rows="5"
|
|
39 | 49 |
th:text="${antiPattern.description}"></textarea> |
40 | 50 |
</div> |
51 |
<!-- ./Anti pattern description --> |
|
52 |
|
|
53 |
<!-- Anti pattern catalogue url if is filled in AntiPattern model class --> |
|
54 |
<div class="form-group"> |
|
55 |
<label for="antiPatternCatalogueUrl">Software process Anti Patterns catalogue:</label> |
|
56 |
<br> |
|
57 |
|
|
58 |
<!-- Anti pattern catalogue file name is filled --> |
|
59 |
<a th:if="${antiPattern ne null and antiPattern.catalogueFileName ne null}" |
|
60 |
id="antiPatternCatalogueUrl" |
|
61 |
th:href="${antiPattern.getFullCatalogueUrl()}" |
|
62 |
th:text="${antiPattern.printName}" |
|
63 |
target="_blank"> |
|
64 |
</a> |
|
65 |
<!-- ./Anti pattern catalogue file name is filled --> |
|
66 |
|
|
67 |
<!-- Anti pattern catalogue file name is NOT filled --> |
|
68 |
<del><a th:unless="${antiPattern ne null and antiPattern.catalogueFileName ne null}" |
|
69 |
id="antiPatternCatalogueUrl" |
|
70 |
th:text="${antiPattern.printName}" |
|
71 |
target="_blank" |
|
72 |
style="color: grey" |
|
73 |
></a></del> |
|
74 |
<small th:unless="${antiPattern ne null and antiPattern.catalogueFileName ne null}" |
|
75 |
style="color: grey"> This anti pattern is not occur in catalogue </small> |
|
76 |
<!-- ./Anti pattern catalogue file name is NOT filled --> |
|
77 |
</div> |
|
78 |
<!-- ./Anti pattern catalogue url if is filled in AntiPattern model class --> |
|
79 |
|
|
80 |
<!-- Anti pattern configuration form --> |
|
41 | 81 |
<h5>Anti Pattern configurations</h5> |
42 | 82 |
<div th:each="config : ${antiPattern.configurations}" class="form-group"> |
43 | 83 |
<label th:text="${config.value.printName} + ':'" th:for="${config.value.name}"></label> |
44 |
<input disabled type="text" class="form-control" th:id="${config.value.name}" th:value="${config.value.value}"> |
|
45 |
<small th:text="${config.value.description}" th:value="${config.value.name}" class="form-text text-muted"></small> |
|
84 |
<input disabled type="text" class="form-control" th:id="${config.value.name}" |
|
85 |
th:value="${config.value.value}"> |
|
86 |
<small th:text="${config.value.description}" th:value="${config.value.name}" |
|
87 |
class="form-text text-muted"></small> |
|
46 | 88 |
</div> |
89 |
<!-- ./Anti pattern configuration form --> |
|
47 | 90 |
</div> |
48 | 91 |
</div> |
92 |
<!-- ./Card for anti pattern details--> |
|
49 | 93 |
|
50 | 94 |
</body> |
51 | 95 |
</html> |
Také k dispozici: Unified diff
#3 Add link to catalogue to AP detail
- added links to catalogue in AP detail
- added constant with base catalogue URL
- in each AP added string with file name to catalogue
- getter in AntiPattern class will concate base catalogue URL with catalogue file name
- catalogue file name should be declare in definition of AP