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

Method removeline

tools/reduce.py:245–260  ·  view source on GitHub ↗
(self, filedata)

Source from the content-addressed store, hash-verified

243 return filedata
244
245 def removeline(self, filedata):
246 stmt = True
247 for i in range(len(filedata)):
248 line = filedata[i]
249 strippedline = line.strip()
250
251 if len(strippedline) == 0:
252 continue
253
254 if stmt and strippedline[-1] == ';' and self.checkpar(line) and '{' not in line and '}' not in line:
255 self.replaceandrun('remove line', filedata, i, '')
256
257 elif stmt and '{' in strippedline and strippedline.find('}') == len(strippedline) - 1:
258 self.replaceandrun('remove line', filedata, i, '')
259
260 stmt = strippedline[-1] in ';{}'
261
262 def set_elapsed_time(self, elapsed_time):
263 self.__elapsed_time = elapsed_time

Callers 1

mainFunction · 0.95

Calls 3

checkparMethod · 0.95
replaceandrunMethod · 0.95
findMethod · 0.45

Tested by

no test coverage detected