在eclipse中检查样式的代码审查

问题描述 投票:0回答:1

我正在检查我的代码与检查风格。这是这个ide中的废物插件。

我不知道为什么我的代码总是显示missing javadoc comment.

即使我给出了适当的评论。

请问有没有办法以正确的方式审查代码。

我能制定自己的规则吗?

更新

每一行都显示缺少javadoc ...之后也发表评论

public class MyTest {

    /**
     * integer Variable I
     */
    public static int I = 10;

    /**
     * String Variable Name
     */
    public static String NAME = "XYZ";

    /**
     * Constructor
     */
    public MyTest() {
    }

    /**
     * Main method
     * @param args
     */
    public static void main(String[] args) {

        System.out.print(NAME+"\n"+I);
    }
}
java eclipse
1个回答
0
投票

您收到警告,因为缺少javadoc注释:示例

/**
 * Gets the distance between tw points.
 */
double getDistance(Point a, Point b);

此注释不完整,因为没有记录参数,但它是checkstyle将接受的最小值(在默认规则中)

同样必须为课程做,有时也为田地做。

您可以启用和禁用特定的checkstyle规则,但首先尝试编写代码,使默认规则(防晒检查)不会发出警告。

© www.soinside.com 2019 - 2024. All rights reserved.