Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A7-1-1: Exclude compiler generated statements for range based for loops #372

Closed
lcartey opened this issue Oct 2, 2023 · 2 comments · Fixed by #521
Closed

A7-1-1: Exclude compiler generated statements for range based for loops #372

lcartey opened this issue Oct 2, 2023 · 2 comments · Fixed by #521
Assignees
Labels
Difficulty-Low A false positive or false negative report which is expected to take <1 day effort to address false positive/false negative An issue related to observed false positives or false negatives. Impact-Medium user-report Issue reported by an end user of CodeQL Coding Standards

Comments

@lcartey
Copy link
Collaborator

lcartey commented Oct 2, 2023

Affected rules

  • A7-1-1
  • A0-1-1

Description

Similar to:
#309

Example

  for (const bool value : values) {
    do_stuff(value);
  }
@lcartey lcartey added Difficulty-Low A false positive or false negative report which is expected to take <1 day effort to address false positive/false negative An issue related to observed false positives or false negatives. Impact-Medium user-report Issue reported by an end user of CodeQL Coding Standards labels Oct 2, 2023
@lcartey
Copy link
Collaborator Author

lcartey commented Oct 25, 2023

As part of this work we should do a systematic analysis of the queries using QL for QL to identify queries reporting Variables as their primary location where the isCompilerGenerated is not included as a condition on the where clause.

@rvermeulen
Copy link
Collaborator

rvermeulen commented Feb 1, 2024

A0-1-1 is already address by @lcartey in b8a527c.
Cannot replicate the issue for A7-1-1, but testing on open pilot does give a meaningful difference.
I will exclude compiler generated variables.

rvermeulen added a commit to rvermeulen/codeql-coding-standards that referenced this issue Feb 1, 2024
@rvermeulen rvermeulen mentioned this issue Feb 1, 2024
30 tasks
github-merge-queue bot pushed a commit that referenced this issue Feb 2, 2024
rvermeulen added a commit to rvermeulen/codeql-coding-standards that referenced this issue Feb 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Difficulty-Low A false positive or false negative report which is expected to take <1 day effort to address false positive/false negative An issue related to observed false positives or false negatives. Impact-Medium user-report Issue reported by an end user of CodeQL Coding Standards
Projects
Development

Successfully merging a pull request may close this issue.

2 participants