JetBrains Rider 2022.3 Help

Code analysis

Code inspections

In addition to hundreds of code inspections that check general aspects of C++ code, there are some inspections that are specific to Unreal Engine projects.

UnrealHeaderTool (2 inspections)

 

Inspection

Default severity

UnrealHeaderTool errors

Error

UnrealHeaderTool warnings

Warning

Unreal Engine (16 inspections)

Inspections in this category are specific to Unreal Engine projects.

Inspection

Default severity

Action with this name does not exist

Warning

Axis with this name does not exist

Warning

BlueprintCallable function can be made const

Hint

BlueprintCallable function can be made static

Hint

BlueprintCallable function is never used in Blueprint or C++ code

Warning

BlueprintImplementableEvent function is not implemented in any blueprint

Warning

C++ standard library headers not found

Error

Inconsistent Unreal Engine Naming

Hint

Inconsistent Unreal Engine UCLASS Naming

Error

Non-UProperty object member can be garbage collected at any time

Warning

Objects stored in non-uproperty member can be garbage collected at any time

Warning

Specified version of the engine project is not found

Error

UFUNCTION macro call has no effect

Warning

Unreal Engine source file without predefined Unreal macros

Warning

Unreal Engine version file does not exist

Error

UPROPERTY macro call has no effect

Warning

UnrealHeaderTool integration

UnrealHeaderTool is a parsing and code-generation tool for Unreal Engine. In the Unreal Engine code compilation workflow, the tool parses the C++ header files, looking for Unreal related macros and metadata, and uses this to generate additional code to support the UObject system, such as reflection and networking.

JetBrains Rider provides seamless integration with UnrealHeaderTool: the first time you build the Unreal Engine project, JetBrains Rider finds the UnrealHeaderTool used for the code compilation and can then run the tool in the background as a separate process to check the file you are editing and show the same errors and warnings that you would normally see at compile time. The code analysis results are displayed right in the editor, just like other JetBrains Rider's inspections.

JetBrains Rider runs UnrealHeaderTool only on the file that is currently open, and the process is optimized to have a minimal impact on overall performance.

Watch this video for the integrated UnrealHeaderTool inspections in action:

UnrealHeaderTool inspections

UnrealHeaderTool can detect lots of different issues with your code, such as using a specific meta tag without the required reflection specifier, using the GENERATED_BODY macro in a private scope, when an invalid entity is exposed to a blueprint, and a lot more. Here are some examples:

  • Missing reflection specifiers on a UFUNCTION.

    UnrealHeaderTool Error: 'reliable' or 'unreliable' is required
  • Using the UFUNCTION macro inside a struct.

    UnrealHeaderTool Error: USTRUCTs cannon contain UFUNCTIONs
  • Invalid BlueprintType enum base.

    UnrealHeaderTool Error: Currently only uint8 supported

To distinguish between UnrealHeaderTool checks and JetBrains Rider’s inspections, you can look at the name of the check in square brackets, appended to the inspection message.

Configuring UnrealHeaderTool inspections

All UnrealHeaderTool inspections have corresponding configurable severity levels, which can be adjusted to meet your needs.

As with the built-in inspections, you can use the inspection context menu to quickly change the severity of an UnrealHeaderTool check, suppress it via a comment (in specific scope or globally), or find and investigate all similar issues.

JetBrains Rider: Clang-Tidy inspection menu
Last modified: 11 July 2022