AI Slop Code RIsk Monitor

phan/phan

Phan is a static analyzer for PHP. Phan prefers to avoid false-positives and attempts to prove incorrectness rather than correctness.

6.5 Moderate pattern signal View on GitHub

Maintenance and Governance Review

This report summarizes scanner evidence for phan/phan, a PHP project with 5,626 GitHub stars. SynthScan examined 305,488 lines of code across 2863 source files, recording 2086 pattern matches distributed across 7 syntactic categories. The legacy adjusted pattern signal is 6.5 (Moderate 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.

6.5
Adjusted Signal
6.5
Raw Pattern Score
100%
Time Factor
2026-10-10
Last Push
5.6K
Stars
PHP
Language
305.5K
Lines of Code
2.9K
Files
2.1K
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 27.6/100 · MEDIUM

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

Hallucinated Dependency & Supply Chain Risk 0.1/100 · LOW

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

Agent Over-Engineering Ratio 26.1/100 · MEDIUM

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

PR Review Velocity Impact 29.1/100 · MEDIUM

Which changes need focused human review? 2086 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 1MEDIUM 7LOW 2078

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 2086 distinct pattern matches across 7 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 Identifiers1957 hits · 1844 pts
SeverityFileLineSnippetContext
LOW.phan/plugins/UnreachableCodePlugin.php39 public static function getPostAnalyzeNodeVisitorClassName(): stringCODE
LOW.phan/plugins/StrictComparisonPlugin.php43 public function getAnalyzeFunctionCallClosures(CodeBase $code_base): arrayCODE
LOW.phan/plugins/StrictComparisonPlugin.php98 public static function getPostAnalyzeNodeVisitorClassName(): stringCODE
LOW.phan/plugins/StrictComparisonPlugin.php153 private function bothSidesArePossiblyObjects(Node $node): boolCODE
LOW.phan/plugins/SleepCheckerPlugin.php30 public static function getPostAnalyzeNodeVisitorClassName(): stringCODE
LOW.phan/plugins/SleepCheckerPlugin.php69 private function warnAboutTransientSleepProperties(array $sleep_properties): voidCODE
LOW.phan/plugins/AlwaysReturnPlugin.php187 private static function getStatementListToAnalyze(Func|Method $func): ?NodeCODE
LOW.phan/plugins/AlwaysReturnPlugin.php206 private static function returnTypeOfFunctionLikeAllowsNull(FunctionInterface $func): boolCODE
LOW.phan/plugins/PregRegexCheckerPlugin.php86 private static function checkForSuspiciousRegexPatterns(string $pattern): GeneratorCODE
LOW.phan/plugins/PregRegexCheckerPlugin.php165 private static function extractStringsFromStringOrArray(CODE
LOW.phan/plugins/PregRegexCheckerPlugin.php233 private static function analyzeReplacementTemplate(CodeBase $code_base, Context $context, array $patterns, Node|floaCODE
LOW.phan/plugins/PregRegexCheckerPlugin.php267 public function getAnalyzeFunctionCallClosures(CodeBase $code_base): arrayCODE
LOW.phan/plugins/UncoveredEnumCasesInMatchPlugin.php45 public static function getPostAnalyzeNodeVisitorClassName(): stringCODE
LOW.phan/plugins/UncoveredEnumCasesInMatchPlugin.php235 private static function getBoolLiteralFromExpression(mixed $expr): ?stringCODE
LOW.phan/plugins/UncoveredEnumCasesInMatchPlugin.php435 private function checkNonFiniteTypeNeedsDefault(Node $node, UnionType $cond_type): voidCODE
LOW.phan/plugins/UncoveredEnumCasesInMatchPlugin.php504 private function getEnumClassesFromUnionType(UnionType $union_type): arrayCODE
LOW.phan/plugins/UncoveredEnumCasesInMatchPlugin.php536 private function getEnumCaseFromExpression(mixed $expr): ?stringCODE
LOW.phan/plugins/DuplicateArrayKeyPlugin.php26 public static function getPostAnalyzeNodeVisitorClassName(): stringCODE
LOW.phan/plugins/DuplicateArrayKeyPlugin.php120 private static function areAllSwitchCasesTheSameType(array $values_to_check): boolCODE
LOW.phan/plugins/DuplicateArrayKeyPlugin.php154 private function extendedLooseEqualityCheck(array $values_to_check, array $children): voidCODE
LOW.phan/plugins/DuplicateArrayKeyPlugin.php311 private function warnAboutDuplicateArrayKey(Node $entry, bool|float|int|null|string $key, Node $old_entry): voidCODE
LOW.phan/plugins/NotFullyQualifiedUsagePlugin.php27 public static function getPostAnalyzeNodeVisitorClassName(): stringCODE
LOW.phan/plugins/NotFullyQualifiedUsagePlugin.php125 private function warnNotFullyQualifiedFunctionCall(string $function_name, Node $expression): voidCODE
LOW.phan/plugins/NotFullyQualifiedUsagePlugin.php184 private function warnNotFullyQualifiedConstantUsage(string $constant_name, Node $expression): voidCODE
LOW.phan/plugins/AddNeverReturnTypePlugin.php128 private static function getStatementListToAnalyze(Func|Method $func): ?NodeCODE
LOW.phan/plugins/PHPDocToRealTypesPlugin.php142 private static function analyzeReturnTypeOfFunctionLike(CodeBase $code_base, FunctionInterface $method): voidCODE
LOW.phan/plugins/FFIAnalysisPlugin.php37 public static function getPreAnalyzeNodeVisitorClassName(): stringCODE
LOW.phan/plugins/FFIAnalysisPlugin.php46 public static function getPostAnalyzeNodeVisitorClassName(): stringCODE
LOW.phan/plugins/NoAssertPlugin.php40 public static function getPostAnalyzeNodeVisitorClassName(): stringCODE
LOW.phan/plugins/InlineHTMLPlugin.php146 public static function getPostAnalyzeNodeVisitorClassName(): stringCODE
LOW.phan/plugins/UnknownElementTypePlugin.php155 private static function suggestionFromUnionTypeNotRegularArray(?UnionType $type): ?SuggestionCODE
LOW.phan/plugins/StrictLiteralComparisonPlugin.php30 public static function getPostAnalyzeNodeVisitorClassName(): stringCODE
LOW.phan/plugins/NumericalComparisonPlugin.php24 public static function getPostAnalyzeNodeVisitorClassName(): stringCODE
LOW.phan/plugins/ShortArrayPlugin.php22 public static function getPostAnalyzeNodeVisitorClassName(): stringCODE
LOW.phan/plugins/EmptyStatementListPlugin.php53 public static function getPostAnalyzeNodeVisitorClassName(): stringCODE
LOW.phan/plugins/EmptyStatementListPlugin.php293 private static function foreachHasSideEffectsInAsClause(Node $node): boolCODE
LOW.phan/plugins/EmptyStatementListPlugin.php315 private static function assignmentTargetHasSideEffects(Node|string|int|float|null $target): boolCODE
LOW.phan/plugins/CaseMismatchPlugin.php34 public static function getPostAnalyzeNodeVisitorClassName(): stringCODE
LOW.phan/plugins/CaseMismatchPlugin.php57 public function getAnalyzeCallableArgumentClosure(CodeBase $code_base): \ClosureCODE
LOW.phan/plugins/CaseMismatchPlugin.php612 private function checkNamespaceOrAliasCasing(CODE
LOW.phan/plugins/CaseMismatchPlugin.php815 private static function checkStaticMethodCallable(CODE
LOW.phan/plugins/CaseMismatchPlugin.php879 private static function checkSelfStaticParentMethodCallable(CODE
LOW.phan/plugins/DemoPlugin.php68 public static function getPostAnalyzeNodeVisitorClassName(): stringCODE
LOW.phan/plugins/AvoidableGetterPlugin.php24 public static function getPostAnalyzeNodeVisitorClassName(): stringCODE
LOW.phan/plugins/AvoidableGetterPlugin.php108 private function warnCanReplaceGetterWithProperty(Node $node, string $property_name): voidCODE
LOW.phan/plugins/ConstantVariablePlugin.php22 public static function getPostAnalyzeNodeVisitorClassName(): stringCODE
LOW.phan/plugins/NonBoolBranchPlugin.php27 public static function getPreAnalyzeNodeVisitorClassName(): stringCODE
LOW.phan/plugins/PHPDocRedundantPlugin.php237 private static function emitRedundantCommentIssue(CodeBase $code_base, FunctionInterface $method, string $comment): CODE
LOW.phan/plugins/PHPDocRedundantPlugin.php306 private static function commentHasSingleVarAnnotation(string $comment_str): boolCODE
LOW.phan/plugins/DuplicateConstantPlugin.php38 public static function getPostAnalyzeNodeVisitorClassName(): stringCODE
LOW.phan/plugins/UnknownClassElementAccessPlugin.php64 public static function getPostAnalyzeNodeVisitorClassName(): stringCODE
LOW.phan/plugins/UnknownClassElementAccessPlugin.php91 public static function preventMethodIssueWarning(Context $context, Node $node): voidCODE
LOW.phan/plugins/RemoveDebugStatementPlugin.php30 public static function getPostAnalyzeNodeVisitorClassName(): stringCODE
LOW.phan/plugins/RemoveDebugStatementPlugin.php39 public function getAnalyzeFunctionCallClosures(CodeBase $code_base): arrayCODE
LOW.phan/plugins/RemoveDebugStatementPlugin.php133 public static function shouldSuppressDebugIssues(CodeBase $code_base, Context $context): boolCODE
LOW.phan/plugins/PhanSelfCheckPlugin.php46 public function getAnalyzeFunctionCallClosures(CodeBase $code_base): arrayCODE
LOW.phan/plugins/UnusedSuppressionPlugin.php67 private static function shouldCheckUnusedSuppressions(): boolCODE
LOW.phan/plugins/UnusedSuppressionPlugin.php80 private static function analyzeAddressableElement(CODE
LOW.phan/plugins/UnusedSuppressionPlugin.php116 private function postponeAnalysisOfElement(AddressableElement $element): voidCODE
LOW.phan/plugins/UnusedSuppressionPlugin.php214 private function analyzePluginSuppressions(CodeBase $code_base): voidCODE
1897 more matches not shown…
Over-Commented Block110 hits · 91 pts
SeverityFileLineSnippetContext
LOW.appveyor.yml1# This tests against the supported versions of Phan 6.x.y (PHP 8.1+)COMMENT
LOWREADME.md141 */COMMENT
LOWREADME.md161COMMENT
LOW.phan/config.php41COMMENT
LOW.phan/config.php61 'allow_missing_properties' => false,COMMENT
LOW.phan/config.php81 // (and reveal some bugs).COMMENT
LOW.phan/config.php101 // (For self-analysis, Phan has a large number of suppressions and file-level suppressions, due to \ast\Node being dCOMMENT
LOW.phan/config.php121 //COMMENT
LOW.phan/config.php141 'check_docblock_signature_return_type_match' => true,COMMENT
LOW.phan/config.php161 // the real types from the signature, when real types exist.COMMENT
LOW.phan/config.php181COMMENT
LOW.phan/config.php201 'infer_default_properties_in_construct' => true,COMMENT
LOW.phan/config.php221 //COMMENT
LOW.phan/config.php241 // `dead_code_detection` will also enable unused variable detection.COMMENT
LOW.phan/config.php261 'error_prone_truthy_condition_detection' => true,COMMENT
LOW.phan/config.php281COMMENT
LOW.phan/config.php321 ],COMMENT
LOW.phan/config.php361 'PhanPluginPossiblyStaticPublicMethod',COMMENT
LOW.phan/config.php421COMMENT
LOW.phan/config.php481 // List of case-insensitive file extensions supported by Phan.COMMENT
LOW.phan/config.php501 // By default, Phan will log error messages to stdout if PHP is using options that slow the analysis.COMMENT
LOW.phan/config.php561 // If this is true(default), then Phan will not warn.COMMENT
LOW.phan/config.php681 'ShortArrayPlugin',COMMENT
LOW.phan/plugins/DeprecateAliasPlugin.php301 // 'getrandmax' => 'mt_getrandmax', // confusing because rand is not an alias of mt_randCOMMENT
LOW.phan/plugins/README.md161 'plugin_config' => [COMMENT
LOWtests/misc/rewriting_test/.phan/config.php21COMMENT
LOWtests/misc/lsp/.phan/config.php21 // error message.COMMENT
LOWtests/misc/lsp/.phan/config.php41 // (For self-analysis, Phan has a large number of suppressions and file-level suppressions, due to \ast\Node being dCOMMENT
LOWtests/misc/fallback_test/.phan/config.php21COMMENT
LOWtests/real_types_test/.phan/config.php21COMMENT
LOWtests/real_types_test/.phan/config.php41 // If enabled, Phan will warn if **any** type in the method's objectCOMMENT
LOWtests/real_types_test/.phan/config.php61 // Setting this to true will introduce a large number of false positives (and some bugs).COMMENT
LOWtests/phantasm_test/.phan/config.php21 // error message.COMMENT
LOWtests/phantasm_test/.phan/config.php41 // (For self-analysis, Phan has a large number of suppressions and file-level suppressions, due to \ast\Node being dCOMMENT
LOWtests/Phan/Language/Type/ArrayShapeTypeTest.php81 );COMMENT
LOWtests/fixer_test/.phan/config.php21 // they are first seen. If false, we'll report anCOMMENT
LOWtests/fixer_test/.phan/config.php41 // Setting this to true will introduce a large number of false positives (and some bugs).COMMENT
LOWtests/track_all_inferred_types_test/.phan/config.php21COMMENT
LOWtests/track_all_inferred_types_test/.phan/config.php41 // If enabled, Phan will warn if **any** type in the method's objectCOMMENT
LOWtests/track_all_inferred_types_test/.phan/config.php121 //COMMENT
LOWtests/plugin_test/.phan/config.php21 // error message.COMMENT
LOWtests/plugin_test/.phan/config.php41 // (For self-analysis, Phan has a large number of suppressions and file-level suppressions, due to \ast\Node being dCOMMENT
LOWtests/plugin_test/src/029_other_parse_failure.php1<?phpCOMMENT
LOWtests/plugin_test/src/029_other_parse_failure.php21////////////////////////////////////////////////////////////////////////////////COMMENT
LOWtests/plugin_test/src/029_other_parse_failure.php41////////////////////////////////////////////////////////////////////////////////COMMENT
LOWtests/plugin_test/src/029_other_parse_failure.php61////////////////////////////////////////////////////////////////////////////////COMMENT
LOWtests/plugin_test/src/029_other_parse_failure.php81////////////////////////////////////////////////////////////////////////////////COMMENT
LOWtests/files/src/4796_class_const_narrowing.php1<?phpCOMMENT
LOWtests/infer_missing_types_test/.phan/config.php21COMMENT
LOWtests/infer_missing_types_test/.phan/config.php41 // If enabled, Phan will warn if **any** type in the method's objectCOMMENT
LOWtests/infer_missing_types_test/.phan/config.php121 //COMMENT
LOWtool/perf/ab.sh1#!/usr/bin/env bashCOMMENT
LOWsrc/Phan/BlockAnalysisVisitor.php1721 // after supporting `BlockAnalysisVisitor->visitBinaryOp()`COMMENT
LOWsrc/Phan/BlockAnalysisVisitor.php2361 // if it was possible for it to fall throughCOMMENT
LOWsrc/Phan/BlockAnalysisVisitor.php2541 $child_context = $this->visitStmtList($stmts_node);COMMENT
LOWsrc/Phan/Config.php141 * 1. The configuration automatically generated by `phan --init`.COMMENT
LOWsrc/Phan/Config.php161 // If that could not be determined, then Phan assumes `target_php_version`.COMMENT
LOWsrc/Phan/Config.php181 // method information. After excluding the directoriesCOMMENT
LOWsrc/Phan/Config.php201 //COMMENT
LOWsrc/Phan/Config.php221 //COMMENT
50 more matches not shown…
AI Slop Vocabulary5 hits · 15 pts
SeverityFileLineSnippetContext
MEDIUMsrc/Phan/BlockAnalysisVisitor.php3039 // Definitely defined in try: clear the possibly-undefined flagCOMMENT
MEDIUMsrc/Phan/Plugin/Internal/MiscParamPlugin.php935 // TODO: Could be more nuanced and account for possibly undefined types in the combination.COMMENT
MEDIUMsrc/Phan/Library/IncrementalAnalysis/Manifest.php114 // Use var_export() for faster, more robust serializationCOMMENT
MEDIUMsrc/Phan/Language/Type/CallableObjectType.php64 // Definitely not possible.COMMENT
MEDIUMsrc/Phan/Language/Type/ArrayType.php178 // TODO: More robust handling of non-arraysCOMMENT
TODO Padding7 hits · 11 pts
SeverityFileLineSnippetContext
LOWtests/Phan/Language/EmptyUnionTypeTest.php195 // TODO: Add tests of real union typesCOMMENT
LOWtests/files/src/0474_typed_iterable.php44// TODO: Add tests of casting generators and subclasses of Traversable to iterable (and implement the functionality)COMMENT
LOW⚡src/Phan/Analysis/NegatedConditionVisitor.php623 // TODO: implementCOMMENT
LOWsrc/Phan/Analysis/PostOrderAnalysisVisitor.php4849 // TODO: Add tests of variadic references, fix those if necessary.COMMENT
LOWsrc/Phan/Analysis/PostOrderAnalysisVisitor.php4961 // TODO: Add tests of variadic references, fix those if necessary.COMMENT
LOWsrc/Phan/AST/TolerantASTConverter/NodeUtils.php48 // TODO: Handle error case (can there be missing parts?)COMMENT
LOW…Phan/AST/TolerantASTConverter/TolerantASTConverter.php3544 // TODO: Handle error case (can there be missing parts?)COMMENT
Synthetic Comment Markers1 hit · 8 pts
SeverityFileLineSnippetContext
HIGHsrc/Phan/ForkPool.php154 // Fork as many times as requested to get the givenCOMMENT
Self-Referential Comments2 hits · 6 pts
SeverityFileLineSnippetContext
MEDIUMtests/phantasm_test/test.sh18# Create a copy so we can verify the copy is changed in placeCOMMENT
MEDIUMtests/fixer_test/test.sh50# Create a copy so we can verify the copy is changed in placeCOMMENT
Fake / Example Data4 hits · 4 pts
SeverityFileLineSnippetContext
LOWtests/real_types_test/src/011_nullsafe_property.php4 public string $street = '123 Main St';CODE
LOWtests/plugin_test/src/058_invalid_regex_replacement.php12 echo preg_replace('/missingenddelimiter', 'placeholder', 'fooball');CODE
LOWtests/files/src/1092_match.php24 default => "placeholder",CODE
LOWsrc/Phan/Language/Internal/ClassDocumentationMap.php1008*Motivation*: Suppose we need to refer to a document in another collection. The easiest way is to create a field in the COMMENT