We use a small blogging project to explain how to use PowerStation.

You can also watch the introduction video.

  1. Open your project with RubyMine:
    Open Project

  2. Choose any file you want to analyze, and click PowerStation->Analyze to analyze the file:
    Analyze

  3. Then you can click PowerStation->Show to check the result. Current version performs six types of analysis (LI, IA, CS, IR, DS and RD, which are explained in features). The problematic code lines are highlighted with blue.

  • Loop Invariant (LI):
    Loop Invariant
    Window on the left shows the lines of problematic code (which are also highlighted).

  • Inefficient API (IA):
    Inefficient API highlight

When clicking Fix on the left-hand-side window, PowerStation fixes the selected lines with a more efficient API. In this case, the count is replaced with size.
Inefficient API fix

  • Common Subpexression (CS):
    Common Subexpression

  • Inefficient Rendering (IR):
    Common Subexpression

  • Dead Store Queries (DS):
    Dead Store Queries

  • Redundant Data Retrieval (RD):
    Redundant Data Retrieval
    When moving the cursor to the problematic lines, PowerStation shows which fields are being retrieved but not used later.