Repository Analysis

google/yapf

A formatter for Python files

7.1 Low AI signal View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of google/yapf, a Python project with 13,979 GitHub stars. SynthScan v2.0 examined 30,418 lines of code across 93 source files, recording 202 pattern matches distributed across 13 syntactic categories. The overall adjusted score of 7.1 places this repository in the Low 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).

7.1
Adjusted Score
7.1
Raw Score
100%
Time Factor
2026-06-27
Last Push
14.0K
Stars
Python
Language
30.4K
Lines of Code
93
Files
202
Pattern Hits
2026-07-14
Scan Date
0.01
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

This chart maps the temporal evolution of the adjusted synthetic code score across successive scan runs. An upward trajectory indicates ongoing incorporation of AI-generated code or expanding LLM-assisted scaffolding; a stable or declining trajectory may reflect active human refactoring, code removal, or the adoption of stricter authorship policies. The dashed secondary line (right axis) independently tracks total raw pattern hit count, which can diverge from the normalised score when codebase size changes significantly between scans.

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 1MEDIUM 3LOW 198

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 202 distinct pattern matches across 13 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.

Over-Commented Block70 hits · 70 pts
SeverityFileLineSnippetContext
LOWplugins/pre-commit.sh1#!/usr/bin/env bashCOMMENT
LOWyapftests/comment_splicer_test.py1# Copyright 2015 Google Inc. All Rights Reserved.COMMENT
LOWyapftests/logical_line_test.py1# Copyright 2015 Google Inc. All Rights Reserved.COMMENT
LOWyapftests/pytree_utils_test.py1# Copyright 2015 Google Inc. All Rights Reserved.COMMENT
LOWyapftests/reformatter_python3_test.py1# Copyright 2016 Google Inc. All Rights Reserved.COMMENT
LOWyapftests/reformatter_basic_test.py1# Copyright 2016 Google Inc. All Rights Reserved.COMMENT
LOWyapftests/blank_line_calculator_test.py1# Copyright 2015 Google Inc. All Rights Reserved.COMMENT
LOWyapftests/reformatter_style_config_test.py1# Copyright 2016 Google Inc. All Rights Reserved.COMMENT
LOWyapftests/__init__.py1# Copyright 2015 Google Inc. All Rights Reserved.COMMENT
LOWyapftests/reformatter_facebook_test.py1# Copyright 2016 Google Inc. All Rights Reserved.COMMENT
LOWyapftests/pytree_unwrapper_test.py1# Copyright 2015 Google Inc. All Rights Reserved.COMMENT
LOWyapftests/format_token_test.py1# Copyright 2015 Google Inc. All Rights Reserved.COMMENT
LOWyapftests/utils.py1# -*- coding: utf-8 -*-COMMENT
LOWyapftests/subtype_assigner_test.py1# Copyright 2015 Google Inc. All Rights Reserved.COMMENT
LOWyapftests/pytree_visitor_test.py1# Copyright 2015 Google Inc. All Rights Reserved.COMMENT
LOWyapftests/main_test.py1# -*- coding: utf-8 -*-COMMENT
LOWyapftests/reformatter_buganizer_test.py1# Copyright 2016 Google Inc. All Rights Reserved.COMMENT
LOWyapftests/split_penalty_test.py1# Copyright 2015 Google Inc. All Rights Reserved.COMMENT
LOWyapftests/style_test.py1# -*- coding: utf-8 -*-COMMENT
LOWyapftests/yapf_test.py1# -*- coding: utf-8 -*-COMMENT
LOWyapftests/line_joiner_test.py1# Copyright 2015 Google Inc. All Rights Reserved.COMMENT
LOWyapftests/yapf_test_helper.py1# Copyright 2016 Google Inc. All Rights Reserved.COMMENT
LOWyapftests/reformatter_pep8_test.py1# Copyright 2016 Google Inc. All Rights Reserved.COMMENT
LOWyapftests/file_resources_test.py1# -*- coding: utf-8 -*-COMMENT
LOWyapftests/format_decision_state_test.py1# Copyright 2015 Google Inc. All Rights Reserved.COMMENT
LOWyapf/__init__.py1# Copyright 2015 Google Inc. All Rights Reserved.COMMENT
LOWyapf/__main__.py1# Copyright 2015 Google Inc. All Rights Reserved.COMMENT
LOWyapf/pytree/pytree_visitor.py1# Copyright 2015 Google Inc. All Rights Reserved.COMMENT
LOWyapf/pytree/pytree_utils.py1# Copyright 2015 Google Inc. All Rights Reserved.COMMENT
LOWyapf/pytree/comment_splicer.py1# Copyright 2015 Google Inc. All Rights Reserved.COMMENT
LOWyapf/pytree/comment_splicer.py81 standalone=False), prev_leaf[0])COMMENT
LOWyapf/pytree/__init__.py1# Copyright 2021 Google Inc. All Rights Reserved.COMMENT
LOWyapf/pytree/blank_line_calculator.py1# Copyright 2015 Google Inc. All Rights Reserved.COMMENT
LOWyapf/pytree/split_penalty.py1# Copyright 2015 Google Inc. All Rights Reserved.COMMENT
LOWyapf/pytree/pytree_unwrapper.py1# Copyright 2015 Google Inc. All Rights Reserved.COMMENT
LOWyapf/pytree/subtype_assigner.py1# Copyright 2015 Google Inc. All Rights Reserved.COMMENT
LOWyapf/pytree/continuation_splicer.py1# Copyright 2015 Google Inc. All Rights Reserved.COMMENT
LOWyapf/pyparser/pyparser_utils.py1# Copyright 2022 Bill Wendling, All Rights Reserved.COMMENT
LOWyapf/pyparser/pyparser.py1# Copyright 2022 Bill Wendling, All Rights Reserved.COMMENT
LOWyapf/pyparser/__init__.py1# Copyright 2022 Google Inc. All Rights Reserved.COMMENT
LOWyapf/pyparser/split_penalty_visitor.py1# Copyright 2022 Bill Wendling, All Rights Reserved.COMMENT
LOWyapf/pyparser/split_penalty_visitor.py41 ############################################################################COMMENT
LOWyapf/pyparser/split_penalty_visitor.py81 # AsyncFunctionDef(name=Name,COMMENT
LOWyapf/pyparser/split_penalty_visitor.py141 # AnnAssign(target=Expr,COMMENT
LOWyapf/pyparser/split_penalty_visitor.py181 return self.generic_visit(node)COMMENT
LOWyapf/pyparser/split_penalty_visitor.py201 # orelse=[...],COMMENT
LOWyapf/pyparser/split_penalty_visitor.py841COMMENT
LOWyapf/yapflib/object_state.py1# Copyright 2017 Google Inc. All Rights Reserved.COMMENT
LOWyapf/yapflib/yapf_api.py1# Copyright 2015 Google Inc. All Rights Reserved.COMMENT
LOWyapf/yapflib/format_decision_state.py1# Copyright 2015 Google Inc. All Rights Reserved.COMMENT
LOWyapf/yapflib/format_decision_state.py481 _IsFunctionCallWithArguments(current)):COMMENT
LOWyapf/yapflib/style.py1# Copyright 2015 Google Inc. All Rights Reserved.COMMENT
LOWyapf/yapflib/logical_line.py1# Copyright 2015 Google Inc. All Rights Reserved.COMMENT
LOWyapf/yapflib/logical_line.py241COMMENT
LOWyapf/yapflib/__init__.py1# Copyright 2015 Google Inc. All Rights Reserved.COMMENT
LOWyapf/yapflib/reformatter.py1# Copyright 2015 Google Inc. All Rights Reserved.COMMENT
LOWyapf/yapflib/line_joiner.py1# Copyright 2015 Google Inc. All Rights Reserved.COMMENT
LOWyapf/yapflib/split_penalty.py1# Copyright 2022 Bill Wendling, All Rights Reserved.COMMENT
LOWyapf/yapflib/file_resources.py1# Copyright 2015 Google Inc. All Rights Reserved.COMMENT
LOWyapf/yapflib/format_token.py1# Copyright 2015 Google Inc. All Rights Reserved.COMMENT
10 more matches not shown…
Hyper-Verbose Identifiers49 hits · 57 pts
SeverityFileLineSnippetContext
LOWyapftests/reformatter_python3_test.py260 async def run_sync_in_worker_thread(sync_fn, *args, cancellable=False, limiter=None):CODE
LOWyapftests/reformatter_python3_test.py266 def run_sync_in_worker_thread(sync_fn, *args, cancellable=False, limiter=None):CODE
LOWyapftests/reformatter_python3_test.py283 async def run_sync_in_worker_thread(CODE
LOWyapftests/reformatter_python3_test.py302 def run_sync_in_worker_thread(sync_fn, *args, cancellable=False, limiter=None):CODE
LOWyapftests/reformatter_basic_test.py2312 def _pack_results_for_constraint_or(cls, combination, constraints):CODE
LOWyapftests/reformatter_basic_test.py2326 def _pack_results_for_constraint_or(cls, combination, constraints):CODE
LOWyapftests/blank_line_calculator_test.py250 def test_unicode_filename_in_sdist(self, sdist_unicode, tmpdir, monkeypatch):STRING
LOWyapftests/reformatter_facebook_test.py33 def overly_long_function_name(CODE
LOWyapftests/reformatter_facebook_test.py38 def overly_long_function_name(just_one_arg, **kwargs):CODE
LOWyapftests/reformatter_facebook_test.py46 def overly_long_function_name(CODE
LOWyapftests/reformatter_facebook_test.py52 def overly_long_function_name(CODE
LOWyapftests/reformatter_facebook_test.py62 def overly_long_function_name(a, b, c, d, e, f, g, h, i, j, k, l, m,CODE
LOWyapftests/reformatter_facebook_test.py67 def overly_long_function_name(CODE
LOWyapftests/reformatter_facebook_test.py77 def overly_long_function_name(CODE
LOWyapftests/reformatter_facebook_test.py85 def overly_long_function_name(CODE
LOWyapftests/reformatter_facebook_test.py250 def _pack_results_for_constraint_or():CODE
LOWyapftests/reformatter_facebook_test.py288 def _pack_results_for_constraint_or():CODE
LOWyapftests/reformatter_facebook_test.py371 def _pack_results_for_constraint_or(cls, combination, constraints):CODE
LOWyapftests/reformatter_buganizer_test.py33 def _create_testing_simulator_and_sink(CODE
LOWyapftests/reformatter_buganizer_test.py221 def xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx(CODE
LOWyapftests/yapf_test.py1116 def overly_long_function_name(first_argument_on_the_same_line,CODE
LOWyapftests/yapf_test.py1121 def overly_long_function_name(first_argument_on_the_same_line,CODE
LOWyapftests/yapf_test.py1139 def overly_long_function_name(CODE
LOWyapftests/yapf_test.py1145 # def overly_long_function_name(COMMENT
LOWyapftests/yapf_test.py1151 def overly_long_function_name(CODE
LOWyapftests/reformatter_pep8_test.py627 def simple_pass_function_with_an_extremely_long_name_and_some_arguments(STRING
LOWyapftests/file_resources_test.py59 def test_get_exclude_file_patterns_from_yapfignore(self):CODE
LOWyapftests/file_resources_test.py69 def test_get_exclude_file_patterns_from_yapfignore_with_wrong_syntax(self):CODE
LOWyapftests/file_resources_test.py78 def test_get_exclude_file_patterns_from_pyproject(self):CODE
LOWyapftests/file_resources_test.py91 def test_get_exclude_file_patterns_from_pyproject_no_ignore_section(self):CODE
LOWyapftests/file_resources_test.py100 def test_get_exclude_file_patterns_from_pyproject_ignore_section_empty(self):CODE
LOWyapftests/file_resources_test.py110 def test_get_exclude_file_patterns_with_no_config_files(self):CODE
LOWyapftests/file_resources_test.py505 def test_line_ending_linefeed(self):CODE
LOWyapftests/file_resources_test.py510 def test_line_ending_carriage_return(self):CODE
LOWyapftests/file_resources_test.py520 def test_line_ending_weighted(self):CODE
LOWyapftests/file_resources_test.py131 def test_no_local_style_custom_default(self):CODE
LOWyapftests/file_resources_test.py188 def mock_exists_implementation(path):CODE
LOWyapftests/file_resources_test.py238 def test_nonrecursive_find_in_dir(self):CODE
LOWyapftests/file_resources_test.py252 def test_recursive_find_in_dir(self):CODE
LOWyapftests/file_resources_test.py269 def test_recursive_find_in_dir_with_exclude(self):CODE
LOWyapftests/file_resources_test.py290 def test_find_with_excluded_hidden_dirs(self):CODE
LOWyapftests/file_resources_test.py312 def test_find_with_excluded_hidden_dirs_relative(self):CODE
LOWyapftests/file_resources_test.py354 def test_find_with_excluded_dirs(self):CODE
LOWyapftests/file_resources_test.py389 def test_find_with_excluded_current_dir(self):CODE
LOWyapftests/file_resources_test.py406 def test_empty_without_py_extension(self):CODE
LOWyapftests/file_resources_test.py429 def test_with_invalid_encoding(self):CODE
LOWyapftests/file_resources_test.py494 def test_write_encoded_to_stdout(self):CODE
LOWyapftests/file_resources_test.py535 def test_line_ending_no_newline(self):CODE
LOWyapf/yapflib/format_token.py129 def formatted_whitespace_prefix(self):CODE
Deep Nesting43 hits · 43 pts
SeverityFileLineSnippetContext
LOWyapf/pytree/comment_splicer.py31CODE
LOWyapf/pytree/comment_splicer.py46CODE
LOWyapf/pytree/split_penalty.py120CODE
LOWyapf/pytree/split_penalty.py208CODE
LOWyapf/pytree/split_penalty.py274CODE
LOWyapf/pytree/split_penalty.py477CODE
LOWyapf/pytree/pytree_unwrapper.py408CODE
LOWyapf/pytree/subtype_assigner.py62CODE
LOWyapf/pytree/subtype_assigner.py139CODE
LOWyapf/pytree/subtype_assigner.py294CODE
LOWyapf/pyparser/pyparser.py84CODE
LOWyapf/yapflib/yapf_api.py281CODE
LOWyapf/yapflib/format_decision_state.py1162CODE
LOWyapf/yapflib/format_decision_state.py168CODE
LOWyapf/yapflib/format_decision_state.py852CODE
LOWyapf/yapflib/format_decision_state.py1012CODE
LOWyapf/yapflib/logical_line.py543CODE
LOWyapf/yapflib/reformatter.py36CODE
LOWyapf/yapflib/reformatter.py269CODE
LOWyapf/yapflib/reformatter.py398CODE
LOWyapf/yapflib/reformatter.py607CODE
LOWyapf/yapflib/reformatter.py718CODE
LOWyapf/yapflib/file_resources.py41CODE
LOWyapf/yapflib/file_resources.py96CODE
LOWyapf/yapflib/file_resources.py182CODE
LOWyapf/yapflib/file_resources.py195CODE
LOWthird_party/yapf_third_party/_ylib2to3/patcomp.py70CODE
LOWthird_party/yapf_third_party/_ylib2to3/patcomp.py141CODE
LOWthird_party/yapf_third_party/_ylib2to3/fixer_util.py393CODE
LOWthird_party/yapf_third_party/_ylib2to3/fixer_util.py454CODE
LOWthird_party/yapf_third_party/_ylib2to3/pytree.py836CODE
LOWthird_party/yapf_third_party/_ylib2to3/pytree.py588CODE
LOWthird_party/yapf_third_party/_ylib2to3/pytree.py685CODE
LOWthird_party/yapf_third_party/_ylib2to3/pytree.py696CODE
LOWthird_party/yapf_third_party/_ylib2to3/pytree.py741CODE
LOWthird_party/yapf_third_party/_ylib2to3/pytree.py786CODE
LOWthird_party/yapf_third_party/_ylib2to3/pgen2/pgen.py129CODE
LOWthird_party/yapf_third_party/_ylib2to3/pgen2/pgen.py181CODE
LOWthird_party/yapf_third_party/_ylib2to3/pgen2/pgen.py243CODE
LOWthird_party/yapf_third_party/_ylib2to3/pgen2/conv.py83CODE
LOWthird_party/yapf_third_party/_ylib2to3/pgen2/parse.py269CODE
LOW…ird_party/yapf_third_party/_ylib2to3/pgen2/tokenize.py375CODE
LOW…ird_party/yapf_third_party/_ylib2to3/pgen2/tokenize.py233CODE
Unused Imports12 hits · 12 pts
SeverityFileLineSnippetContext
LOWyapftests/reformatter_python3_test.py16CODE
LOWyapftests/reformatter_basic_test.py16CODE
LOWyapftests/subtype_assigner_test.py20CODE
LOWyapftests/main_test.py18CODE
LOWyapftests/yapf_test.py18CODE
LOWyapftests/yapf_test.py19CODE
LOWyapftests/yapf_test.py26CODE
LOWyapftests/yapf_test.py28CODE
LOWyapf/pyparser/pyparser.py36CODE
LOWyapf/pyparser/split_penalty_visitor.py20CODE
LOWyapf/yapflib/logical_line.py26CODE
LOWyapf/yapflib/split_penalty.py15CODE
Self-Referential Comments3 hits · 9 pts
SeverityFileLineSnippetContext
MEDIUMyapftests/file_resources_test.py138 # Create an empty .style.yapf file in test_tmpdirCOMMENT
MEDIUMyapf/pytree/pytree_utils.py106 # This function is tiny, but the incantation for invoking the parser correctlyCOMMENT
MEDIUMthird_party/yapf_third_party/_ylib2to3/fixer_util.py305# The following functions are to find bindings in a suiteCOMMENT
Fake / Example Data12 hits · 8 pts
SeverityFileLineSnippetContext
LOWyapftests/reformatter_basic_test.py1547 text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam lectus. "\\STRING
LOWyapftests/reformatter_basic_test.py1547 text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam lectus. "\\STRING
LOWyapftests/reformatter_basic_test.py1551 "Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet"STRING
LOWyapftests/reformatter_basic_test.py1551 "Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet"STRING
LOWyapftests/reformatter_basic_test.py1604 'Lorem ipsum dolor sit amet, consetetur adipiscing elit. Donec a diam lectus. 'STRING
LOWyapftests/reformatter_basic_test.py1604 'Lorem ipsum dolor sit amet, consetetur adipiscing elit. Donec a diam lectus. 'STRING
LOWyapftests/reformatter_basic_test.py2111 ('lorem ipsum', 'dolor sit amet'):STRING
LOWyapftests/reformatter_basic_test.py2111 ('lorem ipsum', 'dolor sit amet'):STRING
LOWyapftests/reformatter_basic_test.py2121 ('lorem ipsum', 'dolor sit amet'):STRING
LOWyapftests/reformatter_basic_test.py2121 ('lorem ipsum', 'dolor sit amet'):STRING
LOWyapftests/reformatter_pep8_test.py389 'description': _("Lorem ipsum dolor met sit amet elit, si vis pacem para bellum "STRING
LOWyapftests/reformatter_pep8_test.py397 "Lorem ipsum dolor met sit amet elit, si vis pacem para bellum "STRING
Excessive Try-Catch Wrapping5 hits · 5 pts
SeverityFileLineSnippetContext
LOWyapf/__init__.py120 except Exception as e:CODE
LOWyapf/__init__.py247 except Exception as e:CODE
LOWyapf/pyparser/pyparser.py73 except Exception:CODE
LOWyapf/yapflib/yapf_api.py199 except Exception as e:CODE
LOWthird_party/yapf_third_party/_ylib2to3/pgen2/pgen.py346 except Exception:CODE
Cross-Language Confusion1 hit · 5 pts
SeverityFileLineSnippetContext
HIGHthird_party/yapf_third_party/_ylib2to3/pgen2/parse.py285 self.push(t, itsdfa, newstate, context)CODE
AI Structural Patterns2 hits · 2 pts
SeverityFileLineSnippetContext
LOWyapftests/utils.py45CODE
LOWyapf/__init__.py167CODE
Modern Structural Boilerplate2 hits · 2 pts
SeverityFileLineSnippetContext
LOWthird_party/yapf_third_party/_ylib2to3/pgen2/driver.py15__all__ = ['Driver', 'load_grammar']CODE
LOW…ird_party/yapf_third_party/_ylib2to3/pgen2/tokenize.py52__all__ = [x for x in dir(token) if x[0] != '_'CODE
Redundant / Tautological Comments1 hit · 2 pts
SeverityFileLineSnippetContext
LOWyapf/yapflib/format_decision_state.py785 # Check if the token terminates the current comprehension.COMMENT
AI Slop Vocabulary1 hit · 2 pts
SeverityFileLineSnippetContext
LOWthird_party/yapf_third_party/_ylib2to3/pgen2/pgen.py388 # Can't just return self.arcs == other.arcs, because thatCOMMENT
Slop Phrases1 hit · 0 pts
SeverityFileLineSnippetContext
LOWyapf/pytree/pytree_visitor.py53 methods can be overridden. Don't forget to invoke DefaultNodeVisit for nodesSTRING