SemmleCode free eclipse plugin helps improving software quality
Semmle has just released a preview of a free Eclipse plugin that helps you improve software quality by computing metrics, finding bugs, checking style rules or simply searching and navigating through the code - SemmleCode.
All these tasks are formulated as code queries. SemmleCode ships with a large library of queries for computing metrics, checking J2EE rules, and so on. You can invoke these pre-defined queries via the Eclipse run menu.
To implement new checks of your own, you can adapt the existing queries. They are written in an intuitive object-oriented query language named .QL.
A Bug Example
It is a bad practice to define equals() method without defining hashCode() method and following this bad practice can lead to unexpected program behaviour and very subtle bugs. To find all classes that have this bug pattern one would write the following query:
from Class c
where c.declaresMethod("equals") and
not c.declaresMethod("hashCode") and
select c, c.getPackage().getName() + "." +
c.getName() + " violates equals/hashCode definition rule!"
The results of this query are displayed in the Eclipse problems view, and also as error markers in the source itself. SemmleCode allows many different ways of viewing query results, including tree-view, table-view, bar-charts, pie-charts and graphs. For more example queries, and a general introduction to SemmleCode, have a look at our website(http://semmle.com/ ).