Phan is a static analyzer for PHP. Phan prefers to avoid false-positives and attempts to prove incorrectness rather than correctness.
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.
Use each vector to guide manual verification of the underlying findings.
Can maintainers explain intent, assumptions, and trade-offs? 2082 finding(s).
Are imports declared and package/API names verified? 4 finding(s).
Are wrappers, guards, and repeated structures necessary? 1957 finding(s).
Which changes need focused human review? 2086 finding(s).
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.
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.
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.
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.
| 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 |
| 1897 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 | tool/perf/ab.sh | 1 | #!/usr/bin/env bash | COMMENT |
| LOW | src/Phan/BlockAnalysisVisitor.php | 1721 | // after supporting `BlockAnalysisVisitor->visitBinaryOp()` | COMMENT |
| LOW | src/Phan/BlockAnalysisVisitor.php | 2361 | // if it was possible for it to fall through | COMMENT |
| LOW | src/Phan/BlockAnalysisVisitor.php | 2541 | $child_context = $this->visitStmtList($stmts_node); | 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 |
| 50 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | src/Phan/BlockAnalysisVisitor.php | 3039 | // 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 | 623 | // TODO: implement | COMMENT |
| LOW | src/Phan/Analysis/PostOrderAnalysisVisitor.php | 4849 | // TODO: Add tests of variadic references, fix those if necessary. | COMMENT |
| LOW | src/Phan/Analysis/PostOrderAnalysisVisitor.php | 4961 | // 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 | 154 | // 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 |