Early Access Program Features

What’s mining: unused local variable or parameter inspection

Hello everyone,

RubyMine already has a bunch of inspections that help you on the fly to write correct and clean ruby code. They are Ruby code style, Unreachable code, Unresolved Ruby reference etc. Recently we’ve added one more useful inspection: Unused local variable.

Here is a screenshot:

This inspection will warn you about local variables or parameters which values are not used in the scope. Local variable on lines 2 and 5 are highlighted with warning because values assigned aren’t used anywhere, but local variable on line 7 isn’t because you can see read access to it’s value on line 8.

If you find some errors in its behavior or have suggestions you are welcome to file a bug or post your code on the forum. Thanks for all your reports so far! Your help is invaluable in making RubyMine the smartest Ruby IDE.

Note: You can also disable this inspection from right-click context menu or in File | Settings | Inspections | Ruby.

JetBrains RubyMine Team

image description