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

changeset 8225
811b7fa1b8a9
parent 8224
e0ecde23e7b2
equal deleted inserted replaced
8224:e0ecde23e7b2 8225:811b7fa1b8a9
101 @type list 101 @type list
102 """ 102 """
103 if self.__ignoreCode(code): 103 if self.__ignoreCode(code):
104 return 104 return
105 105
106 if code in self.counters: 106 # record the issue with one based line number
107 self.counters[code] += 1 107 errorInfo = {
108 else: 108 "file": self.__filename,
109 self.counters[code] = 1 109 "line": lineNumber + 1,
110 "offset": offset,
111 "code": code,
112 "args": args,
113 }
110 114
111 # Don't care about expected codes 115 if errorInfo not in self.errors:
112 if code in self.__expected: 116 # this issue was not seen before
113 return 117 if code in self.counters:
114 118 self.counters[code] += 1
115 if code and (self.counters[code] == 1 or self.__repeat): 119 else:
116 # record the issue with one based line number 120 self.counters[code] = 1
117 errorInfo = { 121
118 "file": self.__filename, 122 # Don't care about expected codes
119 "line": lineNumber + 1, 123 if code in self.__expected:
120 "offset": offset, 124 return
121 "code": code, 125
122 "args": args, 126 if code and (self.counters[code] == 1 or self.__repeat):
123 }
124 if errorInfo not in self.errors:
125 self.errors.append(errorInfo) 127 self.errors.append(errorInfo)
126 128
127 def run(self): 129 def run(self):
128 """ 130 """
129 Public method to check the given source against functions 131 Public method to check the given source against functions

eric ide

mercurial