Inspectopedia 2025.2 Help

Simplifiable statement

Reports the statements that can be simplified, such as constant conditions, identical if branches, redundant boolean expressions, and others. Use the checkboxes below to control the analysis options:

  • Simplify "if (true)", "while(false)": suggest replacing the if/while statement with a boolean literal.

  • Simplify "condition == true": suggest replacing equality statements with boolean literals.

  • Simplify "condition1 ? true : condition2;": suggest simplifying ternary operators where one of the expressions is a boolean literal.

  • Simplify "if (condition1) return true; return condition2;": suggest simplifying if where a boolean literal is returned if the condition is true and another condition is returned otherwise.

Locating this inspection

By ID

Can be used to locate inspection in e.g. Qodana configuration files, where you can quickly enable or disable it, or adjust its settings.

Simplify
Via Settings dialog

Path to the inspection settings via IntelliJ Platform IDE Settings dialog, when you need to adjust inspection settings directly from your IDE.

Settings or Preferences | Editor | Inspections | C/C++ | General

Inspection ID: Simplify

Inspection options

Here you can find the description of settings available for the Simplifiable statement inspection, and the reference of their default values.

Simplify "if (true)", "while (false)"

Option ID:

enableSimplifyConstantConditions

Default value:

Selected
Simplify "condition == true"

Option ID:

enableSimplifyEqualToTrueFalse

Default value:

Selected
Simplify "condition1 ? true : condition2"

Option ID:

enableSimplifyTernaryWithConstantBranch

Default value:

Selected
Simplify "if (condition1) return true; return condition2;"

Option ID:

enableSimplifyIfWithReturn

Default value:

Not selected

Suppressing Inspection

You can suppress this inspection by placing the following comment marker before the code fragment where you no longer want messages from this inspection to appear:

//noinspection Simplify

More detailed instructions as well as other ways and options that you have can be found in the product documentation:

Inspection Details

By default bundled with:

CLion 2025.2,

Can be installed with plugin:

CLion, 2025.2

Last modified: 18 September 2025