AI Slop Code RIsk Monitor

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).

15.5 Elevated pattern signal View on GitHub

Maintenance and Governance Review

This report summarizes scanner evidence for mockery/mockery, a PHP project with 10,723 GitHub stars. SynthScan examined 33,878 lines of code across 415 source files, recording 656 pattern matches distributed across 4 syntactic categories. The legacy adjusted pattern signal is 15.5 (Elevated pattern signal); it is not an authorship estimate.

Use the findings to ask whether maintainers can explain intent, verify dependencies, simplify unnecessary scaffolding, and focus review effort. Risk Payload v1 adds ownership, supply-chain, over-engineering, and review-effort vectors when available. These are prompts for human verification, not probabilities, security findings, or measured maintenance costs.

15.5
Adjusted Signal
15.5
Raw Pattern Score
100%
Time Factor
2026-09-11
Last Push
10.7K
Stars
PHP
Language
33.9K
Lines of Code
415
Files
656
Pattern Hits
2026-10-12
Scan Date
0.00
HC Hit Rate

Risk Review · v3

Use each vector to guide manual verification of the underlying findings.

Cognitive Ownership Risk 53.8/100 · HIGH

Can maintainers explain intent, assumptions, and trade-offs? 655 finding(s).

Hallucinated Dependency & Supply Chain Risk 0.1/100 · LOW

Are imports declared and package/API names verified? 1 finding(s).

Agent Over-Engineering Ratio 52.9/100 · HIGH

Are wrappers, guards, and repeated structures necessary? 644 finding(s).

PR Review Velocity Impact 62.1/100 · HIGH

Which changes need focused human review? 656 finding(s).

What These Metrics Mean

Adjusted Signal
Legacy pattern score normalized per 1,000 scanned lines and multiplied by the repository-level time factor. It is not an estimate of AI authorship.
Raw Pattern Score
Sum of severity- and context-weighted pattern findings before applying the time factor.
Time Factor
A coarse multiplier based on repository last-push metadata. It does not identify when individual code was written.
Pattern Hits
Count of configured pattern findings. Review each location and surrounding code before acting.
HC Hit Rate
High- and critical-severity findings per scanned file. Severity is a configured detector weight, not proof of a vulnerability or authorship.
Lines / Files
Scan coverage denominators used by the legacy normalized score.

Pattern-Signal History

This chart tracks the legacy adjusted pattern score across scan runs. Changes can reflect source changes, scan coverage, or detector/scoring versions; they do not measure AI adoption or prove that a team refactored code. Compare runs only when their scoring versions are compatible. The dashed line tracks the raw pattern-hit count.

Severity Breakdown

Groups findings by configured severity weight. Severity is not a confidence estimate, security rating, or proof that a package is missing. Verify imports against the project's manifests and inspect each finding in its local design context.

CRITICAL 0HIGH 0MEDIUM 1LOW 655

Directory Score Breakdown

This horizontal bar chart shows where configured pattern scores accumulate across directories. Treat the bars as locations to inspect, not as evidence of authorship or code quality. Use the file-level findings to decide whether a directory needs a focused ownership, dependency, complexity, or review check.

Pattern Findings

