A REPL for PHP
This report presents the forensic synthetic code analysis of bobthecow/psysh, a PHP project with 9,831 GitHub stars. SynthScan v2.0 examined 110,395 lines of code across 686 source files, recording 1501 pattern matches distributed across 8 syntactic categories. The overall adjusted score of 13.9 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).
Longitudinal tracking requires multiple scan runs. Once this repository is re-scanned after new commits land, this chart will visualise how the synthetic code signal evolves over time — enabling you to detect whether AI authorship is growing, stabilising, or being actively corrected by human engineers.
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 1501 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 | 189 | public function testNonInteractiveDoesNotUpdateContext() | CODE |
| LOW | test/ShellTest.php | 208 | public function testNonInteractiveRawOutput() | CODE |
| LOW | test/ShellTest.php | 278 | public function testAddMatchersViaConfigAfterShell() | CODE |
| LOW | test/ShellTest.php | 290 | public function testReattachingConfigDoesNotReregisterMatchers() | CODE |
| LOW | test/ShellTest.php | 305 | public function testCompletionSourcesViaConfigQueueUntilCompletionEngineInitialization() | CODE |
| LOW | test/ShellTest.php | 457 | public function testLegacyReadlineUsesCompletionEngineThroughAutoCompleter() | CODE |
| LOW | test/ShellTest.php | 547 | public function testBootConfiguresInteractiveReadline() | CODE |
| LOW | test/ShellTest.php | 706 | public function testBootWrapsLegacyReadlineInLegacyShim() | CODE |
| LOW | test/ShellTest.php | 812 | public function testFormatExceptionStripsExecutionClosurePathsWithDotsInPath() | CODE |
| LOW | test/ShellTest.php | 829 | public function testGetInputMarksOutputWrittenForCommandOutput() | CODE |
| LOW | test/ShellTest.php | 856 | public function testGetInputLeavesOutputWrittenFalseWhenCommandDoesNotWriteOutput() | CODE |
| LOW | test/ShellTest.php | 881 | public function testLegacyReadlineAddsSpacerAfterInputBeforeReturnValueInNonCompactMode() | CODE |
| LOW | test/ShellTest.php | 901 | public function testLegacyReadlineAddsSpacerAroundCommandOutputInNonCompactMode() | CODE |
| LOW | test/ShellTest.php | 931 | public function testLegacyReadlineDoesNotAddExtraSpacerBeforeReturnValueInCompactMode() | CODE |
| LOW | test/ShellTest.php | 951 | public function testGetInputMarksOutputWrittenForShellOutputEvenWhenStreamPositionDoesNotAdvance() | CODE |
| LOW | test/ShellTest.php | 972 | public function testGetInputMarksOutputWrittenForShellOutputErrorStreamWrites() | CODE |
| LOW | test/ShellTest.php | 997 | public function testGetInputIgnoresSuppressedShellOutputWrites() | CODE |
| LOW | test/ShellTest.php | 1018 | public function testGetInputMarksOutputWrittenForDirectShellOutputStreamWrites() | CODE |
| LOW | test/ShellTest.php | 1043 | public function testShellOutputTracksVisibleWrites() | CODE |
| LOW | test/ShellTest.php | 1053 | public function testShellOutputWriteListenerIsNoOpForBackwardsCompatibility() | CODE |
| LOW | test/ShellTest.php | 1071 | public function testGetInputContinuesReadingAfterInteractiveCommand() | CODE |
| LOW | test/ShellTest.php | 1097 | public function testGetInputReturnsAfterInteractiveCommandQueuesCode() | CODE |
| LOW | test/ShellTest.php | 1119 | public function testGetInputKeepsThrowUpInsideLegacyContinuationBuffer() | CODE |
| LOW | test/ShellTest.php | 1139 | public function testGetInputDoesNotDispatchQueuedCommandsInsideOpenStrings() | CODE |
| LOW | test/ShellTest.php | 1279 | public function testCodeBufferThrowsParseExceptions() | CODE |
| 1424 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 |