A REPL for PHP
This report presents the forensic synthetic code analysis of bobthecow/psysh, a PHP project with 9,832 GitHub stars. SynthScan v2.0 examined 111,936 lines of code across 692 source files, recording 1531 pattern matches distributed across 8 syntactic categories. The overall adjusted score of 14.0 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 1531 distinct pattern matches across 8 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 | test/ShellRuntimeConfigTest.php | 35 | public function testApplyRuntimeConfigChangeUpdatesOutputStateImmediately() | CODE |
| LOW | test/ShellRuntimeConfigTest.php | 57 | public function testApplyRuntimeConfigChangePersistsVerbosityForNextPrompt() | CODE |
| LOW | test/ShellRuntimeConfigTest.php | 99 | public function testApplyRuntimeConfigChangeSwapsPagerImmediately() | CODE |
| LOW | test/ShellRuntimeConfigTest.php | 115 | public function testApplyRuntimeConfigChangeRefreshesInteractiveReadline() | CODE |
| LOW | test/ShellRuntimeConfigTest.php | 154 | public function testUseUnicodeIsReadFromConfigWithoutRestart() | CODE |
| LOW⚡ | test/CodeCleanerResolveClassNameTest.php | 25 | public function testResolveFullyQualifiedName() | CODE |
| LOW⚡ | test/CodeCleanerResolveClassNameTest.php | 31 | public function testResolveWithExplicitUse() | CODE |
| LOW⚡ | test/CodeCleanerResolveClassNameTest.php | 38 | public function testResolveWithImplicitUse() | CODE |
| LOW | test/CodeCleanerResolveClassNameTest.php | 84 | public function testResolveClassNameWhenFunctionImportUsesSameAlias() | CODE |
| LOW | test/ProjectTrustTest.php | 73 | public function testSetModeFromEnvInvalid() | CODE |
| LOW | test/ProjectTrustTest.php | 82 | public function testForceTrustClearsForceUntrust() | CODE |
| LOW | test/ProjectTrustTest.php | 93 | public function testForceUntrustClearsForceTrust() | CODE |
| LOW⚡ | test/ProjectTrustTest.php | 104 | public function testGetProjectTrustStatusForceUntrust() | CODE |
| LOW⚡ | test/ProjectTrustTest.php | 111 | public function testGetProjectTrustStatusNeverMode() | CODE |
| LOW⚡ | test/ProjectTrustTest.php | 118 | public function testGetProjectTrustStatusForceTrust() | CODE |
| LOW⚡ | test/ProjectTrustTest.php | 125 | public function testGetProjectTrustStatusAlwaysMode() | CODE |
| LOW⚡ | test/ProjectTrustTest.php | 132 | public function testGetProjectTrustStatusPromptReturnsNull() | CODE |
| LOW⚡ | test/ProjectTrustTest.php | 138 | public function testIsProjectTrustedWithAlwaysMode() | CODE |
| LOW⚡ | test/ProjectTrustTest.php | 145 | public function testIsProjectTrustedWithNeverMode() | CODE |
| LOW⚡ | test/ProjectTrustTest.php | 152 | public function testIsProjectTrustedWithForceTrust() | CODE |
| LOW⚡ | test/ProjectTrustTest.php | 159 | public function testIsProjectTrustedWithForceUntrust() | CODE |
| LOW | test/ProjectTrustTest.php | 199 | public function testHasComposerAutoloadFiles() | CODE |
| LOW | test/ProjectTrustTest.php | 214 | public function testGetLocalPsyshProjectRoot() | CODE |
| LOW | test/ProjectTrustTest.php | 230 | public function testTrustPersistenceAndRetrieval() | CODE |
| LOW⚡ | test/ProjectTrustTest.php | 265 | public function testShouldPromptForLocalPsyshBinaryDefaultsFalse() | CODE |
| LOW⚡ | test/ProjectTrustTest.php | 274 | public function testShouldPromptForLocalPsyshBinaryUsesServerVar() | CODE |
| LOW⚡ | test/ProjectTrustTest.php | 284 | public function testShouldPromptForLocalPsyshBinaryUsesEnvironmentVar() | CODE |
| LOW⚡ | test/ProjectTrustTest.php | 294 | public function testGetLocalPsyshProjectRootFallsBackToEnvironmentVar() | CODE |
| LOW | test/SystemEnvTest.php | 18 | public function testGetReturnsServerValueWhenSet() | CODE |
| LOW | test/SystemEnvTest.php | 35 | public function testGetReturnsEnvValueWhenServerNotSet() | CODE |
| LOW | test/SystemEnvTest.php | 51 | public function testGetReturnsNullWhenNotSet() | CODE |
| LOW | test/SystemEnvTest.php | 62 | public function testGetPrefersServerOverEnv() | CODE |
| LOW | test/SystemEnvTest.php | 78 | public function testGetIgnoresEmptyServerValue() | CODE |
| LOW | test/ShellTest.php | 83 | public function testUnknownScopeVariablesThrowExceptions() | CODE |
| LOW | test/ShellTest.php | 94 | public function testIncludesWithScopeVariables() | CODE |
| LOW | test/ShellTest.php | 125 | public function testExecuteLoadsIncludesOnlyOnceAcrossNestedExecutions() | CODE |
| LOW | test/ShellTest.php | 150 | public function testRunDoesNotReloadIncludesForNestedCommands() | CODE |
| LOW | test/ShellTest.php | 179 | public function testIncludesLoadOnlyOnceWhenEvaluatedCodeReentersRun() | CODE |
| LOW | test/ShellTest.php | 208 | public function testIncludesContinueAfterThrowable() | CODE |
| LOW | test/ShellTest.php | 259 | public function testIncludesRestoreErrorHandlerAfterFailure() | CODE |
| LOW | test/ShellTest.php | 376 | public function testNonInteractiveDoesNotUpdateContext() | CODE |
| LOW | test/ShellTest.php | 395 | public function testNonInteractiveRawOutput() | CODE |
| LOW | test/ShellTest.php | 465 | public function testAddMatchersViaConfigAfterShell() | CODE |
| LOW | test/ShellTest.php | 477 | public function testReattachingConfigDoesNotReregisterMatchers() | CODE |
| LOW | test/ShellTest.php | 492 | public function testCompletionSourcesViaConfigQueueUntilCompletionEngineInitialization() | CODE |
| LOW | test/ShellTest.php | 644 | public function testLegacyReadlineUsesCompletionEngineThroughAutoCompleter() | CODE |
| LOW | test/ShellTest.php | 734 | public function testBootConfiguresInteractiveReadline() | CODE |
| LOW | test/ShellTest.php | 893 | public function testBootWrapsLegacyReadlineInLegacyShim() | CODE |
| LOW | test/ShellTest.php | 999 | public function testFormatExceptionStripsExecutionClosurePathsWithDotsInPath() | CODE |
| LOW | test/ShellTest.php | 1016 | public function testGetInputMarksOutputWrittenForCommandOutput() | CODE |
| LOW | test/ShellTest.php | 1043 | public function testGetInputLeavesOutputWrittenFalseWhenCommandDoesNotWriteOutput() | CODE |
| LOW | test/ShellTest.php | 1068 | public function testLegacyReadlineAddsSpacerAfterInputBeforeReturnValueInNonCompactMode() | CODE |
| LOW | test/ShellTest.php | 1088 | public function testLegacyReadlineAddsSpacerAroundCommandOutputInNonCompactMode() | CODE |
| LOW | test/ShellTest.php | 1118 | public function testLegacyReadlineDoesNotAddExtraSpacerBeforeReturnValueInCompactMode() | CODE |
| LOW | test/ShellTest.php | 1138 | public function testGetInputMarksOutputWrittenForShellOutputEvenWhenStreamPositionDoesNotAdvance() | CODE |
| LOW | test/ShellTest.php | 1159 | public function testGetInputMarksOutputWrittenForShellOutputErrorStreamWrites() | CODE |
| LOW | test/ShellTest.php | 1184 | public function testGetInputIgnoresSuppressedShellOutputWrites() | CODE |
| LOW | test/ShellTest.php | 1205 | public function testGetInputMarksOutputWrittenForDirectShellOutputStreamWrites() | CODE |
| LOW | test/ShellTest.php | 1230 | public function testShellOutputTracksVisibleWrites() | CODE |
| LOW | test/ShellTest.php | 1240 | public function testShellOutputWriteListenerIsNoOpForBackwardsCompatibility() | CODE |
| 1454 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | test/smoketest-pty.sh | 3 | # This file is part of Psy Shell. | COMMENT |
| MEDIUM | test/test-env.sh | 3 | # This file is part of Psy Shell. | COMMENT |
| MEDIUM | test/smoketest.sh | 3 | # This file is part of Psy Shell. | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | .phan/config.php | 21 | 'vendor/symfony/var-dumper/', | COMMENT |
| LOW | .phan/baseline-current-issues.php | 21 | // PhanDeprecatedFunction : 5 occurrences | COMMENT |
| LOW | test/smoketest-pty.sh | 1 | #!/usr/bin/env bash | COMMENT |
| LOW | test/smoketest.sh | 1 | #!/bin/bash | COMMENT |
| LOW | test/smoketest.sh | 21 | # test/smoketest.sh path/to/psysh.phar # Test a specific PHAR | COMMENT |
| LOW | …xtures/autoload-warmer-vendor/composer/ClassLoader.php | 21 | COMMENT | |
| LOW | src/Output/OutputPager.php | 21 | { | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | test/smoketest-pty.sh | 18 | # Usage: | COMMENT |
| LOW | test/smoketest.sh | 17 | # Usage: | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | test/Fixtures/Completion/Address.php | 16 | public string $street = '123 Main St'; | CODE |
| LOW | test/Fixtures/Completion/User.php | 30 | return 'John Doe'; | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | test/smoketest.sh | 383 | # Check if the target exists (resolve relative paths first) | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | src/CodeCleaner/PassableByReferencePass.php | 69 | // Named arguments were added in php-parser 4.1, so we need to check if the property exists | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | test/tools/vis.py | 44 | __all__ = [ | CODE |