简体   繁体   English

IntelliJ-查找未公开的公共方法

[英]IntelliJ - Find undocumented public methods

使用的IntelliJ IDEA 15, 我怎么能找到缺少的Javadoc,并因此导致SonarQube度量公共记录的API的下降,如图公共方法 在这里

IntelliJ has the ability to Inspect Code . IntelliJ具有检查代码的能力。

1. Adjust inspection settings 1.调整检查设置

In order to identify missing public documentation, firstly enable the issue Declaration has Javadoc problems . 为了识别缺少的公共文档,请首先启用声明具有Javadoc问题 You do this by opening the IDE Settings and select Editor -> Inspections . 通过打开IDE设置并选择编辑器->检查来执行此操作 In the right menu select Java -> Javadoc issues -> Declaration has Javadoc problems . 在右侧菜单中,选择Java-> Javadoc问题->声明有Javadoc问题 Activate this issue. 激活此问题。

在此处输入图片说明

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 . 确保对于选项卡方法 ,将范围设置为public Also check Ignore simple property access as you don't want to be informed of getters and setters lacking documentation. 还要选中“ 忽略简单的属性访问”,因为您不想被告知缺少文档的getter和setter。

在此处输入图片说明

Click OK to save. 单击确定保存。

2. Inspect the code 2.检查代码

In the top menu bar in IntelliJ open Analyze -> Inspect Code... , select how much shall be inspected and run it by clicking on OK . 在IntelliJ的顶部菜单栏中,打开Analyze-> Inspect Code ... ,选择要检查的数量,然后单击OK进行运行。 In the Inspection Results look for Javadoc issues -> Declaration has Javadoc problems . 检查结果中查找Javadoc问题->声明有Javadoc问题 Those issues stating Required Javadoc is absent are what you are looking for. 这些问题说明缺少所需的Javadoc

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM