AI Slop Code RIsk Monitor

mangiucugna/json_repair

Repair malformed JSON from LLMs, APIs, logs, and user input in Python.

37.0 High pattern signal View on GitHub

Maintenance and Governance Review

This report summarizes scanner evidence for mangiucugna/json_repair, a Python project with 5,117 GitHub stars. SynthScan examined 13,424 lines of code across 80 source files, recording 416 pattern matches distributed across 12 syntactic categories. The legacy adjusted pattern signal is 37.0 (High pattern signal); it is not an authorship estimate.

Use the findings to ask whether maintainers can explain intent, verify dependencies, simplify unnecessary scaffolding, and focus review effort. Risk Payload v1 adds ownership, supply-chain, over-engineering, and review-effort vectors when available. These are prompts for human verification, not probabilities, security findings, or measured maintenance costs.

37.0
Adjusted Signal
37.0
Raw Pattern Score
100%
Time Factor
2026-10-09
Last Push
5.1K
Stars
Python
Language
13.4K
Lines of Code
80
Files
416
Pattern Hits
2026-10-12
Scan Date
0.23
HC Hit Rate

Risk Review · v3

Use each vector to guide manual verification of the underlying findings.

Cognitive Ownership Risk 72.8/100 · HIGH

Can maintainers explain intent, assumptions, and trade-offs? 365 finding(s).

Hallucinated Dependency & Supply Chain Risk 33.2/100 · MEDIUM

Are imports declared and package/API names verified? 40 finding(s).

Agent Over-Engineering Ratio 72.7/100 · HIGH

Are wrappers, guards, and repeated structures necessary? 345 finding(s).

PR Review Velocity Impact 85.8/100 · CRITICAL

Which changes need focused human review? 416 finding(s).

What These Metrics Mean

Adjusted Signal
Legacy pattern score normalized per 1,000 scanned lines and multiplied by the repository-level time factor. It is not an estimate of AI authorship.
Raw Pattern Score
Sum of severity- and context-weighted pattern findings before applying the time factor.
Time Factor
A coarse multiplier based on repository last-push metadata. It does not identify when individual code was written.
Pattern Hits
Count of configured pattern findings. Review each location and surrounding code before acting.
HC Hit Rate
High- and critical-severity findings per scanned file. Severity is a configured detector weight, not proof of a vulnerability or authorship.
Lines / Files
Scan coverage denominators used by the legacy normalized score.

Pattern-Signal History

This chart tracks the legacy adjusted pattern score across scan runs. Changes can reflect source changes, scan coverage, or detector/scoring versions; they do not measure AI adoption or prove that a team refactored code. Compare runs only when their scoring versions are compatible. The dashed line tracks the raw pattern-hit count.

Severity Breakdown

Groups findings by configured severity weight. Severity is not a confidence estimate, security rating, or proof that a package is missing. Verify imports against the project's manifests and inspect each finding in its local design context.

CRITICAL 0HIGH 18MEDIUM 9LOW 389

Directory Score Breakdown

This horizontal bar chart shows where configured pattern scores accumulate across directories. Treat the bars as locations to inspect, not as evidence of authorship or code quality. Use the file-level findings to decide whether a directory needs a focused ownership, dependency, complexity, or review check.

Pattern Findings

The scanner identified 416 distinct pattern matches across 12 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a detector match to inspect in context. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.

