{"id":16173373,"url":"https://github.com/rarst/phpcs-cognitive-complexity","last_synced_at":"2025-08-20T15:05:42.736Z","repository":{"id":36700778,"uuid":"229755879","full_name":"Rarst/phpcs-cognitive-complexity","owner":"Rarst","description":"Cognitive Complexity implementation for PHP_CodeSniffer","archived":false,"fork":false,"pushed_at":"2024-02-24T23:42:49.000Z","size":29,"stargazers_count":28,"open_issues_count":6,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-01T20:19:36.227Z","etag":null,"topics":["php","phpcs","phpcs-standard"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Rarst.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-12-23T13:14:26.000Z","updated_at":"2025-02-05T07:24:22.000Z","dependencies_parsed_at":"2022-09-03T19:10:30.035Z","dependency_job_id":null,"html_url":"https://github.com/Rarst/phpcs-cognitive-complexity","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/Rarst/phpcs-cognitive-complexity","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rarst%2Fphpcs-cognitive-complexity","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rarst%2Fphpcs-cognitive-complexity/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rarst%2Fphpcs-cognitive-complexity/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rarst%2Fphpcs-cognitive-complexity/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Rarst","download_url":"https://codeload.github.com/Rarst/phpcs-cognitive-complexity/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rarst%2Fphpcs-cognitive-complexity/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271337915,"owners_count":24742057,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-20T02:00:09.606Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["php","phpcs","phpcs-standard"],"created_at":"2024-10-10T04:08:32.820Z","updated_at":"2025-08-20T15:05:42.716Z","avatar_url":"https://github.com/Rarst.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PHPCS Cognitive Complexity\n\n_Make it maintainable or else._\n\n[![Tests Status](https://github.com/rarst/phpcs-cognitive-complexity/actions/workflows/tests.yml/badge.svg)](https://github.com/Rarst/phpcs-cognitive-complexity/actions/workflows/tests.yml)\n[![Latest Stable Version](https://img.shields.io/packagist/v/rarst/phpcs-cognitive-complexity.svg?label=version)](https://packagist.org/packages/rarst/phpcs-cognitive-complexity)\n[![PHP from Packagist](https://img.shields.io/packagist/php-v/rarst/phpcs-cognitive-complexity.svg)](https://packagist.org/packages/rarst/phpcs-cognitive-complexity)\n[![PDS Skeleton](https://img.shields.io/badge/pds-skeleton-blue.svg)](https://github.com/php-pds/skeleton)\n\nThe project implements [Cognitive Complexity metric by SonarSource](https://www.sonarsource.com/resources/white-papers/cognitive-complexity.html) as [PHP_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer) standard.\n\n## Install\n\n### Composer\n\n```bash\ncomposer init --no-interaction\ncomposer require rarst/phpcs-cognitive-complexity squizlabs/php_codesniffer dealerdirect/phpcodesniffer-composer-installer\nvendor/bin/phpcs --standard=CognitiveComplexity /path/to/scan\n```\n\n### Standalone\n\n```bash\ngit clone https://github.com/Rarst/phpcs-cognitive-complexity\nphpcs --standard=phpcs-cognitive-complexity/src/CognitiveComplexity /path/to/scan\n```\n\n## Limitations\n\n- detection of boolean operator chains is not perfect, due to complexity of many possible cases.\n\n## Credits\n\nInitial code forked from [Symplify Coding Standard](https://github.com/Symplify/Symplify).\n\n## License\n\nMIT","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frarst%2Fphpcs-cognitive-complexity","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frarst%2Fphpcs-cognitive-complexity","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frarst%2Fphpcs-cognitive-complexity/lists"}