Add rule-based false positive report with enhanced analytics#2
Merged
Merged
Conversation
This commit enhances the SonarQube false positive reporter to include: - Quality gate used by each project - Quality profiles containing the rules that generated false positive issues New API methods added: - get_project_quality_gate(): Fetches the quality gate for a project - get_quality_profiles_for_project(): Retrieves all quality profiles associated with a project The CSV output now includes two additional columns: - Quality Gate: The name of the quality gate assigned to the project - Quality Profiles: A semicolon-separated list of language:profile pairs Updated README with the new features and sample output. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Add new CSV report showing false positives aggregated by rule - Include rule severity and software qualities in rule report - Add percentage column to project report showing FP ratio - Fetch all issues across projects for comprehensive rule analysis - Remove quality gate and quality profiles from project report - Update README with new features and usage examples
|
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.




Summary
This PR enhances the SonarQube False Positive Issues Reporter to generate two comprehensive CSV reports instead of one, providing deeper insights into false positive patterns.
Changes Made
New Features
Rule-Based Report: New CSV file aggregating false positives by rule with:
Enhanced Project Report: Added percentage column showing the ratio of false positives to total issues
Improvements
--rule-output/-rfor specifying rule report filenameTechnical Changes
get_all_false_positive_issues()method to fetch all FP issues across projectsget_total_issues_count()method to calculate FP percentagesget_rule_details()method to fetch rule severity and software qualitiescount_false_positives_by_rule()function for rule-based analysisexport_rule_counts_to_csv()function for rule report generationDocumentation
Output Files
The script now generates two CSV files:
sonarqube_false_positives.csv)false_positives_by_rule.csv)Usage Example