Phan is a static analyzer for PHP. Phan prefers to avoid false-positives and attempts to prove incorrectness rather than correctness.
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).
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.
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.
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.
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.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | .phan/plugins/UnreachableCodePlugin.php | 39 | public static function getPostAnalyzeNodeVisitorClassName(): string | CODE |
| LOW | .phan/plugins/StrictComparisonPlugin.php | 43 | public function getAnalyzeFunctionCallClosures(CodeBase $code_base): array | CODE |
| LOW | .phan/plugins/StrictComparisonPlugin.php | 98 | public static function getPostAnalyzeNodeVisitorClassName(): string | CODE |
| LOW | .phan/plugins/StrictComparisonPlugin.php | 153 | private function bothSidesArePossiblyObjects(Node $node): bool | CODE |
| LOW | .phan/plugins/SleepCheckerPlugin.php | 30 | public static function getPostAnalyzeNodeVisitorClassName(): string | CODE |
| LOW | .phan/plugins/SleepCheckerPlugin.php | 69 | private function warnAboutTransientSleepProperties(array $sleep_properties): void | CODE |
| LOW | .phan/plugins/AlwaysReturnPlugin.php | 187 | private static function getStatementListToAnalyze(Func|Method $func): ?Node | CODE |
| LOW | .phan/plugins/AlwaysReturnPlugin.php | 206 | private static function returnTypeOfFunctionLikeAllowsNull(FunctionInterface $func): bool | CODE |
| LOW | .phan/plugins/PregRegexCheckerPlugin.php | 86 | private static function checkForSuspiciousRegexPatterns(string $pattern): Generator | CODE |
| LOW | .phan/plugins/PregRegexCheckerPlugin.php | 165 | private static function extractStringsFromStringOrArray( | CODE |
| LOW | .phan/plugins/PregRegexCheckerPlugin.php | 233 | private static function analyzeReplacementTemplate(CodeBase $code_base, Context $context, array $patterns, Node|floa | CODE |
| LOW | .phan/plugins/PregRegexCheckerPlugin.php | 267 | public function getAnalyzeFunctionCallClosures(CodeBase $code_base): array | CODE |
| LOW | .phan/plugins/UncoveredEnumCasesInMatchPlugin.php | 45 | public static function getPostAnalyzeNodeVisitorClassName(): string | CODE |
| LOW | .phan/plugins/UncoveredEnumCasesInMatchPlugin.php | 235 | private static function getBoolLiteralFromExpression(mixed $expr): ?string | CODE |
| LOW | .phan/plugins/UncoveredEnumCasesInMatchPlugin.php | 435 | private function checkNonFiniteTypeNeedsDefault(Node $node, UnionType $cond_type): void | CODE |
| LOW | .phan/plugins/UncoveredEnumCasesInMatchPlugin.php | 504 | private function getEnumClassesFromUnionType(UnionType $union_type): array | CODE |
| LOW | .phan/plugins/UncoveredEnumCasesInMatchPlugin.php | 536 | private function getEnumCaseFromExpression(mixed $expr): ?string | CODE |
| LOW | .phan/plugins/DuplicateArrayKeyPlugin.php | 26 | public static function getPostAnalyzeNodeVisitorClassName(): string | CODE |
| LOW | .phan/plugins/DuplicateArrayKeyPlugin.php | 120 | private static function areAllSwitchCasesTheSameType(array $values_to_check): bool | CODE |
| LOW | .phan/plugins/DuplicateArrayKeyPlugin.php | 154 | private function extendedLooseEqualityCheck(array $values_to_check, array $children): void | CODE |
| LOW | .phan/plugins/DuplicateArrayKeyPlugin.php | 311 | private function warnAboutDuplicateArrayKey(Node $entry, bool|float|int|null|string $key, Node $old_entry): void | CODE |
| LOW | .phan/plugins/NotFullyQualifiedUsagePlugin.php | 27 | public static function getPostAnalyzeNodeVisitorClassName(): string | CODE |
| LOW | .phan/plugins/NotFullyQualifiedUsagePlugin.php | 125 | private function warnNotFullyQualifiedFunctionCall(string $function_name, Node $expression): void | CODE |
| LOW | .phan/plugins/NotFullyQualifiedUsagePlugin.php | 184 | private function warnNotFullyQualifiedConstantUsage(string $constant_name, Node $expression): void | CODE |
| LOW | .phan/plugins/AddNeverReturnTypePlugin.php | 128 | private static function getStatementListToAnalyze(Func|Method $func): ?Node | CODE |
| LOW | .phan/plugins/PHPDocToRealTypesPlugin.php | 142 | private static function analyzeReturnTypeOfFunctionLike(CodeBase $code_base, FunctionInterface $method): void | CODE |
| LOW | .phan/plugins/FFIAnalysisPlugin.php | 37 | public static function getPreAnalyzeNodeVisitorClassName(): string | CODE |
| LOW | .phan/plugins/FFIAnalysisPlugin.php | 46 | public static function getPostAnalyzeNodeVisitorClassName(): string | CODE |
| LOW | .phan/plugins/NoAssertPlugin.php | 40 | public static function getPostAnalyzeNodeVisitorClassName(): string | CODE |
| LOW | .phan/plugins/InlineHTMLPlugin.php | 146 | public static function getPostAnalyzeNodeVisitorClassName(): string | CODE |
| LOW | .phan/plugins/UnknownElementTypePlugin.php | 155 | private static function suggestionFromUnionTypeNotRegularArray(?UnionType $type): ?Suggestion | CODE |
| LOW | .phan/plugins/StrictLiteralComparisonPlugin.php | 30 | public static function getPostAnalyzeNodeVisitorClassName(): string | CODE |
| LOW | .phan/plugins/NumericalComparisonPlugin.php | 24 | public static function getPostAnalyzeNodeVisitorClassName(): string | CODE |
| LOW | .phan/plugins/ShortArrayPlugin.php | 22 | public static function getPostAnalyzeNodeVisitorClassName(): string | CODE |
| LOW | .phan/plugins/EmptyStatementListPlugin.php | 53 | public static function getPostAnalyzeNodeVisitorClassName(): string | CODE |
| LOW | .phan/plugins/EmptyStatementListPlugin.php | 293 | private static function foreachHasSideEffectsInAsClause(Node $node): bool | CODE |
| LOW | .phan/plugins/EmptyStatementListPlugin.php | 315 | private static function assignmentTargetHasSideEffects(Node|string|int|float|null $target): bool | CODE |
| LOW | .phan/plugins/CaseMismatchPlugin.php | 34 | public static function getPostAnalyzeNodeVisitorClassName(): string | CODE |
| LOW | .phan/plugins/CaseMismatchPlugin.php | 57 | public function getAnalyzeCallableArgumentClosure(CodeBase $code_base): \Closure | CODE |
| LOW | .phan/plugins/CaseMismatchPlugin.php | 612 | private function checkNamespaceOrAliasCasing( | CODE |
| LOW | .phan/plugins/CaseMismatchPlugin.php | 815 | private static function checkStaticMethodCallable( | CODE |
| LOW | .phan/plugins/CaseMismatchPlugin.php | 879 | private static function checkSelfStaticParentMethodCallable( | CODE |
| LOW | .phan/plugins/DemoPlugin.php | 68 | public static function getPostAnalyzeNodeVisitorClassName(): string | CODE |
| LOW | .phan/plugins/AvoidableGetterPlugin.php | 24 | public static function getPostAnalyzeNodeVisitorClassName(): string | CODE |
| LOW | .phan/plugins/AvoidableGetterPlugin.php | 108 | private function warnCanReplaceGetterWithProperty(Node $node, string $property_name): void | CODE |
| LOW | .phan/plugins/ConstantVariablePlugin.php | 22 | public static function getPostAnalyzeNodeVisitorClassName(): string | CODE |
| LOW | .phan/plugins/NonBoolBranchPlugin.php | 27 | public static function getPreAnalyzeNodeVisitorClassName(): string | CODE |
| LOW | .phan/plugins/PHPDocRedundantPlugin.php | 237 | private static function emitRedundantCommentIssue(CodeBase $code_base, FunctionInterface $method, string $comment): | CODE |
| LOW | .phan/plugins/PHPDocRedundantPlugin.php | 306 | private static function commentHasSingleVarAnnotation(string $comment_str): bool | CODE |
| LOW | .phan/plugins/DuplicateConstantPlugin.php | 38 | public static function getPostAnalyzeNodeVisitorClassName(): string | CODE |
| LOW | .phan/plugins/UnknownClassElementAccessPlugin.php | 64 | public static function getPostAnalyzeNodeVisitorClassName(): string | CODE |
| LOW | .phan/plugins/UnknownClassElementAccessPlugin.php | 91 | public static function preventMethodIssueWarning(Context $context, Node $node): void | CODE |
| LOW | .phan/plugins/RemoveDebugStatementPlugin.php | 30 | public static function getPostAnalyzeNodeVisitorClassName(): string | CODE |
| LOW | .phan/plugins/RemoveDebugStatementPlugin.php | 39 | public function getAnalyzeFunctionCallClosures(CodeBase $code_base): array | CODE |
| LOW | .phan/plugins/RemoveDebugStatementPlugin.php | 133 | public static function shouldSuppressDebugIssues(CodeBase $code_base, Context $context): bool | CODE |
| LOW | .phan/plugins/PhanSelfCheckPlugin.php | 46 | public function getAnalyzeFunctionCallClosures(CodeBase $code_base): array | CODE |
| LOW | .phan/plugins/UnusedSuppressionPlugin.php | 67 | private static function shouldCheckUnusedSuppressions(): bool | CODE |
| LOW | .phan/plugins/UnusedSuppressionPlugin.php | 80 | private static function analyzeAddressableElement( | CODE |
| LOW | .phan/plugins/UnusedSuppressionPlugin.php | 116 | private function postponeAnalysisOfElement(AddressableElement $element): void | CODE |
| LOW | .phan/plugins/UnusedSuppressionPlugin.php | 214 | private function analyzePluginSuppressions(CodeBase $code_base): void | CODE |
| 1750 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | .appveyor.yml | 1 | # This tests against the supported versions of Phan 6.x.y (PHP 8.1+) | COMMENT |
| LOW | README.md | 141 | */ | COMMENT |
| LOW | README.md | 161 | COMMENT | |
| LOW | .phan/config.php | 41 | COMMENT | |
| LOW | .phan/config.php | 61 | 'allow_missing_properties' => false, | COMMENT |
| LOW | .phan/config.php | 81 | // (and reveal some bugs). | COMMENT |
| LOW | .phan/config.php | 101 | // (For self-analysis, Phan has a large number of suppressions and file-level suppressions, due to \ast\Node being d | COMMENT |
| LOW | .phan/config.php | 121 | // | COMMENT |
| LOW | .phan/config.php | 141 | 'check_docblock_signature_return_type_match' => true, | COMMENT |
| LOW | .phan/config.php | 161 | // the real types from the signature, when real types exist. | COMMENT |
| LOW | .phan/config.php | 181 | COMMENT | |
| LOW | .phan/config.php | 201 | 'infer_default_properties_in_construct' => true, | COMMENT |
| LOW | .phan/config.php | 221 | // | COMMENT |
| LOW | .phan/config.php | 241 | // `dead_code_detection` will also enable unused variable detection. | COMMENT |
| LOW | .phan/config.php | 261 | 'error_prone_truthy_condition_detection' => true, | COMMENT |
| LOW | .phan/config.php | 281 | COMMENT | |
| LOW | .phan/config.php | 321 | ], | COMMENT |
| LOW | .phan/config.php | 361 | 'PhanPluginPossiblyStaticPublicMethod', | COMMENT |
| LOW | .phan/config.php | 421 | COMMENT | |
| LOW | .phan/config.php | 481 | // List of case-insensitive file extensions supported by Phan. | COMMENT |
| LOW | .phan/config.php | 501 | // By default, Phan will log error messages to stdout if PHP is using options that slow the analysis. | COMMENT |
| LOW | .phan/config.php | 561 | // If this is true(default), then Phan will not warn. | COMMENT |
| LOW | .phan/config.php | 681 | 'ShortArrayPlugin', | COMMENT |
| LOW | .phan/plugins/DeprecateAliasPlugin.php | 301 | // 'getrandmax' => 'mt_getrandmax', // confusing because rand is not an alias of mt_rand | COMMENT |
| LOW | .phan/plugins/README.md | 161 | 'plugin_config' => [ | COMMENT |
| LOW | tests/misc/rewriting_test/.phan/config.php | 21 | COMMENT | |
| LOW | tests/misc/lsp/.phan/config.php | 21 | // error message. | COMMENT |
| LOW | tests/misc/lsp/.phan/config.php | 41 | // (For self-analysis, Phan has a large number of suppressions and file-level suppressions, due to \ast\Node being d | COMMENT |
| LOW | tests/misc/fallback_test/.phan/config.php | 21 | COMMENT | |
| LOW | tests/real_types_test/.phan/config.php | 21 | COMMENT | |
| LOW | tests/real_types_test/.phan/config.php | 41 | // If enabled, Phan will warn if **any** type in the method's object | COMMENT |
| LOW | tests/real_types_test/.phan/config.php | 61 | // Setting this to true will introduce a large number of false positives (and some bugs). | COMMENT |
| LOW | tests/phantasm_test/.phan/config.php | 21 | // error message. | COMMENT |
| LOW | tests/phantasm_test/.phan/config.php | 41 | // (For self-analysis, Phan has a large number of suppressions and file-level suppressions, due to \ast\Node being d | COMMENT |
| LOW | tests/Phan/Language/Type/ArrayShapeTypeTest.php | 81 | ); | COMMENT |
| LOW | tests/fixer_test/.phan/config.php | 21 | // they are first seen. If false, we'll report an | COMMENT |
| LOW | tests/fixer_test/.phan/config.php | 41 | // Setting this to true will introduce a large number of false positives (and some bugs). | COMMENT |
| LOW | tests/track_all_inferred_types_test/.phan/config.php | 21 | COMMENT | |
| LOW | tests/track_all_inferred_types_test/.phan/config.php | 41 | // If enabled, Phan will warn if **any** type in the method's object | COMMENT |
| LOW | tests/track_all_inferred_types_test/.phan/config.php | 121 | // | COMMENT |
| LOW | tests/plugin_test/.phan/config.php | 21 | // error message. | COMMENT |
| LOW | tests/plugin_test/.phan/config.php | 41 | // (For self-analysis, Phan has a large number of suppressions and file-level suppressions, due to \ast\Node being d | COMMENT |
| LOW | tests/plugin_test/src/029_other_parse_failure.php | 1 | <?php | COMMENT |
| LOW | tests/plugin_test/src/029_other_parse_failure.php | 21 | //////////////////////////////////////////////////////////////////////////////// | COMMENT |
| LOW | tests/plugin_test/src/029_other_parse_failure.php | 41 | //////////////////////////////////////////////////////////////////////////////// | COMMENT |
| LOW | tests/plugin_test/src/029_other_parse_failure.php | 61 | //////////////////////////////////////////////////////////////////////////////// | COMMENT |
| LOW | tests/plugin_test/src/029_other_parse_failure.php | 81 | //////////////////////////////////////////////////////////////////////////////// | COMMENT |
| LOW | tests/files/src/4796_class_const_narrowing.php | 1 | <?php | COMMENT |
| LOW | tests/infer_missing_types_test/.phan/config.php | 21 | COMMENT | |
| LOW | tests/infer_missing_types_test/.phan/config.php | 41 | // If enabled, Phan will warn if **any** type in the method's object | COMMENT |
| LOW | tests/infer_missing_types_test/.phan/config.php | 121 | // | COMMENT |
| LOW | src/Phan/BlockAnalysisVisitor.php | 1681 | // NOTE: This is different from other analysis visitors because analyzing 'cond' with `||` has side effects | COMMENT |
| LOW | src/Phan/BlockAnalysisVisitor.php | 2321 | // Add the variable type from the **conditions of the** above arms, | COMMENT |
| LOW | src/Phan/Config.php | 141 | * 1. The configuration automatically generated by `phan --init`. | COMMENT |
| LOW | src/Phan/Config.php | 161 | // If that could not be determined, then Phan assumes `target_php_version`. | COMMENT |
| LOW | src/Phan/Config.php | 181 | // method information. After excluding the directories | COMMENT |
| LOW | src/Phan/Config.php | 201 | // | COMMENT |
| LOW | src/Phan/Config.php | 221 | // | COMMENT |
| LOW | src/Phan/Config.php | 241 | // Relative paths are harder to reason about, and opcache may have issues with relative paths in edge cases. | COMMENT |
| LOW | src/Phan/Config.php | 261 | COMMENT | |
| 40 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | src/Phan/BlockAnalysisVisitor.php | 3000 | // Definitely defined in try: clear the possibly-undefined flag | COMMENT |
| MEDIUM | src/Phan/Plugin/Internal/MiscParamPlugin.php | 935 | // TODO: Could be more nuanced and account for possibly undefined types in the combination. | COMMENT |
| MEDIUM | src/Phan/Library/IncrementalAnalysis/Manifest.php | 114 | // Use var_export() for faster, more robust serialization | COMMENT |
| MEDIUM | src/Phan/Language/Type/CallableObjectType.php | 64 | // Definitely not possible. | COMMENT |
| MEDIUM | src/Phan/Language/Type/ArrayType.php | 178 | // TODO: More robust handling of non-arrays | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/Phan/Language/EmptyUnionTypeTest.php | 195 | // TODO: Add tests of real union types | COMMENT |
| LOW | tests/files/src/0474_typed_iterable.php | 44 | // TODO: Add tests of casting generators and subclasses of Traversable to iterable (and implement the functionality) | COMMENT |
| LOW⚡ | src/Phan/Analysis/NegatedConditionVisitor.php | 624 | // TODO: implement | COMMENT |
| LOW | src/Phan/Analysis/PostOrderAnalysisVisitor.php | 4839 | // TODO: Add tests of variadic references, fix those if necessary. | COMMENT |
| LOW | src/Phan/Analysis/PostOrderAnalysisVisitor.php | 4951 | // TODO: Add tests of variadic references, fix those if necessary. | COMMENT |
| LOW | src/Phan/AST/TolerantASTConverter/NodeUtils.php | 48 | // TODO: Handle error case (can there be missing parts?) | COMMENT |
| LOW | …Phan/AST/TolerantASTConverter/TolerantASTConverter.php | 3544 | // TODO: Handle error case (can there be missing parts?) | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | src/Phan/ForkPool.php | 141 | // Fork as many times as requested to get the given | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | tests/phantasm_test/test.sh | 18 | # Create a copy so we can verify the copy is changed in place | COMMENT |
| MEDIUM | tests/fixer_test/test.sh | 50 | # Create a copy so we can verify the copy is changed in place | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/real_types_test/src/011_nullsafe_property.php | 4 | public string $street = '123 Main St'; | CODE |
| LOW | tests/plugin_test/src/058_invalid_regex_replacement.php | 12 | echo preg_replace('/missingenddelimiter', 'placeholder', 'fooball'); | CODE |
| LOW | tests/files/src/1092_match.php | 24 | default => "placeholder", | CODE |
| LOW | src/Phan/Language/Internal/ClassDocumentationMap.php | 1008 | *Motivation*: Suppose we need to refer to a document in another collection. The easiest way is to create a field in the | COMMENT |