Repository Analysis

mockery/mockery

Mockery is a simple yet flexible PHP mock object framework for use in unit testing with PHPUnit, PHPSpec or any other testing framework. Its core goal is to offer a test double framework with a succinct API capable of clearly defining all possible object operations and interactions using a human readable Domain Specific Language (DSL).

18.5 Moderate AI signal View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of mockery/mockery, a PHP project with 10,726 GitHub stars. SynthScan v2.0 examined 31,703 lines of code across 399 source files, recording 631 pattern matches distributed across 4 syntactic categories. The overall adjusted score of 18.5 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).

18.5
Adjusted Score
18.5
Raw Score
100%
Time Factor
2026-08-08
Last Push
10.7K
Stars
PHP
Language
31.7K
Lines of Code
399
Files
631
Pattern Hits
2026-08-09
Scan Date
0.00
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 0MEDIUM 1LOW 630

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 631 distinct pattern matches across 4 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 Identifiers619 hits · 574 pts
SeverityFileLineSnippetContext
LOWpsalm-baseline.xml1995 <code><![CDATA[public function shouldAllowMockingProtectedMethods()]]></code>CODE
LOWtests/Unit/PHP81/Php81LanguageFeaturesTest.php35 public function testCanMockClassesThatImplementSerializable(): voidCODE
LOWtests/Unit/PHP81/Php81LanguageFeaturesTest.php42 public function testItCanMockAClassWithANeverReturningTypeHint(): voidCODE
LOWtests/Unit/PHP81/Php81LanguageFeaturesTest.php53 public function testItCanMockAClassWithANeverReturningTypeHintWithExit(): voidCODE
LOWtests/Unit/PHP81/Php81LanguageFeaturesTest.php75 public function testItCanMockAClassWithAnIntersectionArgumentTypeHint(): voidCODE
LOWtests/Unit/PHP81/Php81LanguageFeaturesTest.php88 public function testItCanMockAClassWithReturnTypeWillChangeAttributeAndNoReturnType(): voidCODE
LOWtests/Unit/PHP81/Php81LanguageFeaturesTest.php95 public function testItCanMockAClassWithReturnTypeWillChangeAttributeAndWrongReturnType(): voidCODE
LOWtests/Unit/PHP81/Php81LanguageFeaturesTest.php102 public function testItCanMockAnInternalClassWithTentativeReturnTypes(): voidCODE
LOWtests/Unit/PHP81/Php81LanguageFeaturesTest.php109 public function testItCanMockAnInternalClassWithTentativeUnionReturnTypes(): voidCODE
LOWtests/Unit/PHP81/Php81LanguageFeaturesTest.php125 public function testItCanParseEnumAsDefaultValueCorrectly(): voidCODE
LOWtests/Unit/PHP81/Php81LanguageFeaturesTest.php134 public function testMockingClassWithNewInInitializer(): voidCODE
LOWtests/Unit/PHP81/Php81LanguageFeaturesTest.php141 public function testNewInitializerExpression(): voidCODE
LOWtests/Unit/PHP80/Php80LanguageFeaturesTest.php29 public function testItCanMockAClassWithAMixedArgumentTypeHint(): voidCODE
LOWtests/Unit/PHP80/Php80LanguageFeaturesTest.php40 public function testItCanMockAClassWithAMixedReturnTypeHint(): voidCODE
LOWtests/Unit/PHP80/Php80LanguageFeaturesTest.php47 public function testItCanMockAClassWithAParentArgumentTypeHint(): voidCODE
LOWtests/Unit/PHP80/Php80LanguageFeaturesTest.php58 public function testItCanMockAClassWithAParentReturnTypeHint(): voidCODE
LOWtests/Unit/PHP80/Php80LanguageFeaturesTest.php65 public function testItCanMockAClassWithAUnionArgumentTypeHint(): voidCODE
LOWtests/Unit/PHP80/Php80LanguageFeaturesTest.php76 public function testItCanMockAClassWithANamedArgumentList(): voidCODE
LOWtests/Unit/PHP80/Php80LanguageFeaturesTest.php98 public function testItCanMockAClassWithANamedArgumentListWithoutDefaultValue(): voidCODE
LOWtests/Unit/PHP80/Php80LanguageFeaturesTest.php111 public function testItCanSpyAClassWithANamedArgumentList(): voidCODE
LOWtests/Unit/PHP80/Php80LanguageFeaturesTest.php135 public function testItCanMockAClassWithAUnionArgumentTypeHintIncludingNull(): voidCODE
LOWtests/Unit/PHP80/Php80LanguageFeaturesTest.php145 public function testItCanMockAClassWithAUnionReturnTypeHint(): voidCODE
LOWtests/Unit/PHP80/Php80LanguageFeaturesTest.php152 public function testMockingIteratorAggregateDoesNotImplementIterator(): voidCODE
LOWtests/Unit/PHP80/Php80LanguageFeaturesTest.php160 public function testMockingIteratorDoesNotImplementIterator(): voidCODE
LOWtests/Unit/PHP80/MockWithClosureAsLastArgumentTest.php18 public function testIfClosureIsPassedAsLastArgumentToMockItIsCalledWithMockObject(): voidCODE
LOW…/Unit/PHP80/MockingMethodsWithStaticReturnTypeTest.php15 public function testMockingStaticReturnType(): voidCODE
LOWtests/Unit/PHP73/MockingVoidMethodsTest.php15 public function testItCanStubAndMockVoidMethods(): voidCODE
LOWtests/Unit/PHP73/MockingVoidMethodsTest.php24 public function testItShouldSuccessfullyBuildTheMock(): voidCODE
LOWtests/Unit/PHP73/TestCase1404Test.php34 public function testDemeterChainsAlternativeSyntax(array $result): voidCODE
LOWtests/Unit/PHP73/TestCase1404Test.php60 public function testDetestDemeterChainsAllowsmeterChainsAllows(array $result): voidCODE
LOWtests/Unit/PHP73/TestCase1404Test.php73 public function testNonDemeterChainsSyntax(array $result): voidCODE
LOWtests/Unit/PHP73/TestCase1328Test.php21 public function testShouldFailWithAnInvocationCountError(): voidCODE
LOWtests/Unit/PHP73/TestCase1328Test.php34 public function testThrowsInvalidArgumentExceptionForChainingAdditionalInvocationCountMethod(): voidCODE
LOWtests/Unit/PHP73/TestCase1328Test.php57 public function testThrowsInvalidArgumentExceptionWhenInvocationCountChanges(): voidCODE
LOWtests/Unit/PHP73/MockClassWithFinalWakeupTest.php34 public function testCreateMockForClassWithFinalWakeup(): voidCODE
LOWtests/Unit/PHP73/MockClassWithFinalWakeupTest.php45 public function testCreateMockForClassWithNonFinalWakeup(): voidCODE
LOWtests/Unit/PHP73/MockingOldStyleConstructorTest.php16 public function testMockClassWithOldStyleConstructorAndArguments(): voidCODE
LOWtests/Unit/PHP73/WithFormatterExpectationTest.php21 public static function provideFormatObjectsCases(): iterableCODE
LOWtests/Unit/PHP73/WithFormatterExpectationTest.php34 public function testFormatObjectsExcludesStaticGetters(): voidCODE
LOWtests/Unit/PHP73/WithFormatterExpectationTest.php42 public function testFormatObjectsExcludesStaticProperties(): voidCODE
LOWtests/Unit/PHP73/WithFormatterExpectationTest.php50 public function testFormatObjectsShouldNotCallGettersWithParams(): voidCODE
LOWtests/Unit/PHP73/WithFormatterExpectationTest.php62 public function testFormatObjectsWithMockCalledInGetterDoesNotLeadToRecursion(): voidCODE
LOWtests/Unit/PHP73/WithCustomFormatterExpectationTest.php53 public static function provideFormatObjectsCases(): iterableCODE
LOWtests/Unit/PHP73/WithCustomFormatterExpectationTest.php74 public static function provideGetObjectFormatterCases(): iterableCODE
LOWtests/Unit/Mockery/GlobalHelpersTest.php53 public function testNamedMockCreatesANamedMock(): voidCODE
LOWtests/Unit/Mockery/ProxyMockingTest.php16 public function testFinalClassCannotBeMocked(): voidCODE
LOWtests/Unit/Mockery/ProxyMockingTest.php30 public function testPassesThruVirtualMethods(): voidCODE
LOWtests/Unit/Mockery/HamcrestExpectationTest.php28 public function testAnythingConstraintMatchesArgument(): voidCODE
LOWtests/Unit/Mockery/HamcrestExpectationTest.php36 public function testGreaterThanConstraintMatchesArgument(): voidCODE
LOWtests/Unit/Mockery/HamcrestExpectationTest.php44 public function testGreaterThanConstraintNotMatchesArgument(): voidCODE
LOWtests/Unit/Mockery/ContainerTest.php172 public function testCanMockAbstractClassWithAbstractPublicMethod(): voidCODE
LOWtests/Unit/Mockery/ContainerTest.php178 public function testCanMockAbstractWithAbstractProtectedMethod(): voidCODE
LOWtests/Unit/Mockery/ContainerTest.php184 public function testCanMockClassAndApplyMultipleInterfaces(): voidCODE
LOWtests/Unit/Mockery/ContainerTest.php192 public function testCanMockClassContainingAPublicWakeupMethod(): voidCODE
LOWtests/Unit/Mockery/ContainerTest.php198 public function testCanMockClassContainingMagicCallMethod(): voidCODE
LOWtests/Unit/Mockery/ContainerTest.php204 public function testCanMockClassContainingMagicCallMethodWithoutTypeHinting(): voidCODE
LOWtests/Unit/Mockery/ContainerTest.php210 public function testCanMockClassUsingMagicCallMethodsInPlaceOfNormalMethods(): voidCODE
LOWtests/Unit/Mockery/ContainerTest.php218 public function testCanMockClassWhereMethodHasReferencedParameter(): voidCODE
LOWtests/Unit/Mockery/ContainerTest.php223 public function testCanMockClassWithConstructor(): voidCODE
LOWtests/Unit/Mockery/ContainerTest.php229 public function testCanMockClassWithConstructorNeedingClassArgs(): voidCODE
559 more matches not shown…
Over-Commented Block10 hits · 10 pts
SeverityFileLineSnippetContext
LOWe2e-test.sh1#!/bin/bashCOMMENT
LOWdocs/conf.py1# -*- coding: utf-8 -*-COMMENT
LOWdocs/conf.py61# The language for content autogenerated by Sphinx. Refer to documentationCOMMENT
LOWdocs/conf.py81COMMENT
LOWdocs/conf.py101COMMENT
LOWdocs/conf.py121# so a file named "default.css" will overwrite the builtin "default.css".COMMENT
LOWdocs/conf.py141# template names.COMMENT
LOWdocs/conf.py161COMMENT
LOWdocs/conf.py181#'pointsize': '10pt',COMMENT
LOWdocs/conf.py201#latex_use_parts = FalseCOMMENT
Self-Referential Comments1 hit · 3 pts
SeverityFileLineSnippetContext
MEDIUMdocs/conf.py6# This file is execfile()d with the current directory set to itsCOMMENT
Unused Imports1 hit · 1 pts
SeverityFileLineSnippetContext
LOWdocs/conf.py15CODE