Skip to content

Conversation

@floriankraemer
Copy link
Contributor

@floriankraemer floriankraemer commented Sep 24, 2025

The performance is low if there are lots of files (1000+), this is an attempt to improve this and it looks like it is working.

- Added benchmarks/storage/ and .phpbench/ to .gitignore
- Updated phpbench.json to include XML storage driver and path for benchmark results
…ethod and adding type hint for class-string in clearStaticProperty method
…rics handling

- Updated CognitiveMetrics to handle both array and scalar inputs for cyclomatic complexity.
- Refactored Parser to integrate cyclomatic complexity and Halstead metrics into method metrics.
- Removed unused methods for cyclomatic complexity and Halstead metrics from Parser.
- Added a new method to calculate risk levels based on cyclomatic complexity.
…bility and maintainability

- Changed the instantiation of ReflectionClass in Parser to use a direct import for clarity.
- Added suppress warnings annotations for unused parameters in beforeTraverse and afterTraverse methods of CombinedMetricsVisitor.
@floriankraemer floriankraemer changed the title Visitor performance Increase analysis performance Sep 24, 2025
- Simplified the instantiation of CyclomaticMetrics to directly accept the complexity data, removing unnecessary conditional checks for array or scalar inputs.
@floriankraemer floriankraemer merged commit 11597c3 into master Sep 24, 2025
4 checks passed
@floriankraemer floriankraemer deleted the visitor-performance branch September 24, 2025 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants