Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 7956c618

Přidáno uživatelem stepanekp před asi 3 roky(ů)

#14 Display of configuration threshold values

Zobrazit rozdíly:

src/main/java/cz/zcu/fav/kiv/antipatterndetectionapp/controller/AppController.java
215 215
     * @return html file name for thymeleaf template
216 216
     */
217 217
    @GetMapping("/configuration")
218
    public String configuration(Model model) {
218
    public String configuration(Model model, HttpSession session) {
219 219
        model.addAttribute("antiPatterns", antiPatternService.antiPatternsToModel(antiPatternService.getAllAntiPatterns()));
220

  
221
        String currentConfigurationName = configurationGetFromSession(session);
222
        model.addAttribute("configurations", configurationService.getConfigurationByName(currentConfigurationName));
220 223
        return "configuration";
221 224
    }
222 225

  
src/main/java/cz/zcu/fav/kiv/antipatterndetectionapp/service/ConfigurationServiceImpl.java
18 18
    public List<String> getAllConfigurationNames() {
19 19
        List<String> configList = new ArrayList<String>();
20 20

  
21
        // insert default configuration
22
        configList.add("Default");
23

  
24 21
        // get all external configurations
25 22
        for (String key : configurationRepository.allConfigurations.keySet() ) {
26 23
            configList.add(key);
src/main/webapp/WEB-INF/templates/configuration.html
46 46
                                   class="form-text text-muted"></small>
47 47
                            <div id="wrapper">
48 48
                                <div id="first">
49
                                    <input th:if="${threshold.value.isErrorMessageShown}" th:value="${threshold.value.value}"
49
                                    <input th:if="${threshold.value.isErrorMessageShown}" th:value="${configurations.get(antiPattern.name).get(threshold.value.name)}"
50 50
                                           class="form-control is-invalid" th:id="${threshold.value.name}"
51 51
                                           name="thresholdValues">
52 52
                                    <input th:unless="${threshold.value.isErrorMessageShown}"
53
                                           th:value="${threshold.value.value}"
53
                                           th:value="${configurations.get(antiPattern.name).get(threshold.value.name)}"
54 54
                                           class="form-control" th:id="${threshold.value.name}"
55 55
                                           name="thresholdValues">
56 56
                                    <input th:value="${threshold.value.name}" style="display: none" class="form-control"
src/main/webapp/configurations/Default.json
1
{
2
    "configuration": [
3
        {
4
            "antiPattern": "TooLongSprint",
5
            "thresholds": [
6
                {
7
                    "thresholdName": "maxIterationLength",
8
                    "value": "21"
9
                },
10
                {
11
                    "thresholdName": "maxNumberOfTooLongIterations",
12
                    "value": "0"
13
                }
14
            ]
15
        },
16
        {
17
            "antiPattern": "VaryingSprintLength",
18
            "thresholds": [
19
                {
20
                    "thresholdName": "maxDaysDifference",
21
                    "value": "7"
22
                },
23
                {
24
                    "thresholdName": "maxIterationChanged",
25
                    "value": "1"
26
                }
27
            ]
28
        },
29
        {
30
            "antiPattern": "BusinessAsUsual",
31
            "thresholds": [
32
                {
33
                    "thresholdName": "divisionOfIterationsWithRetrospective",
34
                    "value": "66.66f"
35
                },
36
                {
37
                    "thresholdName": "searchSubstringsWithRetrospective",
38
                    "value": "%retr%||%revi%||%week%scrum%"
39
                }
40
            ]
41
        },
42
        {
43
            "antiPattern": "SpecifyNothing",
44
            "thresholds": [
45
                {
46
                    "thresholdName": "minNumberOfWikiPagesWithSpecification",
47
                    "value": "1"
48
                },
49
                {
50
                    "thresholdName": "minNumberOfActivitiesWithSpecification",
51
                    "value": "1"
52
                },
53
                {
54
                    "thresholdName": "minAvgLengthOfActivityDescription",
55
                    "value": "150"
56
                },
57
                {
58
                    "thresholdName": "searchSubstringsWithProjectSpecification",
59
                    "value": "%dsp%||%specifikace%||%specification%||%vize%proj%||%vize%produ%"
60
                }
61
            ]
62
        },
63
        {
64
            "antiPattern": "RoadToNowhere",
65
            "thresholds": [
66
                {
67
                    "thresholdName": "minNumberOfWikiPagesWithProjectPlan",
68
                    "value": "1"
69
                },
70
                {
71
                    "thresholdName": "minNumberOfActivitiesWithProjectPlan",
72
                    "value": "1"
73
                },
74
                {
75
                    "thresholdName": "searchSubstringsWithProjectPlan",
76
                    "value": "%plán projektu%||%project plan%||%plan project%||%projektový plán%"
77
                }
78
            ]
79
        },
80
        {
81
            "antiPattern": "LongOrNonExistentFeedbackLoops",
82
            "thresholds": [
83
                {
84
                    "thresholdName": "divisionOfIterationsWithFeedbackLoop",
85
                    "value": "50.00f"
86
                },
87
                {
88
                    "thresholdName": "maxGapBetweenFeedbackLoopRate",
89
                    "value": "2f"
90
                },
91
                {
92
                    "thresholdName": "searchSubstringsWithFeedbackLoop",
93
                    "value": "%schůz%zákazník%||%předvedení%zákazník%||%zákazn%demo%||%schůz%zadavat%||%inform%schůz%||%zákazn%||%zadavatel%"
94
                }
95
            ]
96
        },
97
        {
98
            "antiPattern": "NinetyNinetyRule",
99
            "thresholds": [
100
                {
101
                    "thresholdName": "maxDivisionRange",
102
                    "value": "1.25f"
103
                },
104
                {
105
                    "thresholdName": "maxBadDivisionLimit",
106
                    "value": "2"
107
                }
108
            ]
109
        }
110
    ]
111
}

Také k dispozici: Unified diff