COMTOR Logo

Comment Analysis Features

New features are constantly being added so check back frequently for information on new additions!

COMTOR generates a report based on a user's submitted source code. Currently there are five modules, listed below, along with a short description of their purpose.

  • Check for Tags (requires the presence of Javadoc tags)

    Searches submitted source code to evaluate whether all user-defined methods contain the correct use of three core Javadoc tags.

    This module verifys that the @return, @param, and @throws tags are used appropriately. All methods that return a non-void value must have a valid @return tag in the comment block above the method's header line. The @return tag should not be present for methods with a return type of void. All method parameters should have an @param tag with an comment indicating the purpose of the parameter. There should not be any @param tags for non-existent parameters. Each exception that a method throws should have an @throws tag. There should not be any @throws tags present in methods that do not throw exceptions.

    Code Example:

    /** * Attempts to recursively traverse the maze. Inserts special characters * indicating locations that have been tried and that eventually become part * of the solution. * * @param row provides the row index at which the traversal starts * @param column provides the column index at which the traversal starts * @return true if the maze is solved, false otherwise * @throws NullPointerException if the parameters reference an invalid maze cell */ public boolean traverse (int row, int column) throws NullPointerException

    Report Example:

    Check for Tags (Check for the proper use of returns, throw, and param tags.)
    3.00 out of 10.00

    Class: TestClass
    Field: message
    Method: getMessage
    Analyzed method getMessages declared return type and @return tag. This comment is CORRECT.
    Analyzed method getMessages exception NullPointerException. This comment is INCORRECT. There is no @throws tag present for this exception.
    Analyzed method getMessages @throws tag a NullPointerException if the message is null. This comment is INCORRECT. The exception name does not match the exception name, ( a NullPointerException if the message is null ) following the @throws tag.

    Class: ComtorTester
    Method: main
    Analyzed method mains declared return type and @return tag. This comment is CORRECT.
    Analyzed method mains parameter java.lang.String[] args. This comment is INCORRECT. There is no @param tag present for this parameter.
  • Percentage Methods

    Calculates the average length of words in comments which immediately precede method definitions.

    Report Example:

    Percentage Methods (Calculate the percentage of commented methods per class.)
    5.00 out of 5.00

    Class: TestClass
    100 percent (1/1) of class TestClasss methods are commented.

    Class: ComtorTester
    100 percent (1/1) of class ComtorTesters methods are commented.
  • Comment Average Ratio

    Determines the length (in words) of each method's comments and the average length of method comments for each class.

    Report Example:

    Comment Average Ratio (Calculate the length of each method's comments in a class. If you are not getting full credit, try increasing the length of your comments.)
    5.00 out of 5.00

    Class: TestClass
    The length of comments for the method getMessage is 33 words.
    The average length of comments for the class TestClass is 33 words.

    Class: ComtorTester
    The length of comments for the method main is 66 words.
    The average length of comments for the class ComtorTester is 66 words.
  • Method Interactions

    Outputs which user-defined methods are called from other user-defined methods.

    Report Example:

    Method Interactions (Creates a method call graph for each user defined method. This does not count towards the overall grade.)
    0.00 out of 0.00

    TestClass Class
    TestClass Method
    getMessage Method

    ComtorTester Class
  • Spell Checker

    Checks the spelling in comments. (Note: There may be some words that are spelled correctly, marked incorrect because they are not present in the dictionary.)

    Report Example:

    Spell Checker (Checks the spelling in comments. (Note: There may be some words that are spelled correctly, marked incorrect because they are not present in the dictionary.))
    4.50 out of 5.00
    The following word was misspelled: Javadoc
    The following word was misspelled: null
    The following word was misspelled: Comtor

Additional Features Provided

In addition to simply submitting reports, COMTOR facilitates professor-student interaction. Professors can create an account which allows them to create a course and a dropbox for class assignments. Students then can enroll in their professor's course and submit their class assignments to the dropbox for analysis. Professors can view the source code and the reports generated from these submissions, as well assign point values for the various modules and view corresponding scores. There is also an email feature which allows both students and professors to compose emails to anyone registered that particular course.