Forum Controls
Spotlight Features

The Rich Engineering Heritage Behind Dependency Injection

Andrew McVeigh takes us on a tour of the rich heritage behind dependency injection, what it represents, and tells us why its here to stay.

NetBeans 6: Matisse Updates

NetBeans 6 delivers great updates to the Matisse GUI builder. Spend a few minutes with Roman Strobl and get an expert briefing on what's new and what has changed.

Introduction to Groovy Part 3

In this, the third and final installation of Andres' Introduction to Groovy series, you learn about how Groovy handles variable numbers of arguments, named parameters, currying, and more about Groovy operators. Including, some new operators.

Easier Custom Components with Swing Fuse

Swing Fuse (actually just Fuse), is a framework designed to make it easier to create your own custom desktop components. In this article, Daniel Spiewak shows you how to get started and provides sample source code you can download.

Benchmark Analysis: Guice vs Spring

Willam Louth shows how he uses JXInsight Probes to investigate probable performance issues with code bases that he is not familiar with. He also highlights possible pitfalls in creating a benchmark, as well as in the analysis of results.
Replies: 0 - Pages: 1  
Threads: [ Previous | Next ]
  Click to reply to this thread Reply

IDEA: Finding Incomplete Code with IntelliJ IDEA

At 10:56 AM on Jan 16, 2006, Sixth and Red River Software wrote:

As regular readers know, we are fascinated by the bug-finding capabilities of IntelliJ IDEA. Some of the most powerful of these analysis techniques involve finding places where code lacks a necessary symmetry, indicating that piece of functionality was either half-completed, or half-removed. Variables that are written to but never read, for instance, are clear indicators that something is wrong with the code.

Other cases where symmetry is broken, which IDEA will inform you of immediately


  • Interfaces and abstract classes with no implementations

  • Collection variables which are queried without ever being updated, or vice versa

  • Array variables which whose contents are read but never written, or vice versa

  • Loops that have no exit points

  • Methods that recursively call themselves, with no exit tests

  • Catch clauses that do nothing but drop the caught exception

  • Switch statements with no default cases, or that have a default case they don't need (for switches over enums)

  • JUnit test cases which don't include any assertions



One amazing thing about these code analysis is that they can be used inline, while editing. This means that you have immediate visual feedback telling you that your aren't done yet. You don't have to wait to run a test, or even compile your code, to know that you left out some important part of your algorithm. The "Extreme Programming" folks always like to talk about the "green bar" when all your unit tests pass, and you know you're finished with the functionality you are coding. With inspections like these, you get the "green box" which tells you if your code is even internally sensible.

Sixth and Red River Software
A proud producer of Recommended Companion Products for IntelliJ IDEA

thread.rss_message