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

Function count_errors

tools/compare-valueflow-options.py:27–38  ·  view source on GitHub ↗
(errout:str, c:set)

Source from the content-addressed store, hash-verified

25
26
27def count_errors(errout:str, c:set):
28 for line in errout.split('\n'):
29 if not line.endswith(']'):
30 continue
31 res = re.match(r'^[^:]+:[0-9]+:[0-9]+: (error|warning|style|portability|performance):.*\[([a-zA-Z0-9_\-]+)\]$', line)
32 if res is None:
33 print('No warning? ' + line)
34 continue
35 severity = res.group(1)
36 c[severity] = c.get(severity, 0) + 1
37 error_id = res.group(2)
38 c[error_id] = c.get(error_id, 0) + 1
39
40
41if __name__ == "__main__":

Callers 1

Calls 2

matchMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected