Enhancement: add support for suppressing multiple types of CodeQL alerts on the same line

Open
#327 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
cpp
Domain
devtools, security

Research direction

Start by reviewing the proposed NOCODEQL syntax and how multiple code-identifiers should map to different rule-ids. The issue names no files or tests, so first locate the repository's existing CodeQL alert-suppression implementation. Done means multiple alert types on one line can be suppressed with distinct code-identifiers without treating shared identifiers as the solution.

Written by the indexing model from the issue text.

Description

enhancement user-report

Naming code-identifiers in coding-standards.yml differently for each rule-id should be considered a good practice, however the current implementation of CodeQL, doesn't provide a way for suppressing multiple types of CodeQL alerts on the same line with different code-identifiers. Using the same code-identifier should not be considered as a solution for this problem.

Therefore, a feature for suppressing multiple types of CodeQL alerts on the same line would be inevitable in the future, similarly what clang-tidy can provide with the syntax NOLINT(error_code1, error_code2, ..., error_codeN).

Proposed Solution:
Introduce NOCODEQL syntax or similar feature for suppressing multiple types of CodeQL alerts on the same line:

ReturnTypeGeneratesAnAlert MyFunction(ParamTypeGeneratesAnAlert p1) {  // NOCODEQL(code-identifier#1, code-identifier#2)
...
}
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.