Guideline recategorization#68
Merged
rvermeulen merged 43 commits intogithub:mainfrom Dec 2, 2022
Merged
Conversation
6b10b82 to
ba35ca1
Compare
8e4acc3 to
423fd38
Compare
a86c1cc to
3beccc4
Compare
jsinglet
suggested changes
Nov 17, 2022
Contributor
jsinglet
left a comment
There was a problem hiding this comment.
Note: @rvermeulen @mbaluda and I reviewed this PR together. Here are a few additional notes. Great work! 🚀
mbaluda
approved these changes
Nov 17, 2022
Collaborator
mbaluda
left a comment
There was a problem hiding this comment.
Thanks for the walkthrough, looks good to me!
The category information enables evaluation time computation of the effective category of a rule. The effective category is determined by the rule's category and a possible recategorization through a Guideline Recategorization Plan. The effective category will be used to determine how to handle a deviation applied to a query implementing the rule.
This commit adds: - A new section `guideline-recategorizations` to the configuration specification for `coding-standards.yml`. - Two tests to list all the indexed guideline recategorizations and all the invalid guideline recategorizations. This commit does not include the application of the effective category.
With the additional support of a Guideline Recategorization Plan and possible other further configuration options we are moving the script into the generic configuration folder instead of the deviations folder.
The format depends on the length of the package name so we format the generated file with the CLI instead of mirror the formating behavior in the template.
This allows us to reduce the number of CodeQL CLI invocations for performance improvements.
Each file generation for a package will update the shared meta data value for the language the package belongs to. Running generation in parallel will result in a race condition which may result in inconsistent meta data files.
In this commit we expand the meta data `Query` class to provide an effective category that is determined by combining a query's category and a possible active Guideline Recategorization Plan. The exclusion process now validates for a query with an associated deviation record whether the effective category allows a deviation. If this is not allowed, then the deviation record is not applied. Any deviation record applied to a query with an effective category not permitting deviation is considered invalid and will be listed in the analysis report.
This is used for debugging and testing purposes and cannot be used in our standard queries due to the required negation and the possible infinite possible values for reason.
rcseacord
reviewed
Nov 29, 2022
rcseacord
reviewed
Nov 29, 2022
rcseacord
reviewed
Nov 29, 2022
rcseacord
reviewed
Nov 29, 2022
rcseacord
reviewed
Nov 29, 2022
rcseacord
reviewed
Nov 29, 2022
rcseacord
reviewed
Nov 29, 2022
rcseacord
reviewed
Nov 29, 2022
rcseacord
reviewed
Nov 29, 2022
rcseacord
reviewed
Nov 29, 2022
rcseacord
reviewed
Nov 29, 2022
rcseacord
reviewed
Nov 29, 2022
rcseacord
reviewed
Nov 29, 2022
rcseacord
reviewed
Nov 29, 2022
rcseacord
reviewed
Nov 29, 2022
rcseacord
reviewed
Nov 29, 2022
rcseacord
reviewed
Nov 29, 2022
Co-authored-by: Robert C. Seacord <rcseacord@gmail.com>
Remove the note discussing the granularity options of applying a recategorization.
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.
Description
This PR adds support for a Guideline Recategorization Plan as described in chapter 5 The guideline re-categorization plan of the MISRA Compliance:2020 and documented in this design
This includes:
guideline-recategorizationssection to thecoding-standards.yml.effective categorybased on a rule's category and a guideline recategorization according to the rules in chapter 5 of the standard MISRA Compliance:2020.disappliedrules.effective categoryin the resulting Sarif file.Change request type
.ql,.qll,.qlsor unit tests)Rules with added or modified queries
Release change checklist
A change note (development_handbook.md#change-notes) is required for any pull request which modifies:
If you are only adding new rule queries, a change note is not required.
Author: Is a change note required?
Reviewer: Confirm that either a change note is not required or the change note is required and has been added.
Query development review checklist
For PRs that add new queries or modify existing queries, the following checklist should be completed by both the author and reviewer:
Author
As a rule of thumb, predicates specific to the query should take no more than 1 minute, and for simple queries be under 10 seconds. If this is not the case, this should be highlighted and agreed in the code review process.
Reviewer
As a rule of thumb, predicates specific to the query should take no more than 1 minute, and for simple queries be under 10 seconds. If this is not the case, this should be highlighted and agreed in the code review process.