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

Function reportError

addons/cppcheckdata.py:1677–1696  ·  view source on GitHub ↗
(location, severity, message, addon, errorId, extra='', columnOverride=None)

Source from the content-addressed store, hash-verified

1675 sys.stdout.write(json.dumps(msg) + '\n')
1676
1677def reportError(location, severity, message, addon, errorId, extra='', columnOverride=None):
1678 if '--cli' in sys.argv:
1679 msg = { 'file': location.file,
1680 'linenr': location.linenr,
1681 'column': location.column if columnOverride is None else columnOverride,
1682 'severity': severity,
1683 'message': message,
1684 'addon': addon,
1685 'errorId': errorId,
1686 'extra': extra}
1687 sys.stdout.write(json.dumps(msg) + '\n')
1688 else:
1689 if is_suppressed(location, message, '%s-%s' % (addon, errorId)):
1690 return
1691 loc = '[%s:%i]' % (location.file, location.linenr)
1692 if len(extra) > 0:
1693 message += ' (' + extra + ')'
1694 sys.stderr.write('%s (%s) %s [%s-%s]\n' % (loc, severity, message, addon, errorId))
1695 global EXIT_CODE
1696 EXIT_CODE = 1
1697
1698def reportSummary(dumpfile, summary_type, summary_data):
1699 msg = {'summary': summary_type, 'data': summary_data}

Callers

nothing calls this directly

Calls 2

is_suppressedFunction · 0.85
writeMethod · 0.45

Tested by

no test coverage detected