A PHP client library for accessing Google APIs
This report presents the forensic synthetic code analysis of googleapis/google-api-php-client, a PHP project with 9,798 GitHub stars. SynthScan v2.0 examined 13,537 lines of code across 92 source files, recording 102 pattern matches distributed across 5 syntactic categories. The overall adjusted score of 8.1 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 102 distinct pattern matches across 5 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 | tests/BaseTest.php | 156 | protected function checkServiceAccountCredentials() | CODE |
| LOW | tests/Google/ModelTest.php | 170 | public function testCollectionWithItemsFromConstructor() | CODE |
| LOW | tests/Google/ModelTest.php | 197 | public function testCollectionWithItemsFromSetter() | CODE |
| LOW | tests/Google/ModelTest.php | 244 | public function testPassingInstanceInConstructor() | CODE |
| LOW | tests/Google/ModelTest.php | 256 | public function testPassingInstanceInConstructorForMap() | CODE |
| LOW | tests/Google/ModelTest.php | 279 | public function testKeyTypePropertyConflict() | CODE |
| LOW | tests/Google/ClientTest.php | 261 | public function testDefaultLoggerAppEngine() | CODE |
| LOW | tests/Google/ClientTest.php | 273 | public function testLoggerFromConstructor() | CODE |
| LOW | tests/Google/ClientTest.php | 312 | public function testSetAccessTokenValidation() | CODE |
| LOW | tests/Google/ClientTest.php | 392 | public function testApplicationDefaultCredentials() | CODE |
| LOW | tests/Google/ClientTest.php | 407 | public function testApplicationDefaultCredentialsWithSubject() | CODE |
| LOW | tests/Google/ClientTest.php | 427 | public function testRefreshTokenSetsValues() | CODE |
| LOW | tests/Google/ClientTest.php | 462 | public function testRefreshTokenIsSetOnRefresh() | CODE |
| LOW | tests/Google/ClientTest.php | 498 | public function testRefreshTokenIsNotSetWhenNewRefreshTokenIsReturned() | CODE |
| LOW | tests/Google/ClientTest.php | 535 | public function testFetchAccessTokenWithAssertionFromEnv() | CODE |
| LOW | tests/Google/ClientTest.php | 551 | public function testFetchAccessTokenWithAssertionFromFile() | CODE |
| LOW | tests/Google/ClientTest.php | 567 | public function testFetchAccessTokenWithAssertionAddsCreated() | CODE |
| LOW | tests/Google/ClientTest.php | 583 | public function testBadSubjectThrowsException() | CODE |
| LOW | tests/Google/ClientTest.php | 691 | public function testOnGceCacheAndCacheOptions() | CODE |
| LOW | tests/Google/ClientTest.php | 732 | public function testFetchAccessTokenWithAssertionCache() | CODE |
| LOW | tests/Google/ClientTest.php | 789 | public function testExecuteSetsCorrectHeaders() | CODE |
| LOW | tests/Google/ClientTest.php | 873 | public function testCredentialsOptionWithFetchAuthTokenInterface() | CODE |
| LOW | tests/Google/ClientTest.php | 938 | public function testQueryParamsForAuthUrl() | CODE |
| LOW | tests/Google/ClientTest.php | 947 | public function testUniverseDomainMismatch() | CODE |
| LOW | tests/Google/AccessToken/VerifyTest.php | 73 | public function testLeewayIsUnchangedWhenPassingInJwt() | CODE |
| LOW | tests/Google/AuthHandler/AuthHandlerTest.php | 33 | public function testSetAccessTokenResultsInAuthCacheMiss() | CODE |
| LOW | tests/Google/Http/MediaFileUploadTest.php | 138 | public function testGetResumeUriUsesStringHeaderValues() | CODE |
| LOW | tests/Google/Http/MediaFileUploadTest.php | 192 | public function testNextChunkWithMoreRemaining() | CODE |
| LOW | tests/Google/Task/ComposerTest.php | 54 | public function testRelatePathServiceName() | CODE |
| LOW⚡ | tests/Google/Task/RunnerTest.php | 49 | public function testRestRetryOffByDefault($errorCode, $errorBody = '{}') | CODE |
| LOW⚡ | tests/Google/Task/RunnerTest.php | 58 | public function testOneRestRetryWithError($errorCode, $errorBody = '{}') | CODE |
| LOW⚡ | tests/Google/Task/RunnerTest.php | 68 | public function testMultipleRestRetriesWithErrors( | CODE |
| LOW⚡ | tests/Google/Task/RunnerTest.php | 326 | public function testTaskRetryOffByDefault() | CODE |
| LOW⚡ | tests/Google/Task/RunnerTest.php | 334 | public function testOneTaskRetryWithError() | CODE |
| LOW⚡ | tests/Google/Task/RunnerTest.php | 343 | public function testMultipleTaskRetriesWithErrors() | CODE |
| LOW⚡ | tests/Google/Task/RunnerTest.php | 352 | public function testOneTaskRetryWithSuccess() | CODE |
| LOW⚡ | tests/Google/Task/RunnerTest.php | 362 | public function testMultipleTaskRetriesWithSuccess() | CODE |
| LOW | tests/Google/Task/RunnerTest.php | 81 | public function testOneRestRetryWithSuccess($errorCode, $errorBody = '{}') | CODE |
| LOW | tests/Google/Task/RunnerTest.php | 94 | public function testMultipleRestRetriesWithSuccess( | CODE |
| LOW | tests/Google/Task/RunnerTest.php | 109 | public function testCustomRestRetryMapReplacesDefaults( | CODE |
| LOW | tests/Google/Task/RunnerTest.php | 121 | public function testCustomRestRetryMapAddsNewHandlers() | CODE |
| LOW | tests/Google/Task/RunnerTest.php | 138 | public function testCustomRestRetryMapWithCustomLimits($limit) | CODE |
| LOW | tests/Google/Task/RunnerTest.php | 170 | public function testCurlRetryOffByDefault($errorCode, $errorMessage = '') | CODE |
| LOW | tests/Google/Task/RunnerTest.php | 181 | public function testOneCurlRetryWithError($errorCode, $errorMessage = '') | CODE |
| LOW | tests/Google/Task/RunnerTest.php | 193 | public function testMultipleCurlRetriesWithErrors( | CODE |
| LOW | tests/Google/Task/RunnerTest.php | 207 | public function testOneCurlRetryWithSuccess($errorCode, $errorMessage = '') | CODE |
| LOW | tests/Google/Task/RunnerTest.php | 221 | public function testMultipleCurlRetriesWithSuccess( | CODE |
| LOW | tests/Google/Task/RunnerTest.php | 237 | public function testCustomCurlRetryMapReplacesDefaults( | CODE |
| LOW | tests/Google/Task/RunnerTest.php | 252 | public function testCustomCurlRetryMapAddsNewHandlers() | CODE |
| LOW | tests/Google/Task/RunnerTest.php | 270 | public function testCustomCurlRetryMapWithCustomLimits($limit) | CODE |
| LOW | tests/Google/Task/RunnerTest.php | 375 | public function testTaskRetryWithCustomLimits($limit) | CODE |
| LOW | tests/Google/Task/RunnerTest.php | 400 | public function testTaskWithManualRetries() | CODE |
| LOW | tests/Google/Task/RunnerTest.php | 513 | public static function assertTaskTimeGreaterThanOrEqual( | CODE |
| LOW | tests/Google/Task/RunnerTest.php | 695 | private function setNextTaskAllowedRetries($allowedRetries) | CODE |
| LOW | tests/Google/Task/RunnerTest.php | 709 | private function setNextTasksAllowedRetries($count, $allowedRetries) | CODE |
| LOW | tests/Google/Service/AdSenseTest.php | 56 | public function testAccountsReportGenerate() | CODE |
| LOW | tests/Google/Service/AdSenseTest.php | 75 | public function testAccountsAdClientsList() | CODE |
| LOW | tests/Google/Service/AdSenseTest.php | 131 | public function testAccountsCustomChannelsList() | CODE |
| LOW | tests/Google/Service/AdSenseTest.php | 149 | public function testAccountsCustomChannelsGet() | CODE |
| LOW | tests/Google/Service/AdSenseTest.php | 174 | public function testAccountsUrlChannelsList() | CODE |
| 32 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | docs/oauth-web.md | 72 | ### Step 1: Set authorization parameters | COMMENT |
| LOW | docs/oauth-web.md | 198 | ### Step 2: Redirect to Google's OAuth 2.0 server | COMMENT |
| LOW | docs/oauth-web.md | 216 | ### Step 3: Google prompts user for consent | COMMENT |
| LOW | docs/oauth-web.md | 222 | ### Step 4: Handle the OAuth 2.0 server response | COMMENT |
| LOW | docs/oauth-web.md | 257 | ### Step 5: Exchange authorization code for refresh and access tokens | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | README.md | 258 | POST https://datastore.googleapis.com/v1beta3/projects/YOUR_PROJECT_ID:runQuery?key=YOUR_API_KEY | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | UPGRADING.md | 173 | $user_to_impersonate = 'user@example.org'; | CODE |
| LOW | UPGRADING.md | 187 | $user_to_impersonate = 'user@example.org'; | CODE |
| LOW | tests/Google/ClientTest.php | 143 | $client->setLoginHint('bob@example.org'); | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | UPGRADING.md | 101 | COMMENT |