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

Function convert_json_output

addons/test/util.py:34–46  ·  view source on GitHub ↗

Convert raw stdout/stderr cppcheck JSON output to python dict.

(raw_json_strings)

Source from the content-addressed store, hash-verified

32
33
34def convert_json_output(raw_json_strings):
35 """Convert raw stdout/stderr cppcheck JSON output to python dict."""
36 json_output = {}
37 for line in raw_json_strings:
38 if line.startswith('{"summary":'):
39 continue
40 try:
41 json_line = json.loads(line)
42 # json_output[json_line['errorId']] = json_line
43 json_output.setdefault(json_line['errorId'], []).append(json_line)
44 except ValueError:
45 pass
46 return json_output

Callers 6

test_json_outFunction · 0.85
test_1_bad_time_bitsFunction · 0.85
test_2_no_time_bitsFunction · 0.85
test_3_no_use_time_bitsFunction · 0.85
test_4_goodFunction · 0.85
test_5_goodFunction · 0.85

Calls

no outgoing calls

Tested by 6

test_json_outFunction · 0.68
test_1_bad_time_bitsFunction · 0.68
test_2_no_time_bitsFunction · 0.68
test_3_no_use_time_bitsFunction · 0.68
test_4_goodFunction · 0.68
test_5_goodFunction · 0.68