From 1a0a3e06f5ee08033af5e47c3de6bc19594e710e Mon Sep 17 00:00:00 2001 From: AlexHaxe Date: Sun, 29 May 2016 00:07:41 +0200 Subject: [PATCH] count duplicate checks only once, closes #275 --- src/checkstyle/Main.hx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/checkstyle/Main.hx b/src/checkstyle/Main.hx index da1e13f9..5f09ee9c 100644 --- a/src/checkstyle/Main.hx +++ b/src/checkstyle/Main.hx @@ -234,9 +234,21 @@ class Main { return count; } + function getUsedCheckCount():Int { + var count = 0; + var list:Array = []; + for (check in checker.checks) { + var name = Type.getClassName(Type.getClass(check)); + if (list.indexOf(name) >= 0) continue; + list.push(name); + count++; + } + return count; + } + function createReporter(numFiles:Int):IReporter { var totalChecks = getCheckCount(); - var checksUsed = checker.checks.length; + var checksUsed = getUsedCheckCount(); return switch (REPORT_TYPE) { case "xml": new XMLReporter(numFiles, totalChecks, checksUsed, XML_PATH, STYLE, NO_STYLE); case "json": new JSONReporter(numFiles, totalChecks, checksUsed, JSON_PATH, NO_STYLE);