commit d04015470704bb8d601eee4274d7fdb5fca57144
Author: stepanekp <1stepanekpetr@gmail.com>
Date:   Wed Mar 23 21:05:23 2022 +0100

    minor changes

diff --git a/pom.xml b/pom.xml
index 195c36b..e8e3738 100644
--- a/pom.xml
+++ b/pom.xml
@@ -67,15 +67,22 @@
 			<artifactId>jackson-databind</artifactId>
 			<version>2.13.2</version>
 		</dependency>
+		<dependency>
+			<groupId>com.fasterxml.jackson.core</groupId>
+			<artifactId>jackson-annotations</artifactId>
+			<version>2.13.2</version>
+		</dependency>
 	</dependencies>
 
 	<build>
-		<plugins>
-			<plugin>
-				<groupId>org.springframework.boot</groupId>
-				<artifactId>spring-boot-maven-plugin</artifactId>
-			</plugin>
-		</plugins>
+		<pluginManagement>
+			<plugins>
+				<plugin>
+					<groupId>org.springframework.boot</groupId>
+					<artifactId>spring-boot-maven-plugin</artifactId>
+				</plugin>
+			</plugins>
+		</pluginManagement>
 		<resources>
 			<resource>
 				<directory>src/main/java/resources</directory>
diff --git a/src/main/java/cz/zcu/fav/kiv/antipatterndetectionapp/detecting/detectors/BusinessAsUsualDetectorImpl.java b/src/main/java/cz/zcu/fav/kiv/antipatterndetectionapp/detecting/detectors/BusinessAsUsualDetectorImpl.java
index e806382..7af0ecd 100644
--- a/src/main/java/cz/zcu/fav/kiv/antipatterndetectionapp/detecting/detectors/BusinessAsUsualDetectorImpl.java
+++ b/src/main/java/cz/zcu/fav/kiv/antipatterndetectionapp/detecting/detectors/BusinessAsUsualDetectorImpl.java
@@ -33,18 +33,15 @@ public class BusinessAsUsualDetectorImpl implements AntiPatternDetector {
     private List<String> sqlQueries;
 
     private float getDivisionOfIterationsWithRetrospective() {
-        this.antiPattern = antiPatternService.getAntiPatternFromJsonFile(configJsonFileName);
         return ((Percentage) antiPattern.getConfigurations().get("divisionOfIterationsWithRetrospective").getValue()).getValue();
     }
 
     private List<String> getSearchSubstringsWithRetrospective() {
-        this.antiPattern = antiPatternService.getAntiPatternFromJsonFile(configJsonFileName);
         return Arrays.asList(((String) antiPattern.getConfigurations().get("searchSubstringsWithRetrospective").getValue()).split("\\|\\|"));
     }
 
     @Override
     public AntiPattern getAntiPatternModel() {
-        this.antiPattern = antiPatternService.getAntiPatternFromJsonFile(configJsonFileName);
         return this.antiPattern;
     }
 
diff --git a/src/main/java/cz/zcu/fav/kiv/antipatterndetectionapp/detecting/detectors/LongOrNonExistentFeedbackLoopsDetectorImpl.java b/src/main/java/cz/zcu/fav/kiv/antipatterndetectionapp/detecting/detectors/LongOrNonExistentFeedbackLoopsDetectorImpl.java
index 2bb59ba..788f5ef 100644
--- a/src/main/java/cz/zcu/fav/kiv/antipatterndetectionapp/detecting/detectors/LongOrNonExistentFeedbackLoopsDetectorImpl.java
+++ b/src/main/java/cz/zcu/fav/kiv/antipatterndetectionapp/detecting/detectors/LongOrNonExistentFeedbackLoopsDetectorImpl.java
@@ -39,23 +39,19 @@ public class LongOrNonExistentFeedbackLoopsDetectorImpl implements AntiPatternDe
     private List<String> sqlQueries;
 
     private float getDivisionOfIterationsWithFeedbackLoop() {
-        this.antiPattern = antiPatternService.getAntiPatternFromJsonFile(configJsonFileName);
         return ((Percentage) antiPattern.getConfigurations().get("divisionOfIterationsWithFeedbackLoop").getValue()).getValue();
     }
 
     private float getMaxGapBetweenFeedbackLoopRate() {
-        this.antiPattern = antiPatternService.getAntiPatternFromJsonFile(configJsonFileName);
         return ((PositiveFloat) antiPattern.getConfigurations().get("maxGapBetweenFeedbackLoopRate").getValue()).floatValue();
     }
 
     private List<String> getSearchSubstringsWithFeedbackLoop() {
-        this.antiPattern = antiPatternService.getAntiPatternFromJsonFile(configJsonFileName);
         return Arrays.asList(((String) antiPattern.getConfigurations().get("searchSubstringsWithFeedbackLoop").getValue()).split("\\|\\|"));
     }
 
     @Override
     public AntiPattern getAntiPatternModel() {
-        this.antiPattern = antiPatternService.getAntiPatternFromJsonFile(configJsonFileName);
         return this.antiPattern;
     }
 
diff --git a/src/main/java/cz/zcu/fav/kiv/antipatterndetectionapp/detecting/detectors/NinetyNinetyRuleDetectorImpl.java b/src/main/java/cz/zcu/fav/kiv/antipatterndetectionapp/detecting/detectors/NinetyNinetyRuleDetectorImpl.java
index 4e129a0..495fdec 100644
--- a/src/main/java/cz/zcu/fav/kiv/antipatterndetectionapp/detecting/detectors/NinetyNinetyRuleDetectorImpl.java
+++ b/src/main/java/cz/zcu/fav/kiv/antipatterndetectionapp/detecting/detectors/NinetyNinetyRuleDetectorImpl.java
@@ -29,18 +29,15 @@ public class NinetyNinetyRuleDetectorImpl implements AntiPatternDetector {
     private List<String> sqlQueries;
 
     private double getMaxDivisionRange() {
-        this.antiPattern = antiPatternService.getAntiPatternFromJsonFile(configJsonFileName);
         return ((PositiveFloat) antiPattern.getConfigurations().get("maxDivisionRange").getValue()).doubleValue();
     }
 
     private int getMaxBadDivisionLimit() {
-        this.antiPattern = antiPatternService.getAntiPatternFromJsonFile(configJsonFileName);
         return ((PositiveInteger) antiPattern.getConfigurations().get("maxBadDivisionLimit").getValue()).intValue();
     }
 
     @Override
     public AntiPattern getAntiPatternModel() {
-        this.antiPattern = antiPatternService.getAntiPatternFromJsonFile(configJsonFileName);
         return this.antiPattern;
     }
 
diff --git a/src/main/java/cz/zcu/fav/kiv/antipatterndetectionapp/detecting/detectors/RoadToNowhereDetectorImpl.java b/src/main/java/cz/zcu/fav/kiv/antipatterndetectionapp/detecting/detectors/RoadToNowhereDetectorImpl.java
index 6e0b4d3..13d13d5 100644
--- a/src/main/java/cz/zcu/fav/kiv/antipatterndetectionapp/detecting/detectors/RoadToNowhereDetectorImpl.java
+++ b/src/main/java/cz/zcu/fav/kiv/antipatterndetectionapp/detecting/detectors/RoadToNowhereDetectorImpl.java
@@ -39,23 +39,19 @@ public class RoadToNowhereDetectorImpl implements AntiPatternDetector {
     private List<String> sqlQueries;
 
     private int getMinNumberOfWikiPagesWithProjectPlan() {
-        this.antiPattern = antiPatternService.getAntiPatternFromJsonFile(configJsonFileName);
         return ((PositiveInteger) antiPattern.getConfigurations().get("minNumberOfWikiPagesWithProjectPlan").getValue()).intValue();
     }
 
     private int getMinNumberOfActivitiesWithProjectPlan() {
-        this.antiPattern = antiPatternService.getAntiPatternFromJsonFile(configJsonFileName);
         return ((PositiveInteger) antiPattern.getConfigurations().get("minNumberOfActivitiesWithProjectPlan").getValue()).intValue();
     }
 
     private List<String> getSearchSubstringsWithProjectPlan() {
-        this.antiPattern = antiPatternService.getAntiPatternFromJsonFile(configJsonFileName);
         return Arrays.asList(((String) antiPattern.getConfigurations().get("searchSubstringsWithProjectPlan").getValue()).split("\\|\\|"));
     }
 
     @Override
     public AntiPattern getAntiPatternModel() {
-        this.antiPattern = antiPatternService.getAntiPatternFromJsonFile(configJsonFileName);
         return this.antiPattern;
     }
 
diff --git a/src/main/java/cz/zcu/fav/kiv/antipatterndetectionapp/detecting/detectors/SpecifyNothingDetectorImpl.java b/src/main/java/cz/zcu/fav/kiv/antipatterndetectionapp/detecting/detectors/SpecifyNothingDetectorImpl.java
index 1369e0a..400d997 100644
--- a/src/main/java/cz/zcu/fav/kiv/antipatterndetectionapp/detecting/detectors/SpecifyNothingDetectorImpl.java
+++ b/src/main/java/cz/zcu/fav/kiv/antipatterndetectionapp/detecting/detectors/SpecifyNothingDetectorImpl.java
@@ -38,28 +38,23 @@ public class SpecifyNothingDetectorImpl implements AntiPatternDetector {
     private List<String> sqlQueries;
 
     private int getMinNumberOfWikiPagesWithSpecification() {
-        this.antiPattern = antiPatternService.getAntiPatternFromJsonFile(configJsonFileName);
         return ((PositiveInteger) antiPattern.getConfigurations().get("minNumberOfWikiPagesWithSpecification").getValue()).intValue();
     }
 
     private int getMinNumberOfActivitiesWithSpecification() {
-        this.antiPattern = antiPatternService.getAntiPatternFromJsonFile(configJsonFileName);
         return ((PositiveInteger) antiPattern.getConfigurations().get("minNumberOfActivitiesWithSpecification").getValue()).intValue();
     }
 
     private int getMinAvgLengthOfActivityDescription() {
-        this.antiPattern = antiPatternService.getAntiPatternFromJsonFile(configJsonFileName);
         return ((PositiveInteger) antiPattern.getConfigurations().get("minAvgLengthOfActivityDescription").getValue()).intValue();
     }
 
     private List<String> getSearchSubstringsWithProjectSpecification() {
-        this.antiPattern = antiPatternService.getAntiPatternFromJsonFile(configJsonFileName);
         return Arrays.asList(((String) antiPattern.getConfigurations().get("searchSubstringsWithProjectSpecification").getValue()).split("\\|\\|"));
     }
 
     @Override
     public AntiPattern getAntiPatternModel() {
-        this.antiPattern = antiPatternService.getAntiPatternFromJsonFile(configJsonFileName);
         return this.antiPattern;
     }
 
diff --git a/src/main/java/cz/zcu/fav/kiv/antipatterndetectionapp/detecting/detectors/TooLongSprintDetectorImpl.java b/src/main/java/cz/zcu/fav/kiv/antipatterndetectionapp/detecting/detectors/TooLongSprintDetectorImpl.java
index fac58b1..6ea6abe 100644
--- a/src/main/java/cz/zcu/fav/kiv/antipatterndetectionapp/detecting/detectors/TooLongSprintDetectorImpl.java
+++ b/src/main/java/cz/zcu/fav/kiv/antipatterndetectionapp/detecting/detectors/TooLongSprintDetectorImpl.java
@@ -31,7 +31,6 @@ public class TooLongSprintDetectorImpl implements AntiPatternDetector {
 
     @Override
     public AntiPattern getAntiPatternModel() {
-        this.antiPattern = antiPatternService.getAntiPatternFromJsonFile(configJsonFileName);
         return this.antiPattern;
     }
 
@@ -47,12 +46,10 @@ public class TooLongSprintDetectorImpl implements AntiPatternDetector {
     }
 
     private Integer getMaxIterationLength() {
-        this.antiPattern = antiPatternService.getAntiPatternFromJsonFile(configJsonFileName);
         return ((PositiveInteger) this.antiPattern.getConfigurations().get("maxIterationLength").getValue()).intValue();
     }
 
     private Integer getMaxNumberOfTooLongIterations() {
-        this.antiPattern = antiPatternService.getAntiPatternFromJsonFile(configJsonFileName);
         return ((PositiveInteger) this.antiPattern.getConfigurations().get("maxNumberOfTooLongIterations").getValue()).intValue();
     }
 
diff --git a/src/main/java/cz/zcu/fav/kiv/antipatterndetectionapp/detecting/detectors/VaryingSprintLengthDetectorImpl.java b/src/main/java/cz/zcu/fav/kiv/antipatterndetectionapp/detecting/detectors/VaryingSprintLengthDetectorImpl.java
index c73ee0f..7a4cf58 100644
--- a/src/main/java/cz/zcu/fav/kiv/antipatterndetectionapp/detecting/detectors/VaryingSprintLengthDetectorImpl.java
+++ b/src/main/java/cz/zcu/fav/kiv/antipatterndetectionapp/detecting/detectors/VaryingSprintLengthDetectorImpl.java
@@ -35,18 +35,15 @@ public class VaryingSprintLengthDetectorImpl implements AntiPatternDetector {
     private List<String> sqlQueries;
 
     private Integer getMaxDaysDifference() {
-        this.antiPattern = antiPatternService.getAntiPatternFromJsonFile(configJsonFileName);
         return ((PositiveInteger) this.antiPattern.getConfigurations().get("maxDaysDifference").getValue()).intValue();
     }
 
     private Integer getMaxIterationChanged() {
-        this.antiPattern = antiPatternService.getAntiPatternFromJsonFile(configJsonFileName);
         return ((PositiveInteger) this.antiPattern.getConfigurations().get("maxIterationChanged").getValue()).intValue();
     }
 
     @Override
     public AntiPattern getAntiPatternModel() {
-        this.antiPattern = antiPatternService.getAntiPatternFromJsonFile(configJsonFileName);
         return this.antiPattern;
     }
 
diff --git a/src/main/webapp/WEB-INF/templates/anti-pattern.html b/src/main/webapp/WEB-INF/templates/anti-pattern.html
index b6bd107..a281156 100644
--- a/src/main/webapp/WEB-INF/templates/anti-pattern.html
+++ b/src/main/webapp/WEB-INF/templates/anti-pattern.html
@@ -92,6 +92,9 @@
                     <button type="button" class="btn rt" data-element="underline">
                         <i class="fa fa-underline"></i>
                     </button>
+                    <button type="button" class="btn rt" data-element="codeFormat">
+                        <i class="fa fa-code"></i>
+                    </button>
                     <button type="button" class="btn rt" data-element="justifyLeft">
                         <i class="fa fa-align-left"></i>
                     </button>
@@ -170,7 +173,7 @@
 <!-- ./Card for anti pattern details-->
 
 <!-- Scripts -->
-<script th:src="@{/resources/js/richtext-editor.js}"></script>
+<script th:src="@{/resources/js/editor.js}"></script>
 <script th:src="@{/resources/js/login.js}"></script>
 <!-- ./Scripts -->
 
diff --git a/src/main/webapp/operationalizations/TooLongSprint.html b/src/main/webapp/operationalizations/TooLongSprint.html
index 4d59a9e..0575878 100644
--- a/src/main/webapp/operationalizations/TooLongSprint.html
+++ b/src/main/webapp/operationalizations/TooLongSprint.html
@@ -1 +1 @@
-<div><h1>This is h1</h1></div><div>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nulla est. </div><div>Etiam commodo dui eget wisi. <b>Fusce tellus </b>odio, dapibus id fermentum quis, suscipit id erat. </div><div>Fusce aliquam vestibulum ipsum. Nullam sit amet magna in <u>magna</u> gravida vehicula. </div><div><i>Ut tempus purus at lorem.</i> </div><div><br></div><div><ul><li>Lorem ipsum</li><li>Lorem ipsum</li><li>Lorem ipsum</li></ul><div><a href="https://www.fav.zcu.cz/cs/">https://www.fav.zcu.cz/cs/</a><br></div></div><div><br></div><div><img src="/operationalizations/images/test2.png"><br></div><div><br></div><h2>This is h2</h2><h3>This is h3</h3><div>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, </div><div>totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. </div><div>Sed vel lectus. Donec odio tempus molestie, porttitor ut, iaculis quis, sem. </div><div><br></div><div><img src="/operationalizations/images/testImage.png"><br></div><div><br></div>
\ No newline at end of file
+<div><h1>This is h1</h1></div><div><b>Lorem </b>ipsum dolor sit amet, consectetuer adipiscing elit. Nulla est. </div><div>Etiam commodo dui eget wisi. <b>Fusce tellus </b>odio, dapibus <span style="color: rgb(33, 37, 41); font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 14px;">id</span><pre>fermentum</pre><pre>test</pre><pre>suscipit id erat. </pre></div><div><b></b><pre><b>Fusce</b><span style="font-size: 1rem;"> aliquam vestibulum ipsum. Nullam sit amet magna in </span><u style="font-size: 1rem;">magna</u><span style="font-size: 1rem;"> gravida vehicula. </span></pre></div><div><i>Ut tempus purus at lorem.</i> </div><div></div><div><br></div><div><ul><li>Lorem ipsum</li><li>Lorem ipsum</li><li>Lorem ipsum</li></ul><div><a href="https://www.fav.zcu.cz/cs/">https://www.fav.zcu.cz/cs/</a><br></div></div><div><br></div><div><img src="/operationalizations/images/test2.png"><br></div><div><br></div><h2>This is h2</h2><h3>This is h3</h3><div>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, </div><div>totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. </div><div>Sed vel lectus. Donec odio tempus molestie, porttitor ut, iaculis quis, sem. </div><div><br></div><div><img src="/operationalizations/images/testImage.png"><br></div><div><br></div>
\ No newline at end of file
diff --git a/src/main/webapp/resources/js/editor.js b/src/main/webapp/resources/js/editor.js
index ac04ccc..a0db080 100644
--- a/src/main/webapp/resources/js/editor.js
+++ b/src/main/webapp/resources/js/editor.js
@@ -75,6 +75,9 @@ elements.forEach(element => {
         else if(command == 'header3'){
             headerH3();
         }
+        else if(command = 'codeFormat'){
+            codeFormat();
+        }
         else{
             document.execCommand(command, false, null);
         }
@@ -170,3 +173,17 @@ function headerH3() {
         document.execCommand('insertHTML',false,'<h3>'+S+'</h3>');
     }
 }
+
+function codeFormat() {
+    let S=window.getSelection().toString();
+    if(S.length == 0)
+        return;
+    if(window.getSelection().anchorNode.parentNode.nodeName.toLowerCase() ===  'pre'){
+        document.execCommand('formatBlock', false, 'div');
+        document.execCommand('insertHTML',false, S);
+    }
+    else{
+        document.execCommand('delete',false,'');
+        document.execCommand('insertHTML',false, '<pre>test</pre>');
+    }
+}
