Repository Analysis

python-attrs/attrs

Python Classes Without Boilerplate

12.5 Low AI signal View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of python-attrs/attrs, a Python project with 5,827 GitHub stars. SynthScan v2.0 examined 28,597 lines of code across 101 source files, recording 357 pattern matches distributed across 12 syntactic categories. The overall adjusted score of 12.5 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).

12.5
Adjusted Score
12.5
Raw Score
100%
Time Factor
2026-08-02
Last Push
5.8K
Stars
Python
Language
28.6K
Lines of Code
101
Files
357
Pattern Hits
2026-08-02
Scan Date
0.09
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 9MEDIUM 4LOW 344

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 357 distinct pattern matches across 12 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.

Hyper-Verbose Identifiers249 hits · 216 pts
SeverityFileLineSnippetContext
LOWbench/test_benchmarks.py48def test_create_simple_class_make_class():CODE
LOWbench/test_benchmarks.py72def test_instantiate_no_defaults():CODE
LOWbench/test_benchmarks.py80def test_instantiate_with_defaults():CODE
LOWbench/test_benchmarks.py218 def test_create_cached_property_class(self):CODE
LOWtests/test_pyright.py89def test_pyright_attrsinstance_compat(tmp_path):CODE
LOWtests/test_pyright.py117def test_pyright_field_converters_tuple(tmp_path):CODE
LOWtests/test_funcs.py160 def test_lists_tuples_retain_type(self, container, C):CODE
LOWtests/test_funcs.py214 def test_asdict_preserve_order(self, cls):CODE
LOWtests/test_funcs.py223 def test_retain_keys_are_tuples(self):CODE
LOWtests/test_funcs.py254 def test_named_tuple_retain_type(self):CODE
LOWtests/test_funcs.py275 def test_type_error_with_retain_type(self):CODE
LOWtests/test_funcs.py332 def assert_proper_tuple_class(obj, obj_tuple):CODE
LOWtests/test_funcs.py413 def test_lists_tuples_retain_type(self, container, C):CODE
LOWtests/test_funcs.py460 def test_named_tuple_retain_type(self):CODE
LOWtests/test_funcs.py481 def test_type_error_with_retain_type(self):CODE
LOWtests/test_funcs.py773 def test_regression_attrs_classes(self):CODE
LOWtests/test_forward_references.py8def test_forward_class_reference():CODE
LOWtests/test_utils.py15 def test_returns_distinct_classes(self):CODE
LOWtests/test_converters.py95 def test_annotations_if_last_in_pipe(self):CODE
LOWtests/strategies.py52def _create_hyp_nested_strategy(draw, simple_class_strategy):CODE
LOWtests/strategies.py90def simple_attrs_with_metadata(draw):CODE
LOWtests/test_functional.py225 def test_subclassing_with_extra_attrs(self, cls):CODE
LOWtests/test_functional.py240 def test_subclass_without_extra_attrs(self, base):CODE
LOWtests/test_functional.py332 def test_subclassing_frozen_gives_frozen(self):CODE
LOWtests/test_functional.py420 def test_handles_different_defaults(self):CODE
LOWtests/test_functional.py437 def test_unsafe_hash_false_eq_false(self, slots):CODE
LOWtests/test_functional.py545 def test_tuple_class_aliasing(self):CODE
LOWtests/test_functional.py660 def test_no_setattr_if_validate_without_validators(self, slots):CODE
LOWtests/test_functional.py684 def test_no_setattr_if_convert_without_converters(self, slots):CODE
LOWtests/test_functional.py705 def test_no_setattr_with_ng_defaults(self, slots):CODE
LOWtests/test_functional.py733 def test_on_setattr_detect_inherited_validators(self):CODE
LOWtests/test_setattr.py51 def test_change_with_generator_hook(self):CODE
LOWtests/test_setattr.py71 def test_generator_hook_executes_after_yielding(self):CODE
LOWtests/test_setattr.py194 def test_generator_hook_not_called_in_init(self):CODE
LOWtests/test_setattr.py214 def test_generator_hook_with_define(self):CODE
LOWtests/test_setattr.py234 def test_generator_hook_class_level(self):CODE
LOWtests/test_setattr.py262 def test_generator_pre_yield_exception(self):CODE
LOWtests/test_setattr.py282 def test_generator_post_yield_exception(self):CODE
LOWtests/test_setattr.py303 def test_generator_yields_multiple_times(self):CODE
LOWtests/test_setattr.py344 def test_no_validator_no_converter(self):CODE
LOWtests/test_setattr.py359 def test_validate_respects_run_validators_config(self):CODE
LOWtests/test_setattr.py383 def test_frozen_on_setattr_class_is_caught(self):CODE
LOWtests/test_setattr.py395 def test_frozen_on_setattr_attribute_is_caught(self):CODE
LOWtests/test_setattr.py409 def test_frozen_on_setattr_nops(self, nop):CODE
LOWtests/test_setattr.py418 def test_setattr_reset_if_no_custom_setattr(self, slots):CODE
LOWtests/test_setattr.py443 def test_setattr_inherited_do_not_reset(self, slots):CODE
LOWtests/test_setattr.py470 def test_pickling_retains_attrs_own(self, slots):CODE
LOWtests/test_setattr.py487 def test_slotted_class_can_have_custom_setattr(self):CODE
LOWtests/test_setattr.py526 def test_setattr_auto_detect_if_no_custom_setattr(self, slots):CODE
LOWtests/test_setattr.py545 def test_setattr_restore_respects_auto_detect(self, slots):CODE
LOWtests/test_setattr.py558 def test_setattr_auto_detect_frozen(self, slots):CODE
LOWtests/test_setattr.py571 def test_setattr_auto_detect_on_setattr(self, slots):CODE
LOWtests/test_setattr.py591 def test_setattr_inherited_do_not_reset_intermediate(CODE
LOWtests/test_setattr.py633 def test_setattr_converter_piped(self):CODE
LOWtests/test_make.py2654 def test_eq_callable_order_boolean(self):CODE
LOWtests/test_make.py2663 def test_eq_callable_order_callable(self):CODE
LOWtests/test_make.py2672 def test_eq_boolean_order_callable(self):CODE
LOWtests/test_make.py2682 def test_order_mirrors_eq_by_default(self, eq):CODE
LOWtests/test_make.py67def _with_and_without_validation(request):CODE
LOWtests/test_make.py92 def test_validators_lists_to_wrapped_tuples(self):CODE
189 more matches not shown…
Unused Imports65 hits · 60 pts
SeverityFileLineSnippetContext
LOWbench/test_benchmarks.py5CODE
LOWtests/test_pyright.py3CODE
LOWtests/attr_import_star.py4CODE
LOWtests/test_import.py14CODE
LOWtests/test_hooks.py3CODE
LOWtyping-examples/baseline.py8CODE
LOWtyping-examples/pyrefly.py7CODE
LOWtyping-examples/mypy.py7CODE
LOWsrc/attrs/setters.py3CODE
LOWsrc/attrs/validators.py3CODE
LOWsrc/attrs/__init__.py3CODE
LOWsrc/attrs/__init__.py3CODE
LOWsrc/attrs/__init__.py3CODE
LOWsrc/attrs/__init__.py3CODE
LOWsrc/attrs/__init__.py3CODE
LOWsrc/attrs/__init__.py3CODE
LOWsrc/attrs/__init__.py3CODE
LOWsrc/attrs/__init__.py3CODE
LOWsrc/attrs/__init__.py3CODE
LOWsrc/attrs/__init__.py3CODE
LOWsrc/attrs/__init__.py3CODE
LOWsrc/attrs/__init__.py3CODE
LOWsrc/attrs/__init__.py3CODE
LOWsrc/attrs/__init__.py3CODE
LOWsrc/attrs/__init__.py3CODE
LOWsrc/attrs/__init__.py3CODE
LOWsrc/attrs/__init__.py3CODE
LOWsrc/attrs/__init__.py3CODE
LOWsrc/attrs/__init__.py3CODE
LOWsrc/attrs/__init__.py25CODE
LOWsrc/attrs/__init__.py26CODE
LOWsrc/attrs/__init__.py26CODE
LOWsrc/attrs/__init__.py26CODE
LOWsrc/attrs/__init__.py28CODE
LOWsrc/attrs/__init__.py28CODE
LOWsrc/attrs/__init__.py28CODE
LOWsrc/attrs/exceptions.py3CODE
LOWsrc/attrs/converters.py3CODE
LOWsrc/attrs/filters.py3CODE
LOWsrc/attr/__init__.py12CODE
LOWsrc/attr/__init__.py12CODE
LOWsrc/attr/__init__.py13CODE
LOWsrc/attr/__init__.py14CODE
LOWsrc/attr/__init__.py14CODE
LOWsrc/attr/__init__.py15CODE
LOWsrc/attr/__init__.py15CODE
LOWsrc/attr/__init__.py15CODE
LOWsrc/attr/__init__.py15CODE
LOWsrc/attr/__init__.py15CODE
LOWsrc/attr/__init__.py16CODE
LOWsrc/attr/__init__.py16CODE
LOWsrc/attr/__init__.py16CODE
LOWsrc/attr/__init__.py16CODE
LOWsrc/attr/__init__.py16CODE
LOWsrc/attr/__init__.py16CODE
LOWsrc/attr/__init__.py16CODE
LOWsrc/attr/__init__.py16CODE
LOWsrc/attr/__init__.py30CODE
LOWsrc/attr/__init__.py30CODE
LOWsrc/attr/__init__.py30CODE
5 more matches not shown…
Docstring Block Structure9 hits · 45 pts
SeverityFileLineSnippetContext
HIGHsrc/attr/_make.py590 Create a new instance, based on the first positional argument with *changes* applied. .. tip:: On STRING
HIGHsrc/attr/_make.py1925 Return the tuple of *attrs* attributes for a class or instance. The tuple also allows accessing the fields by STRING
HIGHsrc/attr/_make.py1976 Return an ordered dictionary of *attrs* attributes for a class, whose keys are the attribute names. Args: STRING
HIGHsrc/attr/_next_gen.py656 Inspect the class and return its effective build parameters. Warning: This feature is currently **expeSTRING
HIGHsrc/attr/_funcs.py34 Return the *attrs* attribute values of *inst* as a dict. Optionally recurse into other *attrs*-decorated classSTRING
HIGHsrc/attr/_funcs.py237 Return the *attrs* attribute values of *inst* as a tuple. Optionally recurse into other *attrs*-decorated clasSTRING
HIGHsrc/attr/_funcs.py353 Check whether *cls* is a class with *attrs* attributes. Args: cls (type): Class to introspect. RaSTRING
HIGHsrc/attr/_funcs.py381 Copy *inst* and apply *changes*. This is different from `evolve` that applies the changes to the arguments STRING
HIGHsrc/attr/_funcs.py428 Resolve any strings and forward annotations in type annotations. This is only required if you need concrete tySTRING
Deep Nesting14 hits · 14 pts
SeverityFileLineSnippetContext
LOWtests/test_funcs.py104CODE
LOWtests/test_funcs.py343CODE
LOWtests/test_funcs.py111CODE
LOWtests/test_funcs.py352CODE
LOWsrc/attr/_make.py381CODE
LOWsrc/attr/_make.py1353CODE
LOWsrc/attr/_make.py2187CODE
LOWsrc/attr/_make.py676CODE
LOWsrc/attr/_make.py823CODE
LOWsrc/attr/_make.py859CODE
LOWsrc/attr/_make.py1478CODE
LOWsrc/attr/_funcs.py26CODE
LOWsrc/attr/_funcs.py152CODE
LOWsrc/attr/_funcs.py230CODE
AI Structural Patterns7 hits · 6 pts
SeverityFileLineSnippetContext
LOWtests/utils.py11CODE
LOWtests/utils.py40CODE
LOWsrc/attr/_make.py104CODE
LOWsrc/attr/_make.py1353CODE
LOWsrc/attr/_make.py2531CODE
LOWsrc/attr/_next_gen.py23CODE
LOWsrc/attr/_next_gen.py434CODE
Modern Structural Boilerplate5 hits · 5 pts
SeverityFileLineSnippetContext
LOWsrc/attrs/__init__.py31__all__ = [CODE
LOWsrc/attr/validators.py19__all__ = [CODE
LOWsrc/attr/__init__.py45__all__ = [CODE
LOWsrc/attr/converters.py11__all__ = [CODE
LOWsrc/attr/_config.py3__all__ = ["get_run_validators", "set_run_validators"]CODE
Slop Phrases1 hit · 3 pts
SeverityFileLineSnippetContext
MEDIUMsrc/attr/_funcs.py494 # Return the class so you can use it as a decorator too.COMMENT
AI Slop Vocabulary2 hits · 2 pts
SeverityFileLineSnippetContext
MEDIUMpyproject.toml262 "DTZ", # datetime best practices don't matter in testsSTRING
MEDIUMpyproject.toml274 "TRY", # exception best practices don't matter in testsSTRING
Dead Code1 hit · 2 pts
SeverityFileLineSnippetContext
MEDIUMtests/test_setattr.py269CODE
Over-Commented Block2 hits · 2 pts
SeverityFileLineSnippetContext
LOWtyping-examples/mypy.py161# ConvCPipe(3.4)COMMENT
LOWsrc/attr/_compat.py81COMMENT
Redundant / Tautological Comments1 hit · 2 pts
SeverityFileLineSnippetContext
LOWsrc/attr/_make.py708 # Check if the pre init method has more arguments than just `self`COMMENT
Excessive Try-Catch Wrapping1 hit · 0 pts
SeverityFileLineSnippetContext
LOWsrc/attr/validators.py731 except Exception: # noqa: BLE001, PERF203, S112STRING