在我们的代码库中,我看到很多类似的方法:
/**
* @param tagID
* @param startDate
* @param endDate
* @param estimated
* @return
* @throws ServerException
*/
List<String> generateMaster(int tagID, Date date)
throws ServerException, BusinessException;
虽然存在javadoc,但缺少方法的描述。因此,javadoc显然毫无用处。在checkstyle中,我该怎么做才能对上述情况发出警告。
<property name="allowMissingJavadoc" value="false"/>
这仅检查是否存在javadoc。它将上述方法标记为present
,因为javadoc存在。但实际上缺少方法声明。
PS:标记eclipse和intellij。我很满意任何解决方案,告诉我包含上面的方法的数量,如javadocs
我们在checkstyle中将它用于javadoc:
<module name="JavadocStyle">
<property name="severity" value="warning"/
<property name="checkEmptyJavadoc" value="true"/>
</module>
如你所见checkEmptyJavadoc
应该帮助你。
这篇文章可能为时已晚 - 但是其他任何人都希望找到答案,为每个元素添加说明,例如
/**
* @param tagID - ID of the tag
* @param startDate - Starting Date
* @param endDate - End date
* @param estimated <-- this is not the param - should be removed or fix doc
* @return <-- missing return param and description
* @throws ServerException -- throws server exception
*/