Repository Analysis

yiisoft/yii2

Yii 2: The Fast, Secure and Professional PHP Framework

3.1 Likely human-written View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of yiisoft/yii2, a PHP project with 14,300 GitHub stars. SynthScan v2.0 examined 427,301 lines of code across 1933 source files, recording 1280 pattern matches distributed across 4 syntactic categories. The overall adjusted score of 3.1 places this repository in the Likely human-written 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).

3.1
Adjusted Score
3.1
Raw Score
100%
Time Factor
2026-07-13
Last Push
14.3K
Stars
PHP
Language
427.3K
Lines of Code
1.9K
Files
1.3K
Pattern Hits
2026-07-14
Scan Date
0.00
HC Hit Rate

What These Metrics Mean

Adjusted Score
Primary synthetic code indicator. Raw score normalised per 1,000 lines of code and multiplied by the temporal discount factor. This is the definitive comparative metric — use it to rank repositories by AI authorship density.
Raw Score
The unmodified sum of all severity-weighted, context-multiplied pattern match scores before temporal discounting. Reflects the absolute signal strength independent of when the repository was last active.
Time Factor
The temporal discount multiplier (0–100%) applied to the raw score. Repositories last updated before ChatGPT's launch (Nov 2022) receive a 5% factor. Full signal is only assigned to repositories active in the post-adoption era (Jan 2024+).
Pattern Hits
Total count of individual pattern matches across all files and categories. A high hit count with a low score may indicate a very large codebase with isolated AI snippets; a low count with a high score indicates dense, concentrated AI signatures.
HC Hit Rate
High+Critical pattern hits per file, averaged across the repository. This orthogonal signal catches repositories where a few files are densely packed with high-severity AI tells — a strong indicator even when the normalised score appears moderate due to codebase size.
Lines of Code / Files
Total lines and files analysed. The scanner examines 94 file extensions. These denominators are used to normalise the score, enabling fair comparison between repositories of vastly different sizes.

Score History

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.

Severity Breakdown

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.

CRITICAL 0HIGH 0MEDIUM 1LOW 1279

Directory Score Breakdown

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.

Pattern Findings

The scanner identified 1280 distinct pattern matches across 4 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.

