Repository Analysis

lark-parser/lark

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

15.0 Moderate AI signal View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of lark-parser/lark, a Python project with 5,946 GitHub stars. SynthScan v2.0 examined 24,586 lines of code across 123 source files, recording 354 pattern matches distributed across 14 syntactic categories. The overall adjusted score of 15.0 places this repository in the Moderate AI signal band.

The scanner applied 160+ deterministic lexical heuristics, multi-line block detectors, abstract syntax tree depth profilers, and a cross-file Jaccard similarity matrix to construct a statistically normalised synthetic code estimate. All matches are individually weighted by severity coefficient and contextual multiplier before summation, and the resulting headline score is temporally discounted to account for the repository's development history relative to the commercial emergence of large language model coding tooling (November 2022 onward).

15.0
Adjusted Score
15.0
Raw Score
100%
Time Factor
2026-07-28
Last Push
5.9K
Stars
Python
Language
24.6K
Lines of Code
123
Files
354
Pattern Hits
2026-08-02
Scan Date
0.11
HC Hit Rate

What These Metrics Mean

Adjusted Score
Primary synthetic code indicator. Raw score normalised per 1,000 lines of code and multiplied by the temporal discount factor. This is the definitive comparative metric — use it to rank repositories by AI authorship density.
Raw Score
The unmodified sum of all severity-weighted, context-multiplied pattern match scores before temporal discounting. Reflects the absolute signal strength independent of when the repository was last active.
Time Factor
The temporal discount multiplier (0–100%) applied to the raw score. Repositories last updated before ChatGPT's launch (Nov 2022) receive a 5% factor. Full signal is only assigned to repositories active in the post-adoption era (Jan 2024+).
Pattern Hits
Total count of individual pattern matches across all files and categories. A high hit count with a low score may indicate a very large codebase with isolated AI snippets; a low count with a high score indicates dense, concentrated AI signatures.
HC Hit Rate
High+Critical pattern hits per file, averaged across the repository. This orthogonal signal catches repositories where a few files are densely packed with high-severity AI tells — a strong indicator even when the normalised score appears moderate due to codebase size.
Lines of Code / Files
Total lines and files analysed. The scanner examines 94 file extensions. These denominators are used to normalise the score, enabling fair comparison between repositories of vastly different sizes.

Score History

Longitudinal tracking requires multiple scan runs. Once this repository is re-scanned after new commits land, this chart will visualise how the synthetic code signal evolves over time — enabling you to detect whether AI authorship is growing, stabilising, or being actively corrected by human engineers.

No multi-scan history yet — run the scanner again to build trend data.

Severity Breakdown

Classifies detected patterns by their diagnostic confidence and structural impact. CRITICAL patterns (coefficient 10) represent definitive synthetic signatures — hallucinated imports, explicit LLM attribution metadata — virtually never produced by human authors. HIGH (5) indicates strong structural tells such as cross-file repetition or cross-linguistic idioms. MEDIUM (2) covers recognisable conversational padding and AI-specific vocabulary. LOW (1) captures subtle indicators like tautological comments and generic boilerplate that require density to carry independent signal.

CRITICAL 0HIGH 13MEDIUM 19LOW 322

Directory Score Breakdown

This horizontal bar chart decomposes the repository's raw synthetic code score by top-level directory, allowing you to pinpoint precisely which modules or components carry the highest AI authorship density. Directories with disproportionately high scores relative to their size warrant targeted manual review: concentrated AI signatures often trace back to mass-generated configuration layers, auto-ported test suites, LLM-scaffolded boilerplate classes, or entire subsystems authored under heavy copilot assistance. Use this view to prioritise your human code-review effort.

Pattern Findings

The scanner identified 354 distinct pattern matches across 14 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a statistically significant AI authorship indicator. 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 diagnostic confidence level (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — comment-context matches receive a ×1.5 weight because LLMs systematically over-annotate. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier as dense clusters constitute far stronger evidence of synthetic authorship than isolated hits.

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…
Hyper-Verbose Identifiers114 hits · 69 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.py2726 def test_interactive_treeless_transformer(self):CODE
LOWtests/test_parser.py2009 def test_relative_import_unicode(self):STRING
LOWtests/test_parser.py2015 def test_relative_import_rename(self):STRING
LOWtests/test_parser.py2021 def test_relative_rule_import(self):STRING
LOWtests/test_parser.py2030 def test_relative_rule_import_drop_ignore(self):STRING
LOWtests/test_parser.py2038 def test_relative_rule_import_subrule(self):STRING
LOWtests/test_parser.py2090 def test_relative_multi_import(self):STRING
LOWtests/test_parser.py2095 def test_relative_import_preserves_leading_underscore(self):STRING
LOWtests/test_parser.py2100 def test_relative_import_of_nested_grammar(self):STRING
LOWtests/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_error_with_interactive_parser(self):STRING
LOWtests/test_parser.py2710 def test_on_error_without_lalr(self):STRING
LOWtests/test_parser.py2748 def test_default_in_treeless_mode(self):STRING
LOWtests/test_parser.py2838 def test_parse_textslice_fails(self):STRING
LOWtests/test_python_grammar.py238 def _test_parsed_is_this_terminal(self, text, terminal, start):STRING
LOWtests/test_python_grammar.py245 def _test_parsed_is_file_containing_only_this_statement(self, text, statement):STRING
54 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 Nesting48 hits · 48 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/visitors.py297CODE
LOWlark/lark.py298CODE
LOWlark/utils.py350CODE
LOWlark/lexer.py371CODE
LOWlark/lexer.py676CODE
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
LOWtests/test_parser.py1169 except Exception as e:STRING
LOWtests/test_parser.py1172 except Exception as be:STRING
LOWtests/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