{{ message }}
Tags: Phauthentic/cognitive-code-analysis
Tags
Adding Analysis Action and Fixes to the Configuration (#72) * Enhance report generation with new CI formats and refactor Markdown handling - Added support for new CI report formats: Checkstyle, JUnit, SARIF, GitLab Code Quality, and GitHub Actions. - Improved HTML and Markdown report generation with a single table configuration option. - Refactored MarkdownReport for better file handling and class section management, enhancing code readability and maintainability. - Updated tests to validate new report formats and configurations. * Update output files to include configuration and cache status - Added configuration file paths and cache status to various output files for improved clarity and debugging. - Updated output formats for all relevant test cases to reflect the new configuration and cache information. * Refactor configuration management and update file references - Replaced instances of `config.yml` with `phpcca.yaml` across the codebase to standardize configuration file usage. - Introduced a new `phpcca.yaml` file containing cognitive metrics configuration settings. - Updated README.md to reflect the new copyright format. - Adjusted GitHub Actions workflow to utilize the new configuration file. * Update configuration file references to phpcca.yaml - Changed all instances of cca.yaml to phpcca.yaml across documentation and codebase for consistency. - Updated README.md, CI-Integration.md, and Configuration.md to reflect the new configuration file name. - Modified InitCommand and related tests to create and reference phpcca.yaml instead of cca.yaml. * Update cognitive metrics configuration in phpcca.yaml - Changed the setting for showOnlyMethodsExceedingThreshold from false to true to enhance cognitive metrics reporting. * Refactor CognitiveMetricsCommandCoverageTest to use a centralized test configuration method - Introduced a private method `withTestConfig` to streamline the execution of tests with a specified configuration file. - Updated all test cases in `CognitiveMetricsCommandCoverageTest` to utilize the new method for improved readability and maintainability.
Increase analysis performance (#46) * Optimizing the AST visitors * Update .gitignore and phpbench.json for benchmark storage configuration - Added benchmarks/storage/ and .phpbench/ to .gitignore - Updated phpbench.json to include XML storage driver and path for benchmark results * Refactor Parser class by removing unused traverseAbstractSyntaxTree method and adding type hint for class-string in clearStaticProperty method * Enhance CognitiveMetrics and Parser classes to improve complexity metrics 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. * Refactor Parser and CombinedMetricsVisitor classes for improved readability 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. * Refactor cyclomatic complexity handling in CognitiveMetrics class - Simplified the instantiation of CyclomaticMetrics to directly accept the complexity data, removing unnecessary conditional checks for array or scalar inputs.
Implementing the Sorting Feature (#42) # New Features Added * Sorting functionality with command-line options --sort-by and --sort-order * 13 sortable fields: score, halstead, cyclomatic, class, method, lineCount, argCount, returnCount, variableCount, propertyCallCount, ifCount, ifNestingLevel, elseCount * Sort orders: ascending (asc) and descending (desc) with asc as default * Grouping by class via new groupByClass configuration option (default: true) * Enhanced filtering with better handling of ignored items and method filtering # New Classes and Components # Configuration Changes * Added groupByClass: true option to config.yml * Updated ConfigFactory and ConfigLoader to support the new option Enhanced CognitiveConfig class with groupByClass property
PreviousNext
