How Analysis Modules Work

At the current time, we rely heavily on the use of the Javadoc program to parse the submitted source code. In a nutshell, Javadoc accepts source code for processing into a number of forms. You are likely most used to its output in HTML format (example) where it details the accessible components of classes and packages. For the Java library, this is known as the API. If you were writing your own code for release to a larger audience, you could use Javadoc to create your own API pages to detail how others can use your code.

Javadoc RootDoc
Javadoc processes all of the code it is passed into a RootDoc object from which you can explore the components it finds. Then, once it has a RootDoc to work with, Javadoc passes a reference to the RootDoc to a 'doclet' - a module of code designed to work with a RootDoc to produce a meaningful output. For example, in its default form, Javadoc processes source code, produces a RootDoc, and then uses the RootDoc to create the HTML output.

The COMTOR project has created its own doclet for using a RootDoc to analyze the comments found in the source code processed by Javadoc. This Driver Doclet (as we like to call it) manages the process of calling our analysis modules, each of which perform a specific analysis action (checking spelling, checking for the presence of specific tags, etc.).

COMTOR Reporting
Each analysis modules creates a Java Properties list of heading numbers and values as a form of reporting. Then, once the module is completed, this Properties list is returned to the Doclet Driver to be combined with any other Properties lists to form a report of the results. In the web version of COMTOR, we database these reports for posterity, analysis, and record keeping. In our stand alone client (sometimes known as the debug version) we only produce the reports to output in the raw form of dumping the Properties list, so that we can validate our results without polluting our database. In the future we'll launch a COMTOR version without the database to the cloud, so that one can use COMTOR without accessing the database (think of it as a trial or open service).