ottlinger commented on code in PR #387:
URL: https://github.com/apache/creadur-rat/pull/387#discussion_r1835787236


##########
apache-rat-core/src/main/java/org/apache/rat/report/claim/ClaimStatistic.java:
##########
@@ -19,34 +19,94 @@
 
 package org.apache.rat.report.claim;
 
-import java.util.Collections;
-import java.util.Set;
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.List;
+import java.util.Locale;
 import java.util.concurrent.ConcurrentHashMap;
 
+import org.apache.commons.lang3.StringUtils;
 import org.apache.rat.api.Document;
 
 /**
  * This class provides a numerical overview about
  * the report.
  */
 public class ClaimStatistic {
+    // keep the counter types in alphabetical order
     /** The counter types */
     public enum Counter {
         /** count of approved files */
-        APPROVED,
-        /** count of unapproved files */
-        UNAPPROVED,
+        APPROVED("A count of approved licenses.", -1, 0),
+        /** count of archive files */
+        ARCHIVES("A count of archive files.", -1, 0),
+        /** count of binary  files */
+        BINARIES("A count of binary files.", -1, 0),
+        /** count of distinct document types */
+        DOCUMENT_TYPES("A count of distinct document types.", -1, 1),
         /** count of generated files */
-        GENERATED,
+        GENERATED("A count of generated files.", -1, 0),
+        /** count of license categories */
+        LICENSE_CATEGORIES("A count of distinct license categories.", -1, 1),
+        /** count of distinct license names */
+        LICENSE_NAMES("A count of distinct license names.", -1, 1),
+        /** count of note files */
+        NOTICES("A count of notice files.", -1, 0),
+        /** count of standard files */
+        STANDARDS("A count of standard files.", -1, 1),
+        /** count of unapproved files */
+        UNAPPROVED("A count of unapproved licenses.", 0, 0),
         /** count of unknown files */
-        UNKNOWN }
+        UNKNOWN("A count of unknown file types.", -1, 0);
+
+
+        /** The description of the Counter */
+        private String description;
+        /** The default max value for the counter */
+        private int defaultMaxValue;
+        /** THe default minimum value for the counter */
+        private int defaultMinValue;
+
+        Counter(final String description, final int defaultMaxValue, final int 
defaultMinValue) {
+            this.description = description;
+            this.defaultMaxValue = defaultMaxValue;
+            this.defaultMinValue = defaultMinValue;
+        }
+
+        /**
+         * Gets the description of the counter.
+         * @return The description of the Counter.
+         */
+        public String getDescription() {
+            return description;
+        }
+
+        /**
+         * Gets the default maximum value for the counter.
+         * @return the default maximum value for the counter.
+         */
+        public int getDefaultMaxValue() {
+            return defaultMaxValue;
+        }
+        /**
+         * Gets the default minimum value for the counter.
+         * @return the default maximum value for the counter.
+         */
+        public int getDefaultMinValue() {
+            return defaultMinValue;
+        }
+
+        public String displayName() {
+            return StringUtils.capitalize(name().replaceAll("_", " 
").toLowerCase(Locale.ROOT));
+        }
+    }
 
     /** Count of license family name to counter */
-    private final ConcurrentHashMap<String, IntCounter> licenseFamilyNameMap = 
new ConcurrentHashMap<>();
+    private final ConcurrentHashMap<String, IntCounter> licenseNameMap = new 
ConcurrentHashMap<>();

Review Comment:
   ok



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to