C++ Cheatsheets

[BASIC]

[CPP]

Conditional Expressions

Finds conditional expressions of the form `... ? ... : ...` where the types of the resulting expressions differ

[BASIC]

[CPP]

Access Of Field

Finds field read `<field name>` on instance of class type `<class typename>`

[BASIC]

[CPP]

Address of reference variable

Finds address-of expressions (`&`) that take the address of a reference variable

[BASIC]

[CPP]

Aliased SSA Consistency Check

Performs consistency checks on the SSA construction. This query should have no results.

[BASIC]

[CPP]

Aliased SSA IR Consistency Check

Performs consistency checks on the Intermediate Representation. This query should have no results.

[BASIC]

[CPP]

Array access

Finds array access expressions with an index expression consisting of a postfix increment (`++`) expression.

[BASIC]

[CPP]

Call to constructor

Finds places where we call `new MyClass(...)`

[BASIC]

[CPP]

Call to function

Finds calls to `std::map<...>::find()`

[BASIC]

[CPP]

Cast expressions

Finds casts from a floating point type to an integer type

[BASIC]

[CPP]

Catch exception

Finds places where we catch exceptions of type `parse_error`

[BASIC]

[CPP]

Class derives from

Finds classes that derive from `std::exception`

[BASIC]

[CPP]

Const method without return type

Finds const methods whose return type is `void`

[BASIC]

[CPP]

Empty blocks

Finds empty block statements

[BASIC]

[CPP]

Equality test on boolean

Finds tests like `==true`, `!=true`

[BASIC]

[CPP]

Find-references links

Generates use-definition pairs that provide the data for find-references in the code viewer of VSCode.

[BASIC]

[CPP]

Functions with many parameters

Finds functions or methods with more than 10 parameters

[BASIC]

[CPP]

If statements with empty then branch

Finds `if` statements where the `then` branch is an empty block statement

[BASIC]

[CPP]

Integer literal

Finds places where we use the integer literal `2`

[BASIC]

[CPP]

IR Consistency Check

Performs consistency checks on the Intermediate Representation. This query should have no results.

[BASIC]

[CPP]

Jump-to-definition links

Generates use-definition pairs that provide the data for jump-to-definition in the code viewer of VSCode.

[BASIC]

[CPP]

Mutual recursion

Finds pairs of functions that call each other

[BASIC]

[CPP]

Override of method

Finds methods that override `std::exception::what()`

[BASIC]

[CPP]

Padding Consistency Check

Performs consistency checks for the padding library. This query should have no results.

[BASIC]

[CPP]

Print Aliased SSA IR

Outputs a representation of the Aliased SSA IR graph

[BASIC]

[CPP]

Print AST

Outputs a representation of a file's Abstract Syntax Tree. This query is used by the VS Code extension.

[BASIC]

[CPP]

Print IR

Outputs a representation of the IR graph

[BASIC]

[CPP]

Print Raw IR

Outputs a representation of the Raw IR graph

[BASIC]

[CPP]

Print SSA IR

Outputs a representation of the SSA IR graph

[BASIC]

[CPP]

Raw IR Consistency Check

Performs consistency checks on the Intermediate Representation. This query should have no results.

[BASIC]

[CPP]

Return statements

Finds return statements that return `0`

[BASIC]

[CPP]

Singleton blocks

Finds block statements containing a single statement

[BASIC]

[CPP]

SSA IR Consistency Check

Performs consistency checks on the Intermediate Representation. This query should have no results.

[BASIC]

[CPP]

Switch statement case missing

Finds switch statements with a missing enum constant case and no default case

[BASIC]

[CPP]

Throw exception of type

Finds places where we throw `parse_error` or one of its sub-types

[BASIC]

[CPP]

TODO comments

Finds comments containing the word 'TODO'

[BASIC]

[CPP]

Unaliased SSA Consistency Check

Performs consistency checks on the SSA construction. This query should have no results.

[BASIC]

[CPP]

Unused local variable

Finds local variables that are not accessed

[BASIC]

[CPP]

Unused parameter

Finds parameters that are not accessed

[BASIC]

[CPP]

Unused private method

Finds private non-virtual methods that are not accessed

[BASIC]

[CPP]

Variable declared volatile

Finds variables with a `volatile` modifier