Argus Codewatch Code Check

net.sourceforge.arguscodewatch.codeCheck

0.0.1

This extension points allows to register additional code checks which are subsequently triggered by Argus Codewatch. Additionally, each plugin can categorize its own code checks, either by referring to external categories, or by supplying its own category description.

<!ELEMENT extension (codeCheck+ | categoryName*)>

<!ATTLIST extension

point CDATA #REQUIRED

id    CDATA #IMPLIED

name  CDATA #IMPLIED>

Allows for additional code checks



<!ELEMENT codeCheck (option)*>

<!ATTLIST codeCheck

id              CDATA #REQUIRED

defaultSeverity (WARNING|ERROR|IGNORE) "WARNING"

class           CDATA #REQUIRED

categoryId      CDATA #IMPLIED

description     CDATA #REQUIRED

requiresBinding (true | false) "false">

All data about the code check should be published in this element. This includes the implementing class, and the problem description.



<!ELEMENT option EMPTY>

<!ATTLIST option

id           CDATA #REQUIRED

description  CDATA #REQUIRED

type         (boolean|string|visibility)

defaultValue CDATA #IMPLIED>

If the codeCheck requires additional settings, they may be specified here. They will be shown on the preferencePage, linked to the codeCheck.



<extension point=

"net.sourceforge.arguscodewatch.codeCheck"

>

<codeCheck class=

"net.sourceforge.arguscodewatch.DummyCheck"

id=

"dummyCheck"

default_severity=

"WARNING"

description=

"allow dummy code blocks"

categoryId=

"net.sourceforge.arguscodewatch.category.dangerousCode"

>

<option id=

"ignoreDuplicates"

type=

"boolean"

/>

</codeCheck>

</extension>

In this example, the class DummyCheck can query the value of its option via a call to parent.getProperty("dummyCheck.ignoreDuplicates"). This will return a String representation of Boolean.

The class must be a subclass of net.sourceforge.arguscodewatch.CodewatchVisitor. This abstract class extends ASTVisitor and adds a number of convenience methods. Like the ASTVisitor class, implementing classes only need to override the corresponding visit() methods. Markers can be easily created via the parent.createMarker() methods.

Unlike the ASTVisitor class, subclasses of CodewatchVisitor have access to the corresponding source code via the source field. Current preference settings can be obtained via the parent.getProperty() method.

Clients that want to implement additional preference settings, can use net.sourceforge.arguscodewatch.preferences as their page category.

All codeChecks in the original plug-in use this extension point.