Add support for lambda captures in assignment-related predicates in misra BuiltInTypeRules

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

Nobody has claimed this yet.

Assessment

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

Research direction

Start in cpp/misra/src/codingstandards/cpp/misra/BuiltInTypeRules.qll around line 179 and trace the assignment-related predicates referenced by the issue. Check their behavior for an init-capture such as [x = y] and for other lambda captures; the work is done when the predicates handle these captures correctly and the relevant query tests pass.

Written by the indexing model from the issue text.

Description

Difficulty-Medium Impact-Low Stardard-MISRA-C++ task

It looks like we should make sure these predicates are working correctly for lambda captures.

For instance:

[x = y]() { ... }

But also, all lambda captures are assignments fields of the lambda class instance.

https://github.com/github/codeql-coding-standards/blob/main/cpp/misra/src/codingstandards/cpp/misra/BuiltInTypeRules.qll#L179

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.