`RULE-2-2`, etc: use new macro deduplication module for improved results

Open
#838 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
38/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Stale
Tech stack
cpp
Domain
devtools

Research direction

Start by reviewing the new macro deduplication module in PR 784 and the dead-code queries for RULE-2-2 and related rules. Integrate the module so macro-expanded dead-code results have reduced noise, then validate the behavior with the provided C++ macro example.

Written by the indexing model from the issue text.

Description

Difficulty-Low enhancement false positive/false negative false-negative Impact-Low Standard-AUTOSAR Standard-MISRA-C Stardard-MISRA-C++
Affected rules
  • RULE-2-2, and likely others
Description

These rules look for dead code and exclude results from macros to reduce noise, since macros may be expanded dozens or hundreds of times. A new module in this PR can reduce noise for these results, and should be integrated into these dead code queries.

Example
#define FOO(x) (1 + x)
void f() {
  int l;
  FOO(l);
}
Dominant language
CodeQL
Stars
227
Forks
82
Avg merge
6d 7h
Merged PRs (30d)
9

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from github/codeql-coding-standards

All issues in github/codeql-coding-standards

Similar issues

More DevTools issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.