MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / checkpar

Method checkpar

tools/reduce.py:144–153  ·  view source on GitHub ↗
(self, line)

Source from the content-addressed store, hash-verified

142 self.replaceandrun('remove comment', filedata, i, line[:line.find('//')].rstrip() + '\n')
143
144 def checkpar(self, line):
145 par = 0
146 for c in line:
147 if c == '(' or c == '[':
148 par = par + 1
149 elif c == ')' or c == ']':
150 par = par - 1
151 if par < 0:
152 return False
153 return par == 0
154
155 def combinelines(self, filedata):
156 if len(filedata) < 3:

Callers 1

removelineMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected