AI Slop Code RIsk Monitor

lark-parser/lark

Lark is a parsing toolkit for Python, built with a focus on ergonomics, performance and modularity.

17.9 Elevated pattern signal View on GitHub

Maintenance and Governance Review

This report summarizes scanner evidence for lark-parser/lark, a Python project with 6,007 GitHub stars. SynthScan examined 24,933 lines of code across 124 source files, recording 376 pattern matches distributed across 15 syntactic categories. The legacy adjusted pattern signal is 17.9 (Elevated 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.

17.9
Adjusted Signal
17.9
Raw Pattern Score
100%
Time Factor
2026-08-27
Last Push
6.0K
Stars
Python
Language
24.9K
Lines of Code
124
Files
376
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 27.7/100 · MEDIUM

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

Hallucinated Dependency & Supply Chain Risk 21.9/100 · LOW

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

Agent Over-Engineering Ratio 37.6/100 · MEDIUM

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

PR Review Velocity Impact 67.1/100 · HIGH

Which changes need focused human review? 376 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 28MEDIUM 19LOW 329

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 376 distinct pattern matches across 15 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.

Unused Imports126 hits · 122 pts
SeverityFileLineSnippetContext
LOWlark/parser_frontends.py2CODE
LOWlark/tree.py1CODE
LOWlark/tree.py4CODE
LOWlark/tree.py4CODE
LOWlark/tree.py9CODE
LOWlark/tree.py14CODE
LOWlark/visitors.py1CODE
LOWlark/lark.py7CODE
LOWlark/lark.py7CODE
LOWlark/lark.py7CODE
LOWlark/lark.py18CODE
LOWlark/lark.py20CODE
LOWlark/lark.py12CODE
LOWlark/lark.py13CODE
LOWlark/lark.py14CODE
LOWlark/lark.py15CODE
LOWlark/lark.py16CODE
LOWlark/lark.py16CODE
LOWlark/__init__.py1CODE
LOWlark/__init__.py1CODE
LOWlark/__init__.py1CODE
LOWlark/__init__.py1CODE
LOWlark/__init__.py1CODE
LOWlark/__init__.py1CODE
LOWlark/__init__.py1CODE
LOWlark/__init__.py1CODE
LOWlark/__init__.py11CODE
LOWlark/__init__.py12CODE
LOWlark/__init__.py13CODE
LOWlark/__init__.py14CODE
LOWlark/__init__.py14CODE
LOWlark/__init__.py15CODE
LOWlark/__init__.py15CODE
LOWlark/__init__.py16CODE
LOWlark/__init__.py16CODE
LOWlark/__init__.py16CODE
LOWlark/__init__.py16CODE
LOWlark/__init__.py16CODE
LOWlark/common.py7CODE
LOWlark/common.py8CODE
LOWlark/common.py9CODE
LOWlark/common.py10CODE
LOWlark/common.py10CODE
LOWlark/common.py11CODE
LOWlark/common.py13CODE
LOWlark/common.py15CODE
LOWlark/lexer.py16CODE
LOWlark/lexer.py17CODE
LOWlark/exceptions.py2CODE
LOWlark/exceptions.py2CODE
LOWlark/exceptions.py6CODE
LOWlark/exceptions.py7CODE
LOWlark/parsers/xearley.py29CODE
LOWlark/parsers/xearley.py29CODE
LOWlark/parsers/lalr_analysis.py15CODE
LOWlark/parsers/lalr_analysis.py15CODE
LOWlark/parsers/earley.py25CODE
LOWlark/parsers/earley.py25CODE
LOWlark/tools/standalone.py27CODE
LOWlark/tools/standalone.py28CODE
66 more matches not shown…
Empty Error Handlers15 hits · 75 pts
SeverityFileLineSnippetContext
HIGHlark/parser_frontends.py209except UnexpectedInput:CODE
HIGHlark/parser_frontends.py215except ValueError:CODE
HIGHlark/tree.py12except ImportError:CODE
HIGHlark/load_grammar.py1001except ParseError: # IllegalCODE
HIGHlark/lark.py328except AttributeError:CODE
HIGHlark/lark.py382except FileNotFoundError:CODE
HIGHlark/lexer.py13except ImportError:CODE
HIGHlark/lexer.py756except EOFError:CODE
HIGHlark/parsers/earley_forest.py311except TypeError:CODE
HIGHlark/parsers/lalr_parser.py109except NameError:CODE
HIGHlark/parsers/lalr_interactive_parser.py114except UnexpectedToken:CODE
HIGHlark/tools/__init__.py65except OSError:CODE
HIGHdocs/ide/app/core.py149except:CODE
HIGHexamples/turtle_dsl.py10except NameError:CODE
HIGHexamples/calc.py14except NameError:CODE
Hyper-Verbose Identifiers122 hits · 73 pts
SeverityFileLineSnippetContext
LOWlark/parser_frontends.py63def _deserialize_parsing_frontend(data, memo, lexer_conf, callbacks, options):CODE
LOWlark/parser_frontends.py311def create_earley_parser__dynamic(lexer_conf: LexerConf, parser_conf: ParserConf, **kw):CODE
LOWlark/parser_frontends.py321def create_earley_parser__basic(lexer_conf: LexerConf, parser_conf: ParserConf, **kw):CODE
LOWlark/parser_frontends.py369def _construct_parsing_frontend(CODE
LOWlark/load_grammar.py961def _translate_parser_exception(parse, e):CODE
LOWlark/load_grammar.py994def _search_interactive_parser(interactive_parser, predicate):CODE
LOWlark/parse_tree_builder.py162def maybe_create_child_filter(expansion, keep_all_tokens, ambiguous, _empty_indices: List[bool]):CODE
LOWlark/parse_tree_builder.py223def maybe_create_ambiguous_expander(tree_class, expansion, keep_all_tokens):CODE
LOWlark/parsers/earley_forest.py401 def transform_intermediate_node(self, node, data):CODE
LOWlark/parsers/earley_forest.py438 def visit_intermediate_node_out(self, node):CODE
LOWlark/parsers/earley_forest.py582 def transform_intermediate_node(self, node, data):CODE
LOWlark/parsers/lalr_analysis.py229 def compute_includes_lookback(self):CODE
LOWlark/tools/nearley.py144def create_code_for_nearley_grammar(g, start, builtin_path, folder_path, es6=False):STRING
LOWtests/test_parser.py368 def test_backwards_custom_lexer(self):CODE
LOWtests/test_parser.py888 def test_multiple_start_solutions(self):CODE
LOWtests/test_parser.py2746 def test_interactive_treeless_transformer(self):CODE
LOW⚡tests/test_parser.py2009 def test_relative_import_unicode(self):STRING
LOW⚡tests/test_parser.py2015 def test_relative_import_rename(self):STRING
LOW⚡tests/test_parser.py2021 def test_relative_rule_import(self):STRING
LOW⚡tests/test_parser.py2030 def test_relative_rule_import_drop_ignore(self):STRING
LOW⚡tests/test_parser.py2038 def test_relative_rule_import_subrule(self):STRING
LOW⚡tests/test_parser.py2090 def test_relative_multi_import(self):STRING
LOW⚡tests/test_parser.py2095 def test_relative_import_preserves_leading_underscore(self):STRING
LOW⚡tests/test_parser.py2100 def test_relative_import_of_nested_grammar(self):STRING
LOW⚡tests/test_parser.py2105 def test_relative_import_rules_dependencies_imported_only_once(self):STRING
LOWtests/test_parser.py149 def test_comment_in_rule_definition(self):STRING
LOWtests/test_parser.py263 def test_embedded_transformer(self):STRING
LOWtests/test_parser.py319 def test_embedded_transformer_inplace(self):STRING
LOWtests/test_parser.py493 def test_earley_repeating_empty(self):STRING
LOWtests/test_parser.py509 def test_earley_explicit_ambiguity(self):STRING
LOWtests/test_parser.py562 def test_ambiguous_inlined_rule(self):STRING
LOWtests/test_parser.py583 def test_ambiguous_intermediate_node(self):STRING
LOWtests/test_parser.py600 def test_ambiguous_symbol_and_intermediate_nodes(self):STRING
LOWtests/test_parser.py635 def test_nested_ambiguous_intermediate_nodes(self):STRING
LOWtests/test_parser.py748 def test_ambiguous_intermediate_node_unnamed_token(self):STRING
LOWtests/test_parser.py764 def test_ambiguous_intermediate_node_inlined_rule(self):STRING
LOWtests/test_parser.py781 def test_ambiguous_intermediate_node_conditionally_inlined_rule(self):STRING
LOWtests/test_parser.py909 def test_ignore_carryover_with_priority(self):STRING
LOWtests/test_parser.py1004 def test_cycles_with_child_filter(self):STRING
LOWtests/test_parser.py1034 def test_symbol_node_start_end_dynamic_lexer(self):STRING
LOWtests/test_parser.py1054 def test_resolve_ambiguity_with_shared_node(self):STRING
LOWtests/test_parser.py1299 def test_unicode_literal_range_escape(self):STRING
LOWtests/test_parser.py1312 def test_hex_literal_range_escape(self):STRING
LOWtests/test_parser.py1760 def test_token_flags_collision(self):STRING
LOWtests/test_parser.py1801 def test_token_flags_verbose_multiline(self):STRING
LOWtests/test_parser.py1867 def test_lexer_prioritization(self):STRING
LOWtests/test_parser.py1919 def test_dynamic_lexer_prioritization(self):STRING
LOWtests/test_parser.py2052 def test_relative_rule_import_subrule_no_conflict(self):STRING
LOWtests/test_parser.py2067 def test_relative_rule_import_rename(self):STRING
LOWtests/test_parser.py2386 def test_priority_vs_embedded(self):STRING
LOWtests/test_parser.py2533 def test_serialize_with_transformer(self):STRING
LOWtests/test_parser.py2555 def test_lexer_detect_newline_tokens(self):STRING
LOWtests/test_parser.py2622 def test_regex_width_fallback(self):STRING
LOWtests/test_parser.py2638 def test_parser_interactive_parser(self):STRING
LOWtests/test_parser.py2675 def test_interactive_parser_copy_resume(self):STRING
LOWtests/test_parser.py2695 def test_error_with_interactive_parser(self):STRING
LOWtests/test_parser.py2730 def test_on_error_without_lalr(self):STRING
LOWtests/test_parser.py2768 def test_default_in_treeless_mode(self):STRING
LOWtests/test_parser.py2858 def test_parse_textslice_fails(self):STRING
LOWtests/test_lexer.py22 def test_flag_order_is_deterministic(self):STRING
62 more matches not shown…
Cross-File Repetition11 hits · 55 pts
SeverityFileLineSnippetContext
HIGHtests/test_parser.py0sentence: noun verb noun -> simple | noun verb "like" noun -> comparative noun: adj? noun verb: verb adj: adj noun: "fliSTRING
HIGHexamples/fruitflies.py0sentence: noun verb noun -> simple | noun verb "like" noun -> comparative noun: adj? noun verb: verb adj: adj noun: "fliSTRING
HIGHexamples/advanced/tree_forest_transformer.py0sentence: noun verb noun -> simple | noun verb "like" noun -> comparative noun: adj? noun verb: verb adj: adj noun: "fliSTRING
HIGHtests/test_reconstructor.py0{ "empty_object" : {}, "empty_array" : [], "booleans" : { "yes" : true, "no" : false }, "numbers" : [ 0, 1, -2, 3.3, 4.4STRING
HIGHexamples/json_parser.py0{ "empty_object" : {}, "empty_array" : [], "booleans" : { "yes" : true, "no" : false }, "numbers" : [ 0, 1, -2, 3.3, 4.4STRING
HIGHexamples/advanced/reconstruct_json.py0{ "empty_object" : {}, "empty_array" : [], "booleans" : { "yes" : true, "no" : false }, "numbers" : [ 0, 1, -2, 3.3, 4.4STRING
HIGHtests/test_reconstructor.py0?value: dict | list | string | signed_number -> number | "true" -> true | "false" -> false | "null" -> null list : "[" [STRING
HIGHdocs/ide/app/examples.py0?value: dict | list | string | signed_number -> number | "true" -> true | "false" -> false | "null" -> null list : "[" [STRING
HIGHexamples/json_parser.py0?value: dict | list | string | signed_number -> number | "true" -> true | "false" -> false | "null" -> null list : "[" [STRING
HIGHexamples/advanced/_json_parser.py0?value: dict | list | string | signed_number -> number | "true" -> true | "false" -> false | "null" -> null list : "[" [STRING
HIGHdocs/json_tutorial.md0?value: dict | list | string | signed_number -> number | "true" -> true | "false" -> false | "null" -> null list : "[" [STRING
Deep Nesting47 hits · 46 pts
SeverityFileLineSnippetContext
LOWlark/parser_frontends.py33CODE
LOWlark/parser_frontends.py173CODE
LOWlark/load_grammar.py540CODE
LOWlark/load_grammar.py872CODE
LOWlark/load_grammar.py1394CODE
LOWlark/load_grammar.py346CODE
LOWlark/load_grammar.py451CODE
LOWlark/load_grammar.py692CODE
LOWlark/load_grammar.py1162CODE
LOWlark/load_grammar.py1242CODE
LOWlark/load_grammar.py1311CODE
LOWlark/load_grammar.py1347CODE
LOWlark/lark.py298CODE
LOWlark/utils.py350CODE
LOWlark/lexer.py372CODE
LOWlark/lexer.py677CODE
LOWlark/exceptions.py75CODE
LOWlark/reconstruct.py33CODE
LOWlark/parse_tree_builder.py71CODE
LOWlark/parse_tree_builder.py275CODE
LOWlark/parse_tree_builder.py358CODE
LOWlark/parse_tree_builder.py279CODE
LOWlark/parsers/earley_forest.py274CODE
LOWlark/parsers/lalr_parser.py40CODE
LOWlark/parsers/cyk.py133CODE
LOWlark/parsers/xearley.py40CODE
LOWlark/parsers/xearley.py42CODE
LOWlark/parsers/lalr_analysis.py166CODE
LOWlark/parsers/lalr_analysis.py194CODE
LOWlark/parsers/lalr_analysis.py229CODE
LOWlark/parsers/lalr_analysis.py267CODE
LOWlark/parsers/lalr_analysis.py171CODE
LOWlark/parsers/grammar_analysis.py78CODE
LOWlark/parsers/earley.py78CODE
LOWlark/tools/standalone.py75CODE
LOWlark/tools/nearley.py113CODE
LOWdocs/ide/app/core.py2827CODE
LOWdocs/ide/app/core.py3014CODE
LOWdocs/ide/app/core.py657CODE
LOWdocs/ide/app/core.py814CODE
LOWdocs/ide/app/core.py834CODE
LOWdocs/ide/app/core.py2513CODE
LOWdocs/ide/app/core.py3059CODE
LOWdocs/ide/app/ignite.py158CODE
LOWdocs/ide/app/ext.py339CODE
LOWexamples/turtle_dsl.py38CODE
LOWexamples/advanced/reconstruct_python.py28CODE
Decorative Section Separators7 hits · 21 pts
SeverityFileLineSnippetContext
MEDIUMlark/load_grammar.py698 # ===================COMMENT
MEDIUMlark/load_grammar.py700 # ===================COMMENT
MEDIUMlark/load_grammar.py717 # =================COMMENT
MEDIUMlark/load_grammar.py719 # =================COMMENT
MEDIUMlark/tools/standalone.py5# ----------------------------------COMMENT
MEDIUMlark/__pyinstaller/hook-lark.py1#-----------------------------------------------------------------------------COMMENT
MEDIUMlark/__pyinstaller/hook-lark.py10#-----------------------------------------------------------------------------COMMENT
Self-Referential Comments11 hits · 15 pts
SeverityFileLineSnippetContext
MEDIUMlark/parsers/earley_forest.py1""""This module implements an SPPF implementationSTRING
MEDIUMlark/parsers/lalr_parser.py1"""This module implements a LALR(1) ParserSTRING
MEDIUMlark/parsers/earley_common.py1"""This module implements useful building blocks for the Earley parserSTRING
MEDIUMlark/parsers/cyk.py1"""This module implements a CYK parser."""STRING
MEDIUMlark/parsers/xearley.py1"""This module implements an Earley parser with a dynamic lexerSTRING
MEDIUMlark/parsers/lalr_interactive_parser.py1# This module provides a LALR interactive parser, which is used for debugging and error handlingCOMMENT
MEDIUMlark/parsers/earley.py1"""This module implements an Earley parser.STRING
MEDIUMdocs/conf.py7# This file is execfile()d with the current directory set to itsCOMMENT
MEDIUMexamples/json_parser.py52### Create the JSON parser with Lark, using the Earley algorithmSTRING
MEDIUMexamples/json_parser.py57### Create the JSON parser with Lark, using the LALR algorithmSTRING
MEDIUMexamples/advanced/_json_parser.py52### Create the JSON parser with Lark, using the LALR algorithmSTRING
Over-Commented Block12 hits · 12 pts
SeverityFileLineSnippetContext
LOW.pre-commit-config.yaml1# To use:COMMENT
LOWlark/parsers/earley_common.py41# class TransitiveItem(Item):COMMENT
LOWlark/parsers/cyk.py161 r1_tree = trees[span1][r1.lhs]COMMENT
LOWlark/parsers/grammar_analysis.py81 Adapted from: http://lara.epfl.ch/w/cc09:algorithm_for_first_and_follow_sets"""COMMENT
LOWlark/tools/standalone.py1###{standaloneCOMMENT
LOWlark/__pyinstaller/hook-lark.py1#-----------------------------------------------------------------------------COMMENT
LOWdocs/conf.py1#!/usr/bin/env python3COMMENT
LOWdocs/conf.py61project = 'Lark'COMMENT
LOWdocs/conf.py101# further. For a list of options available for each theme, see theCOMMENT
LOWexamples/fruitflies.py41 # make_png(sys.argv[1])COMMENT
LOWexamples/advanced/prioritizer.py61COMMENT
LOWexamples/relative-imports/multiples.py1#COMMENT
Docstring Block Structure2 hits · 10 pts
SeverityFileLineSnippetContext
HIGHlark/utils.py166A view of a string or bytes object, between the start and end indices. Never creates a copy. Lark accepts instSTRING
HIGHlark/tree_matcher.py162Match the elements of `tree` to the symbols of rule `rulename`. Parameters: tree (Tree): the tree nSTRING
Excessive Try-Catch Wrapping12 hits · 10 pts
SeverityFileLineSnippetContext
LOWlark/visitors.py127 except Exception as e:CODE
LOWlark/visitors.py140 except Exception as e:CODE
LOWlark/lark.py359 except Exception:STRING
LOWlark/lark.py385 except Exception: # We should probably narrow done which errors we catch here.STRING
LOWlark/parsers/lalr_parser.py112 except Exception as e:CODE
MEDIUMlark/parsers/lalr_parser.py40def parse(self, lexer, start, on_error=None):CODE
LOW⚡tests/test_parser.py1169 except Exception as e:STRING
LOW⚡tests/test_parser.py1172 except Exception as be:STRING
LOW⚡tests/test_parser.py1178 except Exception as be:STRING
LOWdocs/ide/app/app.py69 except Exception as e:STRING
LOWexamples/turtle_dsl.py76 except Exception as e:STRING
LOWexamples/advanced/qscintilla_json.py109 except Exception as e:STRING
AI Slop Vocabulary2 hits · 2 pts
SeverityFileLineSnippetContext
LOWlark/parser_frontends.py151 # Would break behavior of exhaust_lexer(), which currently raises TypeError, and after the change would just rCOMMENT
LOWexamples/turtle_dsl.py40 turtle.color(*t.children) # We just pass the color names as-isSTRING
Structural Annotation Overuse4 hits · 2 pts
SeverityFileLineSnippetContext
LOWdocs/json_tutorial.md290### Step 1 - BenchmarkSTRING
LOWdocs/json_tutorial.md365### Step 2 - LALR(1)STRING
LOWdocs/json_tutorial.md384### Step 3 - Tree-less LALR(1)STRING
LOWdocs/json_tutorial.md410### Step 4 - PyPySTRING
Redundant / Tautological Comments1 hit · 2 pts
SeverityFileLineSnippetContext
LOWlark/parsers/cyk.py103 # Check if the parse succeeded.COMMENT
Modern Structural Boilerplate2 hits · 2 pts
SeverityFileLineSnippetContext
LOWtests/test_parser.py35__all__ = ['TestParsers']CODE
LOWtests/test_tree_templates.py29__all__ = [STRING
Fake / Example Data2 hits · 2 pts
SeverityFileLineSnippetContext
LOWdocs/ide/app/ext.py51 self["placeholder"] = placeholderCODE
LOWdocs/ide/app/ext.py182 "placeholder": placeholderSTRING