src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/Complexity/ComplexityChecker.py

branch
eric7
changeset 11147
dee6e106b4d3
parent 11145
d328a7b74fd8
child 11150
73d80859079c
diff -r 59e04f7003e9 -r dee6e106b4d3 src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/Complexity/ComplexityChecker.py
--- a/src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/Complexity/ComplexityChecker.py	Sun Feb 23 12:42:47 2025 +0100
+++ b/src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/Complexity/ComplexityChecker.py	Mon Feb 24 15:11:18 2025 +0100
@@ -19,9 +19,9 @@
     """
 
     Codes = [
-        "C101",
-        "C111",
-        "C112",
+        "C-101",
+        "C-111",
+        "C-112",
     ]
 
     def __init__(self, source, filename, tree, select, ignore, args):
@@ -61,8 +61,8 @@
         self.errors = []
 
         checkersWithCodes = [
-            (self.__checkMcCabeComplexity, ("C101",)),
-            (self.__checkLineComplexity, ("C111", "C112")),
+            (self.__checkMcCabeComplexity, ("C-101",)),
+            (self.__checkLineComplexity, ("C-111", "C-112")),
         ]
 
         self.__checkers = []
@@ -152,7 +152,7 @@
         visitor.preorder(tree, visitor)
         for graph in visitor.graphs.values():
             if graph.complexity() > maxComplexity:
-                self.__error(graph.lineno, 0, "C101", graph.entity, graph.complexity())
+                self.__error(graph.lineno, 0, "C-101", graph.entity, graph.complexity())
 
     def __checkLineComplexity(self):
         """
@@ -177,10 +177,10 @@
 
         for line, complexity in sortedItems:
             if complexity > maxLineComplexity:
-                self.__error(line, 0, "C111", complexity)
+                self.__error(line, 0, "C-111", complexity)
 
         if score > maxLineComplexityScore:
-            self.__error(0, 0, "C112", score)
+            self.__error(0, 0, "C-112", score)
 
 
 class LineComplexityVisitor(ast.NodeVisitor):

eric ide

mercurial