Hyper-Verbose Identifiers1174 hits · 1205 pts
SeverityFileLineSnippetContext
LOWframework/UPGRADE.md1165 `public static function findIdentityByAccessToken($token, $type = null)`. The new `$type` parameterCODE
LOWframework/filters/PageCache.php283 private function insertResponseCookieCollectionIntoData(Response $response, array &$data)CODE
LOWframework/filters/PageCache.php307 private function insertResponseHeaderCollectionIntoData(Response $response, array &$data)CODE
LOWframework/rbac/DbManager.php579 protected function getDirectPermissionsByUser($userId)CODE
LOWframework/rbac/DbManager.php603 protected function getInheritedPermissionsByUser($userId)CODE
LOWframework/rbac/PhpManager.php491 protected function getDirectPermissionsByUser($userId)CODE
LOWframework/rbac/PhpManager.php511 protected function getInheritedPermissionsByUser($userId)CODE
LOWframework/di/Container.php660 public function resolveCallableDependencies(callable $callback, $params = [])CODE
LOWframework/web/Controller.php208 private function filterSingleTypeActionParam($param, $type)CODE
LOWframework/web/Controller.php253 private function filterUnionTypeActionParam($param, $type)CODE
LOWframework/web/Response.php825 protected function getDispositionHeaderValue($disposition, $attachmentName)CODE
LOWframework/web/Session.php520 public function getUseTransparentSessionID()CODE
LOWframework/web/Session.php531 public function setUseTransparentSessionID($value)CODE
LOWframework/web/User.php593 protected function getIdentityAndDurationFromCookie()CODE
LOWframework/web/IdentityInterface.php25 * public static function findIdentityByAccessToken($token, $type = null)COMMENT
LOWframework/web/IdentityInterface.php77 public static function findIdentityByAccessToken($token, $type = null);CODE
LOWframework/web/UrlRule.php577 protected function substitutePlaceholderNames(array $matches)CODE
LOWframework/web/Request.php1507 public function getAcceptableContentTypes()CODE
LOWframework/web/Request.php1528 public function setAcceptableContentTypes($value)CODE
LOWframework/web/Request.php1921 private function validateCsrfTokenInternal($clientSuppliedToken, $trueToken)CODE
LOWframework/web/Request.php1941 protected function getSecureForwardedHeaderTrustedPart($token)CODE
LOWframework/web/Request.php1963 protected function getSecureForwardedHeaderTrustedParts()CODE
LOWframework/web/Request.php1998 protected function getSecureForwardedHeaderParts()CODE
LOWframework/web/ErrorHandler.php442 public function createServerInformationLink()CODE
LOWframework/web/ErrorHandler.php470 public function createFrameworkVersionLink()CODE
LOWframework/behaviors/CacheableWidgetBehavior.php189 private function getFragmentCacheConfiguration()CODE
LOWframework/behaviors/AttributeTypecastBehavior.php197 public static function clearAutoDetectedAttributeTypes()CODE
LOWframework/db/Connection.php843 private function rollbackTransactionOnLevel($transaction, $level)CODE
LOWframework/db/Connection.php905 private function restoreQueryBuilderConfiguration()CODE
LOWframework/db/Command.php1243 protected function requireTableSchemaRefresh($name)CODE
LOWframework/db/Schema.php332 public function createColumnSchemaBuilder($type, $length = null)CODE
LOWframework/db/Schema.php419 public function setTransactionIsolationLevel($level)CODE
LOWframework/db/Schema.php833 private function loadTableMetadataFromCache($cache, $name)CODE
LOWframework/db/Query.php759 protected function getUnaliasedColumnsFromSelect()CODE
LOWframework/db/QueryBuilder.php168 protected function defaultExpressionBuilders()CODE
LOWframework/db/QueryBuilder.php411 protected function prepareInsertSelectSubQuery($columns, $schema, $params = [])CODE
LOWframework/db/QueryBuilder.php576 private function getTableUniqueColumnNames($name, $columns, &$constraints = [])CODE
LOWframework/db/oci/Schema.php277 public function createColumnSchemaBuilder($type, $length = null)CODE
LOWframework/db/oci/QueryBuilder.php58 protected function defaultExpressionBuilders()CODE
LOWframework/db/sqlite/Schema.php222 public function createColumnSchemaBuilder($type, $length = null)CODE
LOWframework/db/sqlite/Schema.php373 public function setTransactionIsolationLevel($level)CODE
LOWframework/db/sqlite/QueryBuilder.php58 protected function defaultExpressionBuilders()CODE
LOWframework/db/sqlite/conditions/InConditionBuilder.php38 protected function buildCompositeInCondition($operator, $columns, $values, &$params)CODE
LOWframework/db/cubrid/Schema.php358 public function setTransactionIsolationLevel($level)CODE
LOWframework/db/cubrid/Schema.php381 public function createColumnSchemaBuilder($type, $length = null)CODE
LOWframework/db/cubrid/QueryBuilder.php55 protected function defaultExpressionBuilders()CODE
LOWframework/db/mysql/Schema.php525 public function createColumnSchemaBuilder($type, $length = null)CODE
LOWframework/db/mysql/QueryBuilder.php65 protected function defaultExpressionBuilders()CODE
LOWframework/db/mysql/QueryBuilder.php389 private function supportsFractionalSeconds()CODE
LOWframework/db/conditions/InConditionBuilder.php198 protected function buildCompositeInCondition($operator, $columns, $values, &$params)CODE
LOWframework/db/conditions/InConditionBuilder.php253 protected function getRawValuesFromTraversableObject(\Traversable $traversableObject)CODE
LOWframework/db/pgsql/Schema.php403 protected function getUniqueIndexInformation($table)CODE
LOWframework/db/pgsql/QueryBuilder.php96 protected function defaultExpressionBuilders()CODE
LOWframework/db/mssql/Schema.php827 public function createColumnSchemaBuilder($type, $length = null)CODE
LOWframework/db/mssql/QueryBuilder.php56 protected function defaultExpressionBuilders()CODE
LOWframework/db/mssql/conditions/InConditionBuilder.php38 protected function buildCompositeInCondition($operator, $columns, $values, &$params)CODE
LOWframework/log/Dispatcher.php218 protected function generateTargetFailErrorMessage($target, $throwable, $method)CODE
LOWframework/validators/ExistValidator.php123 private function checkTargetRelationExistence($model, $attribute)CODE
LOWframework/validators/ExistValidator.php155 private function checkTargetAttributeExistence($model, $attribute)CODE
LOWframework/i18n/Formatter.php1849 private function setFormatterTextAttribute($formatter, $attribute, $value, $source, $alternative)CODE
1114 more matches not shown…
Fake / Example Data92 hits · 111 pts
SeverityFileLineSnippetContext
LOWframework/db/sqlite/Command.php108 $phName = ltrim($match['placeholder'], ':');CODE
LOWframework/log/Dispatcher.php39 * 'to' => 'admin@example.com',COMMENT
LOWframework/helpers/BaseConsole.php745 * The first line will **not** be indented, so `Console::wrapText("Lorem ipsum dolor sit amet.", 4)` will result in COMMENT
LOWframework/helpers/BaseConsole.php745 * The first line will **not** be indented, so `Console::wrapText("Lorem ipsum dolor sit amet.", 4)` will result in COMMENT
LOWframework/helpers/BaseConsole.php749 * Lorem ipsumCOMMENT
LOWframework/helpers/BaseHtml.php1460 if (isset($options['placeholder']) && $options['placeholder'] === true) {CODE
LOWframework/helpers/BaseHtml.php1462 $options['placeholder'] = $model->getAttributeLabel($attribute);CODE
LOWtests/framework/mail/BaseMailerTest.php242<p>Test Lorem ipsum...</p>CODE
LOWtests/framework/mail/BaseMailerTest.php252Test Lorem ipsum...CODE
LOWtests/framework/web/UrlManagerCreateUrlTest.php753 $this->assertEquals('/user/show?name=John+Doe', $manager->createUrl(['user/show', 'name' => 'John Doe']));CODE
LOWtests/framework/web/UrlManagerCreateUrlTest.php765 $this->assertEquals('/user/profile?name=John+Doe', $manager->createUrl(['user/profile', 'name' => 'John Doe']));CODE
LOWtests/framework/web/UrlManagerCreateUrlTest.php795 $this->assertEquals('/user/show?name=John+Doe', $manager->createUrl(['user/show', 'name' => 'John Doe']));CODE
LOWtests/framework/behaviors/AttributeBehaviorTest.php73 'John Doe',CODE
LOWtests/framework/behaviors/AttributeBehaviorTest.php75 'John Doe',CODE
LOWtests/framework/behaviors/AttributeBehaviorTest.php79 'John Doe',CODE
LOWtests/framework/behaviors/AttributeBehaviorTest.php81 'John Doe',CODE
LOWtests/framework/behaviors/AttributeBehaviorTest.php85 'John Doe',CODE
LOWtests/framework/behaviors/AttributeBehaviorTest.php87 'John Doe',CODE
LOWtests/framework/behaviors/AttributeBehaviorTest.php93 'John Doe',CODE
LOWtests/framework/behaviors/AttributesBehaviorTest.php73 'John Doe',CODE
LOWtests/framework/behaviors/AttributesBehaviorTest.php75 'John Doe',CODE
LOWtests/framework/behaviors/AttributesBehaviorTest.php79 'John Doe',CODE
LOWtests/framework/behaviors/AttributesBehaviorTest.php81 'John Doe',CODE
LOWtests/framework/behaviors/AttributesBehaviorTest.php85 'John Doe',CODE
LOWtests/framework/behaviors/AttributesBehaviorTest.php87 'John Doe',CODE
LOWtests/framework/behaviors/AttributesBehaviorTest.php93 'John Doe',CODE
LOWtests/framework/behaviors/AttributesBehaviorTest.php131 'John Doe', // nameCODE
LOWtests/framework/behaviors/AttributesBehaviorTest.php135 'John Doe',CODE
LOWtests/framework/behaviors/AttributesBehaviorTest.php138 'John Doe', // nameCODE
LOWtests/framework/db/QueryTest.php486 $query->andFilterCompare('name', 'John Doe');CODE
LOWtests/framework/db/QueryTest.php487 $condition = ['=', 'name', 'John Doe'];CODE
LOWtests/framework/db/ActiveRecordTest.php1150 $this->assertEquals('John Doe', $dossier->employee->fullName);CODE
LOWtests/framework/helpers/HtmlTest.php2189 $html = Html::activeTextInput($model, 'name', ['placeholder' => true]);CODE
LOWtests/framework/helpers/HtmlTest.php2198 $html = Html::activeTextInput($model, 'name', ['placeholder' => 'Custom placeholder']);CODE
LOWtests/framework/helpers/HtmlTest.php2207 $html = Html::activeTextInput($model, '[0]name', ['placeholder' => true]);CODE
LOWtests/framework/helpers/HtmlTest.php2216 $html = MyHtml::activeTextInput($model, 'name', ['placeholder' => true]);CODE
LOWtests/framework/helpers/StringHelperTest.php140 $this->assertEquals('lorem ipsum', StringHelper::truncateWords('lorem ipsum', 3, '...', true));CODE
LOWtests/framework/helpers/StringHelperTest.php141 $this->assertEquals(' lorem ipsum', StringHelper::truncateWords(' lorem ipsum', 3, '...', true));CODE
LOWtests/framework/base/ArrayableTraitTest.php82 $this->assertSame('John Doe', $result['fullName']);CODE
LOWtests/framework/base/ArrayableTraitTest.php316 $model->email = 'test@test.com';CODE
LOWtests/framework/base/ArrayableTraitTest.php320 $this->assertSame('test@test.com', $result['email']);CODE
LOWtests/framework/base/ArrayableTraitTest.php327 $item->email = 'test@test.com';CODE
LOWtests/framework/widgets/ActiveFieldTest.php680 'options' => ['placeholder' => 'pholder_direct'],CODE
LOWtests/framework/widgets/ActiveFieldTest.php686 'options' => ['placeholder' => 'pholder_direct'],CODE
LOWtests/framework/widgets/ActiveFieldTest.php692 $this->activeField->inputOptions = ['placeholder' => 'pholder_input'];CODE
LOWtests/framework/widgets/ActiveFieldTest.php699 $this->activeField->inputOptions = ['placeholder' => 'pholder_both_input'];CODE
LOWtests/framework/widgets/ActiveFieldTest.php702 'options' => ['placeholder' => 'pholder_both_direct']CODE
LOWdocs/documentation_style_guide.md82 "Jane Doe",CODE
LOWdocs/documentation_style_guide.md83 "John Doe"CODE
LOWdocs/guide/rest-resources.md193 "email": "user@example.com",CODE
LOWdocs/guide/runtime-logging.md88 'to' => ['admin@example.com', 'developer@example.com'],CODE
LOWdocs/guide/db-query-builder.md425$query->andFilterCompare('name', 'John Doe');CODE
LOWdocs/guide/rest-quick-start.md167 -d '{"username": "example", "email": "user@example.com"}'CODE
LOWdocs/guide/rest-quick-start.md175{"id":1,"username":"example","email":"user@example.com","created_at":1414674789,"updated_at":1414674789}CODE
LOWdocs/guide/helper-html.md389<?= Html::mailto('Contact us', 'admin@example.com') ?>CODE
LOWdocs/guide/helper-array.md380 'admin' => 'admin@example.com',CODE
LOWdocs/guide/helper-array.md417 'admin' => 'admin@example.com',CODE
LOWdocs/guide-ja/rest-resources.md193 "email": "user@example.com",CODE
LOWdocs/guide-ja/runtime-logging.md88 'to' => ['admin@example.com', 'developer@example.com'],CODE
LOWdocs/guide-ja/db-query-builder.md425$query->andFilterCompare('name', 'John Doe');CODE
32 more matches not shown…
Over-Commented Block13 hits · 13 pts
SeverityFileLineSnippetContext
LOWframework/messages/config.php21 ],COMMENT
LOWframework/views/messageConfig.php21 // messages will be separated from the old (translated) ones.COMMENT
LOWtests/framework/db/QueryBuilderTest.php241 //[COMMENT
LOWtests/framework/db/QueryBuilderTest.php861 'cubrid' => 'varchar',COMMENT
LOWtests/data/web/assetSources/js/jquery.js1// Let's imagine this is a jQuery plugin :)COMMENT
LOWdocs/guide/helper-array.md261 ['id' => '124', 'name' => 'bbb', 'class' => 'x'],COMMENT
LOWdocs/guide/helper-array.md581// 'a.b' => 'string',COMMENT
LOWdocs/guide-ja/helper-array.md261 ['id' => '124', 'name' => 'bbb', 'class' => 'x'],COMMENT
LOWdocs/guide-ru/helper-array.md201// ]COMMENT
LOWdocs/guide-ru/helper-array.md441];COMMENT
LOWdocs/guide-fr/helper-array.md201// le résultat est :COMMENT
LOWdocs/guide-es/helper-array.md221COMMENT
LOWdocs/guide-zh-CN/helper-array.md261 ['id' => '124', 'name' => 'bbb', 'class' => 'x'],COMMENT
Slop Phrases1 hit · 3 pts
SeverityFileLineSnippetContext
MEDIUMframework/data/ActiveDataFilter.php57 * used in [[\yii\db\QueryInterface::where()]]. However, you may want to adjust it in some special cases.COMMENT