Repository Analysis

faif/python-patterns

A collection of design patterns/idioms in Python

22.9 Moderate AI signal View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of faif/python-patterns, a Python project with 42,903 GitHub stars. SynthScan v2.0 examined 5,499 lines of code across 82 source files, recording 95 pattern matches distributed across 7 syntactic categories. The overall adjusted score of 22.9 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).

22.9
Adjusted Score
22.9
Raw Score
100%
Time Factor
2026-07-30
Last Push
42.9K
Stars
Python
Language
5.5K
Lines of Code
82
Files
95
Pattern Hits
2026-08-02
Scan Date
0.02
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 2MEDIUM 0LOW 93

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 95 distinct pattern matches across 7 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 Identifiers76 hits · 98 pts
SeverityFileLineSnippetContext
LOWpatterns/dependency_injection.py19 def get_current_time_as_html_fragment(self):STRING
LOWpatterns/dependency_injection.py34 def get_current_time_as_html_fragment(self) -> str:CODE
LOWpatterns/dependency_injection.py46 def get_current_time_as_html_fragment(self, time_provider: Callable) -> str:CODE
LOWpatterns/dependency_injection.py63 def get_current_time_as_html_fragment(self):CODE
LOWpatterns/dependency_injection.py71def production_code_time_provider() -> str:CODE
LOWpatterns/other/hsm/hsm.py51 def _send_diagnostics_request(self):CODE
LOWpatterns/other/hsm/hsm.py63 def _send_switchover_response(self):CODE
LOWpatterns/other/hsm/hsm.py66 def _send_operator_inservice_response(self):CODE
LOWpatterns/other/hsm/hsm.py69 def _send_diagnostics_failure_report(self):CODE
LOWpatterns/other/hsm/hsm.py72 def _send_diagnostics_pass_report(self):CODE
LOWtests/test_hsm.py21 def test_initial_state_shall_be_standby(cls):CODE
LOWtests/test_hsm.py24 def test_unsupported_state_shall_raise_exception(cls):CODE
LOWtests/test_hsm.py28 def test_unsupported_message_type_shall_raise_exception(cls):CODE
LOWtests/test_hsm.py32 def test_calling_next_state_shall_change_current_state(cls):CODE
LOWtests/test_hsm.py38 def test_method_perform_switchover_shall_return_specifically(cls):CODE
LOWtests/test_hsm.py57 def test_given_standby_on_message_switchover_shall_set_active(cls):CODE
LOWtests/test_hsm.py61 def test_given_standby_on_message_switchover_shall_call_hsm_methods(cls):CODE
LOWtests/test_hsm.py76 def test_given_standby_on_message_fault_trigger_shall_set_suspect(cls):CODE
LOWtests/test_hsm.py80 def test_given_standby_on_message_diagnostics_failed_shall_raise_exception_and_keep_in_state(CODE
LOWtests/test_hsm.py87 def test_given_standby_on_message_diagnostics_passed_shall_raise_exception_and_keep_in_state(CODE
LOWtests/test_hsm.py94 def test_given_standby_on_message_operator_inservice_shall_raise_exception_and_keep_in_state(CODE
LOWtests/creational/test_factory.py13 def test_get_localizer_english(self):CODE
LOWtests/creational/test_factory.py19 def test_get_localizer_default(self):CODE
LOWtests/creational/test_factory.py24 def test_get_localizer_unknown_language(self):CODE
LOWtests/creational/test_prototype.py10 def test_cloning_propperty_innate_values(self):CODE
LOWtests/creational/test_prototype.py15 def test_extended_property_values_cloning(self):CODE
LOWtests/creational/test_prototype.py21 def test_cloning_propperty_assigned_values(self):CODE
LOWtests/creational/test_prototype.py41 def test_particular_properties_retrieving(self):CODE
LOWtests/creational/test_prototype.py46 def test_extended_properties_retrieving(self):CODE
LOWtests/creational/test_abstract_factory.py7 def test_dog_pet_shop_shall_show_dog_instance(self):CODE
LOWtests/creational/test_borg.py15 def test_initial_borg_state_shall_be_init(self):CODE
LOWtests/creational/test_borg.py19 def test_changing_instance_attribute_shall_change_borg_state(self):CODE
LOWtests/creational/test_borg.py25 def test_instances_shall_have_own_ids(self):CODE
LOWtests/creational/test_lazy.py15 def test_relatives_not_in_properties(self):CODE
LOWtests/creational/test_lazy.py27 def test_relatives_after_access(self):CODE
LOWtests/creational/test_pool.py35 def test_pool_behavior_with_single_object_inside(self):CODE
LOWtests/behavioral/test_catalog.py9def test_catalog_multiple_methods():CODE
LOWtests/behavioral/test_catalog.py15def test_catalog_multiple_instance_methods():CODE
LOWtests/behavioral/test_catalog.py21def test_catalog_multiple_class_methods():CODE
LOWtests/behavioral/test_catalog.py27def test_catalog_multiple_static_methods():CODE
LOWtests/behavioral/test_strategy.py14def test_discount_function_return(func, order, discount):CODE
LOWtests/behavioral/test_strategy.py21def test_order_discount_strategy_validate_success(func, price):CODE
LOWtests/behavioral/test_strategy.py28def test_order_discount_strategy_validate_error():CODE
LOWtests/behavioral/test_strategy.py38def test_discount_apply_success(func, price, discount):CODE
LOWtests/behavioral/test_memento.py11def test_rollback_on_transaction():CODE
LOWtests/behavioral/test_memento.py28def test_rollback_with_transactional_annotation():CODE
LOWtests/behavioral/test_observer.py24def test_one_data_change_notifies_each_observer_once(observable):CODE
LOWtests/behavioral/test_publish_subscribe.py11 def test_subscriber_shall_be_attachable_to_subscriptions(cls):CODE
LOWtests/behavioral/test_publish_subscribe.py19 def test_subscriber_shall_be_detachable_from_subscriptions(cls):CODE
LOWtests/behavioral/test_publish_subscribe.py28 def test_publisher_shall_append_subscription_message_to_queue(cls):CODE
LOWtests/behavioral/test_publish_subscribe.py39 def test_provider_shall_update_affected_subscribers_with_published_subscription(CODE
LOWtests/behavioral/test_visitor.py11def test_visiting_generic_node(visitor):CODE
LOWtests/behavioral/test_visitor.py17def test_visiting_specific_nodes(visitor):CODE
LOWtests/behavioral/test_visitor.py23def test_visiting_inherited_nodes(visitor):CODE
LOWtests/fundamental/test_delegation.py6def test_delegator_delegates_attribute_and_call():CODE
LOWtests/fundamental/test_delegation.py13def test_delegator_missing_attribute_raises():CODE
LOWtests/structural/test_adapter.py26 def test_car_shall_make_loud_noise(self):CODE
LOWtests/structural/test_adapter.py31 def test_car_shall_make_very_loud_noise(self):CODE
LOWtests/structural/test_adapter.py38 def test_dog_adapter_shall_make_noise(self):CODE
LOWtests/structural/test_adapter.py45 def test_cat_adapter_shall_make_noise(self):CODE
16 more matches not shown…
Unused Imports10 hits · 10 pts
SeverityFileLineSnippetContext
LOWpatterns/creational/prototype.py24CODE
LOWpatterns/behavioral/observer.py14CODE
LOWpatterns/behavioral/mediator.py11CODE
LOWpatterns/behavioral/strategy.py10CODE
LOWpatterns/behavioral/iterator_alt.py8CODE
LOWpatterns/behavioral/publish_subscribe.py7CODE
LOWpatterns/behavioral/state.py11CODE
LOWpatterns/behavioral/chaining_method.py1CODE
LOWpatterns/fundamental/delegation_pattern.py9CODE
LOWpatterns/structural/front_controller.py8CODE
Docstring Block Structure2 hits · 10 pts
SeverityFileLineSnippetContext
HIGHpatterns/behavioral/servant.py59 Calculate the area of a given shape. Args: shape: The geometric shape whose area is to be STRING
HIGHpatterns/behavioral/servant.py80 Calculate the perimeter of a given shape. Args: shape: The geometric shape whose perimeterSTRING
Deep Nesting2 hits · 2 pts
SeverityFileLineSnippetContext
LOWpatterns/other/graph_search.py40CODE
LOWpatterns/other/graph_search.py57CODE
Excessive Try-Catch Wrapping2 hits · 2 pts
SeverityFileLineSnippetContext
LOWpatterns/behavioral/memento.py66 except Exception as e:CODE
LOWpatterns/structural/mvc.py128 except Exception:CODE
Overly Generic Function Names2 hits · 2 pts
SeverityFileLineSnippetContext
LOWpatterns/behavioral/memento.py84 def do_stuff(self) -> None:CODE
LOWpatterns/fundamental/delegation_pattern.py53 def do_something(self, something: str, kw=None) -> str:CODE
AI Slop Vocabulary1 hit · 2 pts
SeverityFileLineSnippetContext
LOWpatterns/structural/flyweight.py43 # If the object exists in the pool - just return itCOMMENT