Reading the findings table: The Severity column indicates the configured finding weight (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — legacy comment-context matches receive a ×1.5 score weight. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier under the legacy scoring model.

Hyper-Verbose Identifiers329 hits · 306 pts
SeverityFileLineSnippetContext
LOW⚡tests/test_parse_comment.py24def test_line_comment_brackets_do_not_trigger_empty_object_array_fallback():CODE
LOW⚡tests/test_parse_comment.py31def test_block_comment_brackets_do_not_trigger_empty_object_array_fallback():CODE
LOW⚡tests/test_parse_comment.py38def test_line_comment_brackets_do_not_close_array_items():CODE
LOWtests/test_parse_comment.py63def test_parse_many_top_level_comments_without_recursion_error():STRING
LOWtests/test_docs_app_schema.py15def test_docs_api_without_schema_keeps_existing_behavior(client):CODE
LOWtests/test_docs_app_schema.py26def test_docs_api_schema_null_is_treated_as_missing(client):CODE
LOWtests/test_docs_app_schema.py37def test_docs_api_schema_guides_coercion(client):CODE
LOWtests/test_docs_app_schema.py58def test_docs_api_rejects_invalid_schema_type(client):CODE
LOWtests/test_docs_app_schema.py85def test_docs_api_rejects_circular_schema_ref(client):CODE
LOW⚡tests/test_docs_app_schema.py103def test_docs_api_rejects_invalid_schema_repair_mode_type(client):CODE
LOW⚡tests/test_docs_app_schema.py113def test_docs_api_rejects_invalid_schema_repair_mode_value(client):CODE
LOW⚡tests/test_docs_app_schema.py123def test_docs_api_rejects_salvage_mode_without_schema(client):CODE
LOW⚡tests/test_docs_app_schema.py133def test_docs_api_salvage_mode_drops_invalid_array_items(client):CODE
LOW⚡tests/test_parse_number.py25def test_parse_number_positive_exponent(raw, expected, skip_json_loads):CODE
LOW⚡tests/test_parse_number.py30def test_parse_number_plus_outside_exponent():CODE
LOW⚡tests/test_parse_number.py35def test_parse_number_edge_cases():CODE
LOWtests/test_parse_number.py60def test_numeric_prefix_identifiers_preserve_underscored_digits():CODE
LOW⚡tests/test_json_repair.py27def test_missing_opening_object_brace(raw, expected, skip_json_loads):CODE
LOW⚡tests/test_json_repair.py31def test_missing_opening_object_brace_logs_and_serializes():CODE
LOW⚡tests/test_json_repair.py58def test_missing_opening_brace_declines_other_malformed_inputs(raw, expected, skip_json_loads):CODE
LOW⚡tests/test_json_repair.py66def test_missing_opening_brace_declines_integer_conversion_limit():CODE
LOW⚡tests/test_json_repair.py74def test_valid_top_level_string_preserved_with_strict_mode():CODE
LOW⚡tests/test_json_repair.py116def test_valid_json_fast_path_does_not_initialize_repair_parser(monkeypatch):CODE
LOW⚡tests/test_json_repair.py117 def fail_parser_initialization(*_args, **_kwargs):CODE
LOW⚡tests/test_json_repair.py125def test_skip_json_loads_does_not_raw_decode_complete_json(monkeypatch):CODE
LOW⚡tests/test_json_repair.py134def test_prefixed_valid_json_uses_value_fast_path_when_json_loads_is_skipped(monkeypatch):CODE
LOW⚡tests/test_json_repair.py200def test_top_level_separator_detects_pending_comma():CODE
LOW⚡tests/test_json_repair.py206def test_initial_container_trailing_content_rejects_mismatched_delimiters():CODE
LOW⚡tests/test_json_repair.py212def test_parenthesized_prose_does_not_hijack_fenced_json():CODE
LOW⚡tests/test_json_repair.py349def test_repair_json_skip_json_loads():CODE
LOWtests/test_json_repair.py90def test_no_speculative_decode_without_missing_brace_signal(raw, expected, monkeypatch):CODE
LOWtests/test_json_repair.py159def test_prefixed_valid_json_with_trailing_text_uses_value_fast_path(monkeypatch):CODE
LOWtests/test_json_repair.py171def test_valid_json_with_trailing_garbage_preserves_string_content(skip_json_loads):CODE
LOWtests/test_json_repair.py181def test_prefixed_invalid_json_falls_back_to_repair_parser():CODE
LOWtests/test_json_repair.py229def test_numbered_prose_line_does_not_hijack_fenced_json():CODE
LOWtests/test_json_repair.py246def test_parenthesized_tuple_still_parses_when_it_is_the_fenced_json_payload():CODE
LOWtests/test_json_repair.py259def test_repair_json_with_objects():CODE
LOWtests/test_json_repair.py374def _find_real_recursion_payload() -> str:CODE
LOWtests/test_json_repair.py390def test_repair_json_normalizes_real_parser_recursion_error():CODE
LOWtests/test_repair_json_from_file.py12def test_load_repairs_missing_opening_brace_from_current_position(skip_json_loads):CODE
LOW⚡tests/test_repair_json_from_file.py23def test_load_declines_missing_opening_brace_with_trailing_content():CODE
LOW⚡tests/test_repair_json_from_file.py27def test_load_strict_rejects_missing_opening_brace():CODE
LOW⚡tests/test_repair_json_from_file.py32def test_load_repairs_from_current_file_position():CODE
LOWtests/test_repair_json_from_file.py43def test_repair_json_from_file():CODE
LOW⚡tests/test_strict_mode.py8def test_strict_rejects_missing_opening_object_brace(raw, skip_json_loads):CODE
LOW⚡tests/test_strict_mode.py13def test_strict_rejects_multiple_top_level_values():CODE
LOW⚡tests/test_strict_mode.py18def test_strict_rejects_comma_separated_same_shape_top_level_objects():CODE
LOW⚡tests/test_strict_mode.py23def test_strict_rejects_adjacent_same_shape_top_level_objects():CODE
LOW⚡tests/test_strict_mode.py28def test_strict_rejects_adjacent_same_shape_top_level_arrays():CODE
LOW⚡tests/test_strict_mode.py34def test_strict_rejects_falsy_top_level_values(payload):CODE
LOW⚡tests/test_strict_mode.py39def test_strict_duplicate_keys_inside_array():CODE
LOW⚡tests/test_strict_mode.py45def test_strict_rejects_empty_keys():CODE
LOW⚡tests/test_strict_mode.py51def test_strict_requires_colon_between_key_and_value():CODE
LOW⚡tests/test_strict_mode.py56def test_strict_rejects_empty_values():CODE
LOW⚡tests/test_strict_mode.py62def test_strict_rejects_empty_object_with_extra_characters():CODE
LOW⚡tests/test_strict_mode.py67def test_strict_rejects_empty_escaped_object_with_extra_characters():CODE
LOW⚡tests/test_strict_mode.py72def test_strict_detects_immediate_doubled_quotes():CODE
LOW⚡tests/test_strict_mode.py77def test_strict_detects_doubled_quotes_followed_by_string():CODE
LOWtests/test_parse_array.py12def test_parse_array_edge_cases():CODE
LOW⚡tests/test_parse_array.py53def test_parse_array_closes_before_object_member_after_scalar_items():CODE
269 more matches not shown…
Cross-Language Confusion13 hits · 80 pts
SeverityFileLineSnippetContext
HIGH⚡tests/test_json_repair.py20 ('"a": 0, "b": false, "c": null, "d": ""}', {"a": 0, "b": False, "c": None, "d": ""}),CODE
HIGH⚡tests/test_json_repair.py351 repair_json('{"key": true, "key2": false, "key3": null}', skip_json_loads=True)CODE
HIGH⚡tests/test_json_repair.py352 == '{"key": true, "key2": false, "key3": null}'CODE
HIGH⚡tests/test_json_repair.py355 '{"key": true, "key2": false, "key3": null}',CODE
HIGHtests/test_json_repair.py263 assert repair_json('{"key": true, "key2": false, "key3": null}', return_objects=True) == {CODE
HIGHtests/test_parse_array.py21 assert repair_json("[true, false, null, ...]") == "[true, false, null]"CODE
HIGH⚡tests/test_parse_array.py77 assert repair_json("(true, false, null)", return_objects=True, skip_json_loads=True) == [True, False, None]CODE
HIGHtests/test_parse_object.py12 assert repair_json('{ "key": value, "key2": 1 "key3": null }', return_objects=True) == {CODE
HIGH⚡tests/test_parse_string.py46 repair_json("{'key': 'string', 'key2': false, \"key3\": null, \"key4\": unquoted}")CODE
HIGH⚡tests/test_parse_string.py47 == '{"key": "string", "key2": false, "key3": null, "key4": "unquoted"}'CODE
HIGH⚡tests/test_parse_string.py403 assert repair_json(' {"key": true, "key2": false, "key3": null}') == '{"key": true, "key2": false, "key3": null}'STRING
HIGH⚡tests/test_parse_string.py404 assert repair_json('{"key": TRUE, "key2": FALSE, "key3": Null} ') == '{"key": true, "key2": false, "key3": null}'STRING
HIGHtests/test_schema_guided_parse.py714 == '{"a": null, "b": null}'CODE
Deep Nesting25 hits · 23 pts
SeverityFileLineSnippetContext
LOWsrc/json_repair/parse_array.py12CODE
LOWsrc/json_repair/parse_array.py41CODE
LOWsrc/json_repair/parse_comment.py10CODE
LOWsrc/json_repair/parser_parenthesized.py9CODE
LOWsrc/json_repair/parser_parenthesized.py82CODE
LOWsrc/json_repair/schema_repair.py45CODE
LOWsrc/json_repair/schema_repair.py91CODE
LOWsrc/json_repair/schema_repair.py365CODE
LOWsrc/json_repair/parse_string.py56CODE
LOWsrc/json_repair/parse_string.py116CODE
LOWsrc/json_repair/parse_string.py143CODE
LOWsrc/json_repair/parse_string.py185CODE
LOWsrc/json_repair/parse_string.py450CODE
LOWsrc/json_repair/parse_string.py480CODE
LOWsrc/json_repair/parse_string.py552CODE
LOWsrc/json_repair/parse_string.py676CODE
LOWsrc/json_repair/json_repair.py100CODE
LOWsrc/json_repair/parse_object.py82CODE
LOWsrc/json_repair/parse_object.py132CODE
LOWsrc/json_repair/parse_object.py181CODE
LOWsrc/json_repair/parse_object.py379CODE
LOWsrc/json_repair/json_parser.py143CODE
LOWsrc/json_repair/json_parser.py188CODE
LOW…n_repair/parse_string_helpers/parse_boolean_or_null.py15CODE
LOWsrc/json_repair/utils/pattern_properties.py7CODE
Unused Imports22 hits · 22 pts
SeverityFileLineSnippetContext
LOWexamples/pydantic_schema.py3CODE
LOWexamples/stream_stable.py3CODE
LOWexamples/repair_llm_output.py3CODE
LOWexamples/chinese_llm_output.py3CODE
LOWexamples/fastapi_app.py3CODE
LOWsrc/json_repair/parse_array.py9CODE
LOWsrc/json_repair/parse_comment.py7CODE
LOWsrc/json_repair/parser_parenthesized.py6CODE
LOWsrc/json_repair/schema_repair.py1CODE
LOWsrc/json_repair/parse_string.py11CODE
LOWsrc/json_repair/__init__.py1CODE
LOWsrc/json_repair/__init__.py1CODE
LOWsrc/json_repair/__init__.py1CODE
LOWsrc/json_repair/__init__.py1CODE
LOWsrc/json_repair/__init__.py2CODE
LOWsrc/json_repair/parse_object.py9CODE
LOWsrc/json_repair/parse_object.py10CODE
LOWsrc/json_repair/parse_number.py10CODE
LOWsrc/json_repair/parser_schema.py1CODE
LOW…on_repair/parse_string_helpers/parse_json_llm_block.py6CODE
LOW…on_repair/parse_string_helpers/object_value_context.py7CODE
LOW…n_repair/parse_string_helpers/parse_boolean_or_null.py4CODE
Empty Error Handlers4 hits · 20 pts
SeverityFileLineSnippetContext
HIGHsrc/json_repair/json_repair.py188except (json.JSONDecodeError, TypeError, ValueError):CODE
HIGHsrc/json_repair/json_repair.py182except ValueError:CODE
HIGHsrc/json_repair/json_parser.py406except IndexError:CODE
HIGHsrc/json_repair/json_parser.py420except IndexError:CODE
Excessive Try-Catch Wrapping6 hits · 17 pts
SeverityFileLineSnippetContext
MEDIUM⚡src/json_repair/json_repair.py425 print("Error: Inline mode requires a filename", file=sys.stderr)CODE
MEDIUM⚡src/json_repair/json_repair.py429 print("Error: You cannot pass both --inline and --output", file=sys.stderr)CODE
MEDIUM⚡src/json_repair/json_repair.py433 print("Error: You cannot pass both --schema and --schema-model", file=sys.stderr)CODE
MEDIUM⚡src/json_repair/json_repair.py437 print("Error: --strict cannot be used with --schema or --schema-model", file=sys.stderr)CODE
MEDIUM⚡src/json_repair/json_repair.py440 print("Error: --schema-repair-mode salvage requires --schema or --schema-model", file=sys.stderr)CODE
MEDIUMsrc/json_repair/json_repair.py477 print(f"Error: {e!s}", file=sys.stderr)CODE
Self-Referential Comments3 hits · 9 pts
SeverityFileLineSnippetContext
MEDIUMtests/test_repair_json_from_file.py452 # Create a temporary fileCOMMENT
MEDIUMtests/test_repair_json_from_file.py520 # Create a temporary fileCOMMENT
MEDIUMtests/test_repair_json_cli.py14 # Create a temporary fileCOMMENT
Fake / Example Data5 hits · 7 pts
SeverityFileLineSnippetContext
LOW⚡tests/test_parse_array.py123 repair_json('{"bad_one":["Lorem Ipsum", "consectetur" comment" ], "good_one":[ "elit", "sed", "tempor"]}')CODE
LOW⚡tests/test_parse_array.py124 == '{"bad_one": ["Lorem Ipsum", "consectetur", "comment"], "good_one": ["elit", "sed", "tempor"]}'CODE
LOW⚡tests/test_parse_array.py127 repair_json('{"bad_one": ["Lorem Ipsum","consectetur" comment],"good_one": ["elit","sed","tempor"]}')CODE
LOW⚡tests/test_parse_array.py128 == '{"bad_one": ["Lorem Ipsum", "consectetur", "comment"], "good_one": ["elit", "sed", "tempor"]}'CODE
LOWtests/test_parse_string.py82 repair_json('{"key": "lorem ipsum ... "sic " tamet. ...}') == '{"key": "lorem ipsum ... \\"sic \\" tamet. ..."}'CODE
Docstring Block Structure1 hit · 5 pts
SeverityFileLineSnippetContext
HIGHsrc/json_repair/json_repair.py339 Command-line interface for repairing and parsing JSON files. Args: inline_args (Optional[List[str]]): STRING
AI Structural Patterns5 hits · 5 pts
SeverityFileLineSnippetContext
LOWsrc/json_repair/json_repair.py37CODE
LOWsrc/json_repair/json_repair.py53CODE
LOWsrc/json_repair/json_repair.py69CODE
LOWsrc/json_repair/json_repair.py85CODE
LOWsrc/json_repair/json_repair.py100CODE
Over-Commented Block2 hits · 2 pts
SeverityFileLineSnippetContext
LOWpyproject.toml81[project.scripts]COMMENT
LOWpyproject.toml101# Flake8-commas - COMCOMMENT
Modern Structural Boilerplate1 hit · 1 pts
SeverityFileLineSnippetContext
LOWsrc/json_repair/__init__.py4__all__ = ["JSONReturnType", "from_file", "load", "loads", "repair_json"]CODE