Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ - Find undocumented public methods

Using IntelliJ IDEA 15, how can I find public methods that lack javadoc and therefore lead to a decrease of the SonarQube metric Public Documented API as shown here?

like image 245
michaelbahr Avatar asked Nov 16 '25 05:11

michaelbahr


1 Answers

IntelliJ has the ability to Inspect Code.

1. Adjust inspection settings

In order to identify missing public documentation, firstly enable the issue Declaration has Javadoc problems. You do this by opening the IDE Settings and select Editor -> Inspections. In the right menu select Java -> Javadoc issues -> Declaration has Javadoc problems. Activate this issue.

enter image description here

Again in the lower right corner you will see some options for this issue. Make sure, that for the tab Method, the Scope is set to public. Also check Ignore simple property access as you don't want to be informed of getters and setters lacking documentation.

enter image description here

Click OK to save.

2. Inspect the code

In the top menu bar in IntelliJ open Analyze -> Inspect Code..., select how much shall be inspected and run it by clicking on OK. In the Inspection Results look for Javadoc issues -> Declaration has Javadoc problems. Those issues stating Required Javadoc is absent are what you are looking for.

like image 137
michaelbahr Avatar answered Nov 18 '25 20:11

michaelbahr



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!