eric6/Plugins/CheckerPlugins/CodeStyleChecker/Simplify/SimplifyChecker.py

changeset 8225
811b7fa1b8a9
parent 8224
e0ecde23e7b2
--- a/eric6/Plugins/CheckerPlugins/CodeStyleChecker/Simplify/SimplifyChecker.py	Mon Apr 12 18:13:52 2021 +0200
+++ b/eric6/Plugins/CheckerPlugins/CodeStyleChecker/Simplify/SimplifyChecker.py	Mon Apr 12 18:24:20 2021 +0200
@@ -103,25 +103,27 @@
         if self.__ignoreCode(code):
             return
         
-        if code in self.counters:
-            self.counters[code] += 1
-        else:
-            self.counters[code] = 1
-        
-        # Don't care about expected codes
-        if code in self.__expected:
-            return
+        # record the issue with one based line number
+        errorInfo = {
+            "file": self.__filename,
+            "line": lineNumber + 1,
+            "offset": offset,
+            "code": code,
+            "args": args,
+        }
         
-        if code and (self.counters[code] == 1 or self.__repeat):
-            # record the issue with one based line number
-            errorInfo = {
-                "file": self.__filename,
-                "line": lineNumber + 1,
-                "offset": offset,
-                "code": code,
-                "args": args,
-            }
-            if errorInfo not in self.errors:
+        if errorInfo not in self.errors:
+            # this issue was not seen before
+            if code in self.counters:
+                self.counters[code] += 1
+            else:
+                self.counters[code] = 1
+            
+            # Don't care about expected codes
+            if code in self.__expected:
+                return
+            
+            if code and (self.counters[code] == 1 or self.__repeat):
                 self.errors.append(errorInfo)
     
     def run(self):

eric ide

mercurial