The scanner identified 656 distinct pattern matches across 4 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a detector match to inspect in context. 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 configured finding weight (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — legacy comment-context matches receive a ×1.5 score weight. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier under the legacy scoring model.

Hyper-Verbose Identifiers644 hits · 510 pts
SeverityFileLineSnippetContext
LOWtests/Unit/AbstractTestCase.php35 protected function assertInvalidCountExceptionMessage(CODE
LOWtests/Unit/PHP81/Php81LanguageFeaturesTest.php52 public function testCanMockClassesThatImplementSerializable(): voidCODE
LOWtests/Unit/PHP81/Php81LanguageFeaturesTest.php62 public function testItCanMockAClassWithANeverReturningTypeHint(): voidCODE
LOWtests/Unit/PHP81/Php81LanguageFeaturesTest.php75 public function testItCanMockAClassWithANeverReturningTypeHintWithExit(): voidCODE
LOWtests/Unit/PHP81/Php81LanguageFeaturesTest.php100 public function testItCanMockAClassWithAnIntersectionArgumentTypeHint(): voidCODE
LOW⚡tests/Unit/PHP81/Php81LanguageFeaturesTest.php116 public function testItCanMockAClassWithReturnTypeWillChangeAttributeAndNoReturnType(): voidCODE
LOW⚡tests/Unit/PHP81/Php81LanguageFeaturesTest.php126 public function testItCanMockAClassWithReturnTypeWillChangeAttributeAndWrongReturnType(): voidCODE
LOW⚡tests/Unit/PHP81/Php81LanguageFeaturesTest.php136 public function testItCanMockAnInternalClassWithTentativeReturnTypes(): voidCODE
LOW⚡tests/Unit/PHP81/Php81LanguageFeaturesTest.php146 public function testItCanMockAnInternalClassWithTentativeUnionReturnTypes(): voidCODE
LOWtests/Unit/PHP81/Php81LanguageFeaturesTest.php161 public function testItCanParseEnumAsDefaultValueCorrectly(): voidCODE
LOWtests/Unit/PHP81/Php81LanguageFeaturesTest.php173 public function testMockingClassWithNewInInitializer(): voidCODE
LOWtests/Unit/PHP81/Php81LanguageFeaturesTest.php183 public function testNewInitializerExpression(): voidCODE
LOWtests/Unit/PHP80/Php80LanguageFeaturesTest.php45 public function testItCanMockAClassWithAMixedArgumentTypeHint(): voidCODE
LOWtests/Unit/PHP80/Php80LanguageFeaturesTest.php59 public function testItCanMockAClassWithAMixedReturnTypeHint(): voidCODE
LOWtests/Unit/PHP80/Php80LanguageFeaturesTest.php69 public function testItCanMockAClassWithANamedArgumentList(): voidCODE
LOWtests/Unit/PHP80/Php80LanguageFeaturesTest.php94 public function testItCanMockAClassWithANamedArgumentListWithoutDefaultValue(): voidCODE
LOWtests/Unit/PHP80/Php80LanguageFeaturesTest.php110 public function testItCanMockAClassWithAParentArgumentTypeHint(): voidCODE
LOWtests/Unit/PHP80/Php80LanguageFeaturesTest.php124 public function testItCanMockAClassWithAParentReturnTypeHint(): voidCODE
LOWtests/Unit/PHP80/Php80LanguageFeaturesTest.php134 public function testItCanMockAClassWithAUnionArgumentTypeHint(): voidCODE
LOWtests/Unit/PHP80/Php80LanguageFeaturesTest.php148 public function testItCanMockAClassWithAUnionArgumentTypeHintIncludingNull(): voidCODE
LOWtests/Unit/PHP80/Php80LanguageFeaturesTest.php161 public function testItCanMockAClassWithAUnionReturnTypeHint(): voidCODE
LOWtests/Unit/PHP80/Php80LanguageFeaturesTest.php171 public function testItCanSpyAClassWithANamedArgumentList(): voidCODE
LOWtests/Unit/PHP80/Php80LanguageFeaturesTest.php212 public function testMockingIteratorAggregateDoesNotImplementIterator(): voidCODE
LOWtests/Unit/PHP80/Php80LanguageFeaturesTest.php223 public function testMockingIteratorDoesNotImplementIterator(): voidCODE
LOWtests/Unit/PHP80/MockWithClosureAsLastArgumentTest.php32 public function testIfClosureIsPassedAsLastArgumentToMockItIsCalledWithMockObject(): voidCODE
LOW…/Unit/PHP80/MockingMethodsWithStaticReturnTypeTest.php31 public function testMockingStaticReturnType(): voidCODE
LOWtests/Unit/PHP73/MockingVoidMethodsTest.php29 public function testItCanStubAndMockVoidMethods(): voidCODE
LOWtests/Unit/PHP73/MockingVoidMethodsTest.php41 public function testItShouldSuccessfullyBuildTheMock(): voidCODE
LOWtests/Unit/PHP73/TestCase1404Test.php49 public function testDemeterChainsAlternativeSyntax(array $result): voidCODE
LOWtests/Unit/PHP73/TestCase1404Test.php81 public function testDetestDemeterChainsAllowsmeterChainsAllows(array $result): voidCODE
LOWtests/Unit/PHP73/TestCase1404Test.php97 public function testNonDemeterChainsSyntax(array $result): voidCODE
LOWtests/Unit/PHP73/TestCase1328Test.php38 public function testShouldFailWithAnInvocationCountError(): voidCODE
LOWtests/Unit/PHP73/TestCase1328Test.php54 public function testThrowsInvalidArgumentExceptionForChainingAdditionalInvocationCountMethod(): voidCODE
LOWtests/Unit/PHP73/TestCase1328Test.php79 public function testThrowsInvalidArgumentExceptionWhenInvocationCountChanges(): voidCODE
LOWtests/Unit/PHP73/MockClassWithFinalWakeupTest.php48 public function testCreateMockForClassWithFinalWakeup(): voidCODE
LOWtests/Unit/PHP73/MockClassWithFinalWakeupTest.php62 public function testCreateMockForClassWithNonFinalWakeup(): voidCODE
LOWtests/Unit/PHP73/MockingOldStyleConstructorTest.php30 public function testMockClassWithOldStyleConstructorAndArguments(): voidCODE
LOWtests/Unit/PHP73/WithFormatterExpectationTest.php33 public static function provideFormatObjectsCases(): iterableCODE
LOWtests/Unit/PHP73/WithFormatterExpectationTest.php52 public function testFormatObjectsExcludesStaticGetters(): voidCODE
LOWtests/Unit/PHP73/WithFormatterExpectationTest.php63 public function testFormatObjectsExcludesStaticProperties(): voidCODE
LOWtests/Unit/PHP73/WithFormatterExpectationTest.php74 public function testFormatObjectsShouldNotCallGettersWithParams(): voidCODE
LOWtests/Unit/PHP73/WithFormatterExpectationTest.php88 public function testFormatObjectsWithMockCalledInGetterDoesNotLeadToRecursion(): voidCODE
LOWtests/Unit/PHP73/WithCustomFormatterExpectationTest.php67 public static function provideFormatObjectsCases(): iterableCODE
LOWtests/Unit/PHP73/WithCustomFormatterExpectationTest.php88 public static function provideGetObjectFormatterCases(): iterableCODE
LOWtests/Unit/Mockery/GlobalHelpersTest.php90 public function testNamedMockCreatesANamedMock(): voidCODE
LOWtests/Unit/Mockery/ProxyMockingTest.php30 public function testFinalClassCannotBeMocked(): voidCODE
LOWtests/Unit/Mockery/ProxyMockingTest.php50 public function testPassesThruVirtualMethods(): voidCODE
LOWtests/Unit/Mockery/HamcrestExpectationTest.php44 public function testAnythingConstraintMatchesArgument(): voidCODE
LOWtests/Unit/Mockery/HamcrestExpectationTest.php55 public function testGreaterThanConstraintMatchesArgument(): voidCODE
LOWtests/Unit/Mockery/HamcrestExpectationTest.php66 public function testGreaterThanConstraintNotMatchesArgument(): voidCODE
LOW⚡tests/Unit/Mockery/ContainerTest.php214 public function testCanMockAbstractClassWithAbstractPublicMethod(): voidCODE
LOW⚡tests/Unit/Mockery/ContainerTest.php223 public function testCanMockAbstractWithAbstractProtectedMethod(): voidCODE
LOW⚡tests/Unit/Mockery/ContainerTest.php232 public function testCanMockClassAndApplyMultipleInterfaces(): voidCODE
LOW⚡tests/Unit/Mockery/ContainerTest.php243 public function testCanMockClassContainingAPublicWakeupMethod(): voidCODE
LOW⚡tests/Unit/Mockery/ContainerTest.php252 public function testCanMockClassContainingMagicCallMethod(): voidCODE
LOW⚡tests/Unit/Mockery/ContainerTest.php261 public function testCanMockClassContainingMagicCallMethodWithoutTypeHinting(): voidCODE
LOW⚡tests/Unit/Mockery/ContainerTest.php270 public function testCanMockClassUsingMagicCallMethodsInPlaceOfNormalMethods(): voidCODE
LOW⚡tests/Unit/Mockery/ContainerTest.php281 public function testCanMockClassWhereMethodHasReferencedParameter(): voidCODE
LOW⚡tests/Unit/Mockery/ContainerTest.php289 public function testCanMockClassWithConstructor(): voidCODE
LOW⚡tests/Unit/Mockery/ContainerTest.php298 public function testCanMockClassWithConstructorNeedingClassArgs(): voidCODE
584 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