First pass implementing RULE-0-2-1, unused variables.#1037
Merged
Conversation
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.
Implementation relies on shared code with autosar that was previously declared in the ql files. This behavior has been moved into UnusedObjects.qll.
The previous code seemed like a very disorganized set of exceptional cases, which was going to be worse with the new code. I made a minimal attempt to better organize it by organizing it into modules containing individual filter passes.
Filtering out
.getAnAccess()was always the last step. From a performance perspective, this is a bad order. We start with all variables, and for each one we join it against some set of rare exceptional cases, like functions with assembly, that only minimally reduce the set of variables we want to query. Changed to use a better order, where we begin with the set of variables that have no accesses, which should be a very small set relatively speaking, and then perform the odds-and-ends filters on top of that set. Small performance improvements have been measured across the queries.Description
please enter the description of your change here
Change request type
.ql,.qll,.qlsor unit tests)Rules with added or modified queries
RULE-0-2-1M0-1-3RULE-2-8Release 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 format of shared queries (not the .qll file, the
.ql file that imports it) is valid by running them within VS Code.
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.