Repository Analysis

phan/phan

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

6.3 Low AI signal View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of phan/phan, a PHP project with 5,620 GitHub stars. SynthScan v2.0 examined 291,206 lines of code across 2827 source files, recording 1929 pattern matches distributed across 7 syntactic categories. The overall adjusted score of 6.3 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).

6.3
Adjusted Score
6.3
Raw Score
100%
Time Factor
2026-07-05
Last Push
5.6K
Stars
PHP
Language
291.2K
Lines of Code
2.8K
Files
1.9K
Pattern Hits
2026-07-14
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

This chart maps the temporal evolution of the adjusted synthetic code score across successive scan runs. An upward trajectory indicates ongoing incorporation of AI-generated code or expanding LLM-assisted scaffolding; a stable or declining trajectory may reflect active human refactoring, code removal, or the adoption of stricter authorship policies. The dashed secondary line (right axis) independently tracks total raw pattern hit count, which can diverge from the normalised score when codebase size changes significantly between scans.

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 1MEDIUM 7LOW 1921

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 1929 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 Identifiers1810 hits · 1716 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
1750 more matches not shown…
Over-Commented Block100 hits · 85 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
LOWsrc/Phan/BlockAnalysisVisitor.php1681 // NOTE: This is different from other analysis visitors because analyzing 'cond' with `||` has side effectsCOMMENT
LOWsrc/Phan/BlockAnalysisVisitor.php2321 // Add the variable type from the **conditions of the** above arms,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
LOWsrc/Phan/Config.php241 // Relative paths are harder to reason about, and opcache may have issues with relative paths in edge cases.COMMENT
LOWsrc/Phan/Config.php261COMMENT
40 more matches not shown…
AI Slop Vocabulary5 hits · 15 pts
SeverityFileLineSnippetContext
MEDIUMsrc/Phan/BlockAnalysisVisitor.php3000 // 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
LOWsrc/Phan/Analysis/NegatedConditionVisitor.php624 // TODO: implementCOMMENT
LOWsrc/Phan/Analysis/PostOrderAnalysisVisitor.php4839 // TODO: Add tests of variadic references, fix those if necessary.COMMENT
LOWsrc/Phan/Analysis/PostOrderAnalysisVisitor.php4951 // 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.php141 // 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