Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleChecker.py

changeset 5661
ae4f5cdc3d00
parent 5619
ab999dc48132
child 5672
495b53f37f6c
--- a/Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleChecker.py	Sat Mar 25 17:18:12 2017 +0100
+++ b/Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleChecker.py	Sat Mar 25 17:36:50 2017 +0100
@@ -18,7 +18,8 @@
 
 from DocStyleChecker import DocStyleChecker
 from MiscellaneousChecker import MiscellaneousChecker
-from McCabeChecker import McCabeChecker
+# TODO: rename the following module
+from ComplexityChecker import ComplexityChecker
 
 
 def initService():
@@ -188,16 +189,16 @@
     @param args arguments used by the codeStyleCheck function (list of
         excludeMessages (str), includeMessages (str), repeatMessages
         (bool), fixCodes (str), noFixCodes (str), fixIssues (bool),
-        maxLineLength (int), hangClosing (bool), docType (str), maximum
-        allowed code complexity (int), dictionary with arguments for the
-        miscellaneous checker (dict), errors (list of str), eol (str),
-        encoding (str), backup (bool))
+        maxLineLength (int), hangClosing (bool), docType (str), dictionary
+        with arguments for the code complexity checker (dict), dictionary
+        with arguments for the miscellaneous checker (dict), errors (list
+        of str), eol (str), encoding (str), backup (bool))
     @return tuple of statistics (dict) and results (tuple for each found
         violation of style (tuple of lineno (int), position (int), text (str),
         ignored (bool), fixed (bool), autofixing (bool), fixedMsg (str)))
     """
     (excludeMessages, includeMessages, repeatMessages, fixCodes, noFixCodes,
-     fixIssues, maxLineLength, hangClosing, docType, maxComplexity,
+     fixIssues, maxLineLength, hangClosing, docType, codeComplexityArgs,
      miscellaneousArgs, errors, eol, encoding, backup) = args
     
     stats = {}
@@ -259,12 +260,12 @@
         stats.update(miscellaneousChecker.counters)
         errors += miscellaneousChecker.errors
         
-        # check code complexity iaw. McCabe
-        mccabeChecker = McCabeChecker(
-            source, filename, select, ignore, maxComplexity)
-        mccabeChecker.run()
-        stats.update(mccabeChecker.counters)
-        errors += mccabeChecker.errors
+        # check code complexity
+        complexityChecker = ComplexityChecker(
+            source, filename, select, ignore, codeComplexityArgs)
+        complexityChecker.run()
+        stats.update(complexityChecker.counters)
+        errors += complexityChecker.errors
     
     errorsDict = {}
     for fname, lineno, position, text in errors:

eric ide

mercurial