Inspectopedia 2025.3 Help

Local variables

Reports GDScript variables and constants that are declared but never used.

This inspection helps keep your scripts clean by detecting local variables and const declarations that have no usages in the project scope. If a type hint is present but refers to an unresolved type, the declaration is ignored to prevent false positives.

Examples:

var tmp = 42 # unused, will be reported const PI2 = PI * 2 # unused, will be reported var enemy: UnknownType # ignored if UnknownType cannot be resolved

Quick fix actions:

  • Remove the unused variable/constant.

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.

GdUnusedVariable
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 | GdScript | Unused symbols

The inspection does not report declarations that are referenced anywhere in the project. It also skips declarations with unresolved type to avoid false alarms.

Inspection ID: GdUnusedVariable

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 GdUnusedVariable

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:

JetBrains Rider 2025.3, Qodana for .NET 2025.3,

Last modified: 04 March 2026