Init config command added to create a default config#70
Merged
Conversation
- Added `InitCommand` to create a default `cca.yaml` configuration file with options for silent and interactive modes. - Introduced `ConfigFileResolver` to handle automatic discovery of configuration files in the working directory. - Updated `ChurnCommandContext` and `CognitiveMetricsCommandContext` to utilize the new configuration file management. - Enhanced documentation in `README.md` and `Configuration.md` to reflect the new configuration setup process. - Added unit tests for the new configuration functionalities and command behaviors.
- Consolidated apt-get commands to reduce image size by cleaning up package lists. - Updated xdebug configuration commands to a single RUN instruction for efficiency. - Changed git configuration to system-wide for better accessibility. - Enhanced user creation command to ensure home directory and permissions are set correctly. - Set the working directory to /app for improved container organization.
- Changed variable name from `$io` to `$style` for clarity and consistency. - Updated all references to the SymfonyStyle instance within the `InitCommand` class. - Improved readability of the code by maintaining a uniform naming convention.
floriankraemer
added a commit
that referenced
this pull request
May 25, 2026
* Add Understandability Metrics and Reporting (#70) This commit introduces a new set of metrics focused on understandability, enhancing the cognitive analysis capabilities. Key changes include: - Added `UnderstandabilityMetrics` and `UnderstandabilityCalculator` for calculating and summarizing understandability metrics. - Integrated understandability metrics into the existing cognitive metrics framework. - Updated configuration options to enable the display of understandability metrics in reports. - Enhanced the reporting system to include understandability in the output format. - Added tests to ensure the correctness of the new understandability features. These changes aim to provide deeper insights into code complexity and maintainability, aligning with modern coding standards. * Enhance understandability metrics handling and improve type validation - Added new methods in `UnderstandabilityMetrics` for resolving risk levels and count values, improving data handling and robustness. - Updated `Parser` class to include understandability metrics in the analysis process. - Enhanced `CombinedMetricsVisitor` with type annotations for the `getMethodUnderstandability` method. - Added suppression warnings in `UnderstandabilityVisitor` for excessive complexity and method count, promoting cleaner code practices. * Add Understandability documentation for Sonar Cognitive Complexity - Introduced a new document, Understandability.md, detailing the Sonar Cognitive Complexity metric. - Explained the calculation method, risk levels, and configuration options for enabling understandability metrics. - Provided references to relevant literature and resources for further reading on cognitive complexity. * Refactor understandability calculations and visitor logic for improved clarity - Updated `UnderstandabilityCalculator` to skip low complexity methods, enhancing risk categorization. - Refined `UnderstandabilityVisitor` logic to return early for ignored classes and non-relevant nodes, improving code readability and maintainability. - Adjusted nesting and logical operator handling to streamline flow and reduce unnecessary checks. * Update cache versioning in CognitiveMetricsCollector and enhance understandability output - Introduced a new constant `CACHE_VERSION` in `CognitiveMetricsCollector` to manage cache versioning effectively. - Updated cache item versioning to use the new constant, ensuring stale entries are ignored when the analysis result shape changes. - Enhanced the understandability output in various test files by updating complexity ratings, improving clarity in metrics reporting.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.