`M5-0-2`: triggers on expressions with no dependence on precedence rules

Open
#364 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
42/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
cpp
Domain
devtools

Research direction

Start by locating the M5-0-2 rule implementation and reproduce the report with the fully parenthesized C++ expression shown in the issue. Confirm the rule distinguishes expressions that do not depend on precedence rules, then run the existing rule checks if available; done means this example no longer produces the diagnostic without weakening valid findings.

Written by the indexing model from the issue text.

Description

enhancement Standard-AUTOSAR user-report
Affected rules
  • M5-0-2
Description

M5-0-2 reports "Limited dependence should be placed on C++ operator precedence rules in expressions" on expressions which are fully parenthesized

Example
constexpr byte& operator&=(byte& lhs, const byte rhs) noexcept {
  lhs = (lhs & rhs);
  return lhs;
}
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.