codeql-coding-standards
codeql-coding-standards copied to clipboard
This repository contains CodeQL queries and libraries which support various Coding Standards.
### Affected rules - `A4-7-1` ### Description Typical increment by one in for loops cannot lead to overflow or wrap-around because the number of iterations isn't large enough. The example...
### Affected rules - `A2-10-5` ### Description Variable template defined with an specialization is alerted as identifier reuse. ### Example ```cpp template extern constexpr bool x = false; template extern...
### Affected rules - `A4-7-1` ### Description Decrement cannot lead to wrap-around since the container is checked for emptiness. ### Example ```cpp class container { bool empty() { return num_items_...
### Affected rules - `DCL53-CPP` ### Description `LocalConstructorInitializedObjectHidesIdentifier.ql` currently identifies variable declarations that call a constructor and hide an outer scope variable. However, this does not fully capture the cases...
### Affected rules - `A12-8-6` ### Description Compiler generated special functions are not always flagged by this rule, because the extractor does not always generate them. In CodeQL CLI `v2.16.6`...
### Affected rules - `RULE-8-13` ### Description Should we flag variables generated from macro expansions as missing const? Some considerations: * Should we flag the macro itself, as that's where...
The query doesn't currently report what type of side effect is highlighted. This can make it difficult to identify why correct results are reported, as some side-effects aren't that obvious,...
### Affected rules - `A27-0-4` - `A18-1-1` ### Description Alerts of both rules are triggered even if no C-style array or string is directly used. It may also be relevant...
### Affected rules - `A20-8-5`: `cpp/autosar/make-unique-not-used-to-construct-object-owned-by-unique-ptr` > Rule A20-8-5 (required, implementation, automated) > std::make_unique shall be used to construct objects owned by > std::unique_ptr. - `A20-8-6`: `cpp/autosar/make-shared-not-used-to-construct-object-owned-by-shared-ptr` > Rule A20-8-6...
### Affected rules - `A5-16-1`: `cpp/autosar/ternary-conditional-operator-used-as-sub-expression` > Rule A5-16-1 (required, implementation, automated) > The ternary conditional operator shall not be used as a sub-expression. ### Description When initializing a **string**...