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

This entry was posted in Feature, What's New (EAP) and tagged . Bookmark the permalink.

3 Responses to What’s mining: unused local variable or parameter inspection

  1. Uwe says:

    This doesn’t seem to be working with RubyMine 1.1 yet. Will it be available with 1.1.1?
    (would be good to mention this in the post or not post before it is generally available)

  2. Oleg Shpynov says:

    This functionality is available in development build and will be available in RubyMine 1.5 EAPs coming soon. Sorry for not mentioning the fix version

  3. bathrooms says:

    How long do you spend a day coming up with stuff like this?

Leave a Reply

Your email address will not be published. Required fields are marked *