Skip to content

Conversation

@Orrison
Copy link
Owner

@Orrison Orrison commented Dec 31, 2025

Update composer deps, fix some README information, add CyclomaticComplexityRule closing #37, and fix a lot of test file namespaces

@Orrison Orrison requested a review from Copilot December 31, 2025 15:01
@Orrison Orrison self-assigned this Dec 31, 2025
@Orrison Orrison added enhancement New feature or request New Rule A new PHPStan Rule labels Dec 31, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds a new CyclomaticComplexityRule to detect methods with high cyclomatic complexity, updates composer dependencies, fixes README information, and refactors test files to follow PSR-4 standards by splitting multi-class fixture files into separate files with corrected namespaces.

  • Adds comprehensive CyclomaticComplexityRule implementation with configurable thresholds and reporting options
  • Updates all composer dependencies to latest versions
  • Refactors test fixtures across multiple rules to follow PSR-4 (one class per file)
  • Corrects test namespaces and updates test expectations after fixture reorganization

Reviewed changes

Copilot reviewed 74 out of 75 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/Rules/CyclomaticComplexity/CyclomaticComplexityRule.php New rule implementation calculating cyclomatic complexity for methods and classes
src/Rules/CyclomaticComplexity/Config.php Configuration class for complexity thresholds and reporting options
config/extension.neon Adds parameter schema and service registration for CyclomaticComplexity rule
docs/CyclomaticComplexity.md Comprehensive documentation for the new rule with examples
tests/Rules/CyclomaticComplexity/* Test suite with 4 test scenarios covering different configurations
tests/Rules/TooManyMethods/Fixture/* Splits monolithic ExampleClass.php into separate PSR-4 compliant files
tests/Rules/ShortClassName/Fixture/* Splits combined fixture files into individual class files
tests/Rules/LongClassName/Fixture/* Splits interface/trait/enum into separate files
tests/Rules/ConstructorWithNameAsEnclosingClass/Fixture/* Separates classes, traits, and interfaces into individual files
tests/Rules/ConstantNamingConventions/Fixture/* Splits interface and enum into separate files
tests/Rules/BooleanArgumentFlag/Fixture/* Reorganizes fixtures into separate files per class
tests/Rules/BooleanArgumentFlag/config/* Updates ignored class namespaces to match corrected test namespaces
CLAUDE.md Adds PSR-4 fixture file standards documentation
README.md Adds CyclomaticComplexity to rules table, comments out contributing section
composer.json Removes PHP_CS_FIXER_IGNORE_ENV export from cs-fix script
composer.lock Updates all dependency versions to latest compatible releases

@Orrison Orrison merged commit 5c24365 into main Dec 31, 2025
11 checks passed
@Orrison Orrison deleted the rule/CyclomaticComplexity branch December 31, 2025 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request New Rule A new PHPStan Rule

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants