SemmleCode to check J2EE specification conformance

SemmleCode (http://semmle.com/product/semmlecode/screenshots/) is a free Eclipse plugin to query static structure of java code (both source and byte code). Code queries are generally used improve software quality: one can find bugs, compute metrics, search code or enforce coding conventions such as in J2EE specification.

SemmleCode has a large library of predefined queries for all of the above tasks, but the key difference of the tool is that all queries have a form of short, intuitive code queries. This allows for an easy definition of new custom queries or adjusting of existing ones to your specific project. See for yourself:

The aim of this query is to point out violations of the following J2EE specification rule: an entity-bean class must not define finalize method.

from EntityBean ebean, Method m

where m.getDeclaringType() = ebean and

m.hasName("finalize") and

m.hasNoParams() and

m.getType().hasName("void")

select m, ebean.toString() +" entity-bean class"

+" must not define the finalize method"

Queries have a mixed flavour of SQL and object orientation. None of the types or methods used in the query are fixed. For instance EntityBean type is defined in the library of default definitions as follows:

class EntityBeanextends Class{

EntityBean(){

exists(Interface i | i.hasQualifiedName("javax.ejb","EntityBean")

and this.hasSupertype+(i))

}

}

SemmleCode has eight different visualisation views: tree-view, table-view, bar-chart and pie-chart views, graph view and Eclipse's errors and warnings view, provides code-autocompletion and syntax highlighting for queries.

You can download SemmleCode here: http://semmle.com/. There is also a community page for the tool (http://semmle.com/community/) where users can request new features or share their queries. Enjoy!

-

Elnar

Semmle Limited

[2272 byte] By [elnara] at [2007-11-27 6:09:42]
# 1
Semmle has recently released a new version of SemmleCode v0.2.0. Many queries have been added or revised. Many more UI features added to improve user experience, such as new table view or a possibility to export charts as EPS or PNG files.
elnara at 2007-7-12 17:14:06 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...