Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spot useless javadocs #4

Open
manoelcampos opened this issue Jul 19, 2017 · 0 comments
Open

Spot useless javadocs #4

manoelcampos opened this issue Jul 19, 2017 · 0 comments
Labels

Comments

@manoelcampos
Copy link
Owner

manoelcampos commented Jul 19, 2017

Sometimes, developers write useless javadocs such as the example below

/**
 * Some Foo Method.
 * @param id the id
 * @return 
*/
int someFooMethod(int id){ return 0; }

The plugin should spot this kind of "documentation" and present them into the report.
A common pattern to detect such useless javadocs are:

  • the method documentation includes only the name of the method, accordingly separating words by space
  • param documentation just includes the name or type of the param, preceded by an article (the, a, an): the id, an id, an int
  • method or param documentation includes just one word.
  • after removing connectors (the, a, and, of, to, for, etc) and spaces from the documentation, the text remaining is equal to the element name, for instance:
/**
 * Compute the statistics.
*/
double computeStatistics(){ return 0; }

However, it may be difficult to detect verbs in the 3rd person of the singular, such as "Computes" instead of "Compute".

Regular expressions should be defined to detect such issues. A set of regex should be defined by default, but the plugin should enable developers to specify their own regex and if they want to use both the given regular expressions and the standard ones, or just the given ones.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant