{"id":23461,"library":"cppcheck-codequality","title":"cppcheck-codequality","description":"Convert a CppCheck XML report to a GitLab-compatible Code Quality JSON report. Version 1.6.0 supports Python 3.7 to 3.14. Releases are sporadic.","status":"active","version":"1.6.0","language":"python","source_language":"en","source_url":"https://github.com/GabrielGarv/cppcheck-codequality","tags":["cppcheck","code-quality","gitlab","report-conversion","static-analysis"],"install":[{"cmd":"pip install cppcheck-codequality","lang":"bash","label":"Stable release"}],"dependencies":[],"imports":[{"wrong":"from cppcheck_codequality import convert","symbol":"convert_file","correct":"from cppcheck_codequality import convert_file"}],"quickstart":{"code":"import subprocess\nimport cppcheck_codequality\n\n# Run cppcheck and produce XML output\nwith open(\"cppcheck_report.xml\", \"r\") as f:\n    report_xml = f.read()\n\n# Convert to Code Quality JSON\njson_output = cppcheck_codequality.convert(report_xml)\nwith open(\"gl-code-quality-report.json\", \"w\") as f:\n    f.write(json_output)\n","lang":"python","description":"Read a CppCheck XML report file, convert to GitLab Code Quality JSON, and write to file."},"warnings":[{"fix":"Read the XML file contents into a string first using `open().read()`.","message":"The `convert` function expects a **string** containing XML, not a file path. Passing a file path will raise an error.","severity":"gotcha","affected_versions":"all"},{"fix":"Use `json.loads(convert(xml_str))` to get a Python dict.","message":"The library output is a JSON string, not a Python dict. If you need to manipulate the report further, parse it with `json.loads(json_output)`.","severity":"gotcha","affected_versions":"all"},{"fix":"Upgrade to Python 3.9+ to ensure future compatibility.","message":"Support for Python 3.7 and 3.8 may be dropped in future releases. The current version requires Python >=3.7, <3.15.","severity":"deprecated","affected_versions":"1.6.0"}],"env_vars":null,"search_vec":"'1.6.0':19 '3.14':24 '3.7':22 'analysi':38 'code':14,30 'code-qu':29 'codequ':3 'compat':13 'convers':35 'convert':4 'cppcheck':2,6,28 'cppcheck-codequ':1 'gitlab':12,32 'gitlab-compat':11 'json':16 'python':21 'qualiti':15,31 'releas':25 'report':8,17,34 'report-convers':33 'sporad':27 'static':37 'static-analysi':36 'support':20 'version':18 'xml':7","created_at":"2026-05-01T08:07:54.231201+00:00","updated_at":"2026-05-01T08:07:54.231201+00:00","problems":null,"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"1.6.0","cli_name":"cppcheck-codequality","cli_version":"1.6.0","type":"library","homepage":"https://gitlab.com/ahogen/cppcheck-codequality","github":null,"docs":null,"changelog":"https://gitlab.com/ahogen/cppcheck-codequality/-/blob/main/CHANGELOG.md","pypi":"https://pypi.org/project/cppcheck-codequality/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops","testing"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-07-03","last_verified":"2026-07-03","next_check":"2026-08-02","install_tag":null}}