Sonar代码质量管理

背景

在平时写代码的时候,为了代码规范和减少 bug 的数量,使用 SonarLint 插件进行代码检查无疑是一个很好的方法。Sonar 是一个用于代码质量管理的开源平台,用来管理源代码的质量,通过插件的形式支持包括 Java、C++、C语言等多种编程语言的代码质量管理与检测。

七个维度检测

序 号维 度检测内容
1不遵循代码标准更多操作Sonar 可以通过 PMD、CheckStyle、Findbugs 等代码规则检测工具来规范代码的编写
2潜在的缺陷Sonar 可以通过 PMD、CheckStyle、Findbugs 等代码规则检测工具检测出代码中存在的潜在的缺陷,如 NullPointerException 等
3糟糕的复杂度分布文件、类、方法等,如果复杂度过高将难以改变,这会使得开发人员难以理解它们,且如果没有自动化的单元测试,对于程序中的任何组件的改变都将可能导致需要全面的回归测试
4缺乏单元测试Sonar 可以很方便地统计和展示单元测试覆盖率
5重复一般来说,程序中尽量避免大面积的重复代码,复制粘贴的代码是质量低下的,Sonar 可以显示源代码中重复较严重的地方
6注释不足或者过多没有注释将使代码可读性变差,特别是当出现人事变动时,程序的可读性将大幅下降,而过多的注释又会使得开发人员过多地花费时间在阅读注释上
7糟糕的设计通过 Sonar 可以找出循环、展示包与包、类与类之间的相互依赖关系,可以检测出自定义的架构规则,通过 Sonar 可以管理第三方的 jar 包,可以利用 LCOM4 检测单个任务规则的应用情况,检测耦合

Sonar 默认扫描规则(Java 版)

关键词级别描述颜色
Block阻断红色-感叹号
Critical严重红色-向上箭头
Major主要红色-向上尖括号
Minor次要绿色-向下箭头
Info提示蓝色-倒立感叹号

在实际使用中,各个规则的等级以 SonarLint 插件的提示为准,一般建议的阿里中不要出现 Block 和 Critical 级别的提示。

序号规则Rule规则解释
1“.equals()” should not be used to test the values of “Atomic” classes equals()方法不应该用在原子类型的数据上(如:AtomicInteger, AtomicLong, AtomicBoolean)
2“==” and “!=” should not be used when “equals” is overridden如果继承自对象的 equals method 没有被重写,则使用等号"=="操作符和 equals 方法来比较两个对象是等价的,否则不能用等号操作符
3“@CheckForNull” or “@Nullable” should not be used on primitive types“@CheckForNull"或者”@Nullable"注解不应该用于基本类型(byte, short, int, long, float, double, boolean, char)
4“@Controller” classes that use “@SessionAttributes” must call “setComplete” on their “SessionStatus” objects使用了"@SessionAttributes"注解的"@Controller"类必须在其"SessionStatus"对象上调用"setComplete"
5“@Deprecated” code should not be used被 @Deprecated 注解标注的代码不应该被使用
6“@EnableAutoConfiguration” should be fine-uned"@EnableAutoConfiguration"缺点是它可能加载和配置应用程序永远不会使用的 bean,因此会消耗比实际需要更多的 CPU 和 RAM。@EnableAutoConfiguration 应该配置为排除应用程序不需要的所有 bean
7"@Import"s should be preferred to "@ComponentScan"s由于 @ComponentScan 会减慢项目启动的速度,应该选择显式引入 jar 包的"@Import"注解,而不是"@ComponentScan"注解
8“@NonNull” values should not be set to null@NonNull 注解修饰的字段不能被赋为 null, 标记为 @NotNull、@NonNull 或 @NonNull 的字段、参数和返回值通常在使用前不检查空值。将这些值中的一个设置为 null,或者在构造函数中没有设置这样的类 fieldin,可能会在运行时导致 NullPointerException
9“@Override” should be used on overriding and implementing methods在重写和实现方法时,需要添加"@Override"注解
10“@RequestMapping” methods should be “public”"@RequestMapping"注解应该用来修饰 public 方法/类
11“@RequestMapping” methods should specify HTTP method@RequestMapping 应该显式的指定 HTTP 请求的类型
12“@SpringBootApplication” and “@ComponentScan” should not be used in the default package“@SpringBootApplication"和”@ComponentScan"注解不应该在默认包中使用
13“=+” should not be used instead of “+=”“=+“不可以替代”+=”
14“action” mappings should not have too many “forward” entriesaction 映射不应该有太多的"forward"实体
15“Arrays.stream” should be used for primitivearrays流应该被用在基本类型数组上
16“Bean Validation” (JSR 380) should be properly configured“Bean Validation” (JSR 380)应该被正确的配置,未添加 @Valid 注解时,Bean Validation 校验将不会生效
17“BigDecimal(double)” should not be used由于精度的原因,BigDecimal(double) 类型不应该被使用,往往会使用 valueof() 方法将 double 类型数据进行转化
18Reflection should not be used to increase accessibility of classes, methods, or fields
19This accessibility update should be removed.
20“catch” clauses should do more than rethrowcatch 捕获到异常之后,不应该仅仅只是抛出异常
21“Class.forName()” should not load JDBC 4.0+ drivers"Class.forName()"不应该加载 JDBC 4.0+ 驱动程序
22“clone” should not be overriddenclone() 方法不应该被重写,重写可能导致浅克隆的问题
23“Cloneables” should implement “clone”Cloneables 接口需要实现 clone() 方法
24“close()” calls should not be redundant不应该有多余的 close() 方法的调用
25“collect” should be used with “Streams” instead of “list::add”使用 Streams 时,应该用 collect,因为 collect 的进程是并行且安全的
26“Collections.EMPTY_LIST”, “EMPTY_MAP”, and “EMPTY_SET” should not be used因为"Collections.EMPTY_LIST", “EMPTY_MAP”, and "EMPTY_SET"会返回默认的集合,会导致对于返回值判 null 的步骤缺失的问题,不推荐使用
27“compareTo” results should not be checked for specific values"compareTo"结果不应检查特定值,通常检查 >0 或者 <0
28" compareTo" should not be overloadedcompareTo 参数个数不应该超出声明的个数
29“compareTo” should not return “Integer.MIN_VALUE”compareTo 的返回值不能是 Integer.MIN_VALUE
30“DateUtils.truncate” from Apache Commons Lang library should not be usedApache Commons Lang 的日期截取方法 DateUtils.truncate() 不会四舍五入,不应该被使用
31“default” clauses should be lastswitch中 default 应该被放在最后
32“DefaultMessageListenerContainer” instances should not drop messages during restartsDefaultMessageListenerContainer 实例不应该在重启期间删除消息
33“deleteOnExit” should not be usedjava 程序执行结束后,有自己的回收机制,不需要用 deleteOnExit 回收临时文件
34“Double.longBitsToDouble” should not be used for “int”int 类型的数据转换为 lone double 会存在精度问题,不应该这样使用
35“entrySet()” should be iterated when both the key and value are needed在需要获取 map 中的键值对 key 和 value 时,应该用 entryset() 方法
36“enum” fields should not be publicly mutable集合类型的值不应该是可变的
37“equals” method overrides should accept “Object” parameters重载的 equals 方法,应该能接受 object 类型的参数
38“equals” method parameters should not be marked “@Nonnull”equals 方法的参数不应该被 @Nonnull 注解修饰,equals() 方法可以接受为 null 的数据
39“equals” methods should be symmetric and work for subclassesequals 方法可以应用于子类,因为"=="操作符需要保证两端数据的对称性,但父类不是子类的实例
40“equals(Object obj)” and “hashCode()” should be overridden in pairsequals(Object obj) 和 hashCode() 应该成对出现
41“equals(Object obj)” should be overridden along with the “compareTo(T obj)” methodequals(Object obj) 和 compareTo(T obj) 应该一起重写
42“equals(Object obj)” should test argument type因为 equals 方法能接受泛型参数,所以需要对于传递的参数类型进行验证
43“Exception” should not be caught when not required by called methods当调用的方法不需要捕获异常时,不应该捕获到异常(主要针对于运行时异常和检查异常) 运行时如果异常应该能正常捕获到,并提醒开发人员调整
43“Externalizable” classes should have no-arguments constructorsExternalizable 类需要有无参构造函数
44“File.createTempFile” should not be used to create a directoryFile.createTempFile 不够安全,不应该用于创建新的目录
45“final” classes should not have “protected” membersfinal 类是不可被继承的,不应该有 protected 类型的元素
46“finalize” should not set fields to “null”finalize 修饰的空间不应该被置为 null
47“for” loop increment clauses should modify the loops’ counters循环增量子句应该修改计数器
48“for” loop stop conditions should be invariant循环停止的条件应该是不可变的
49“getClass” should not be used for synchronizationgetClass() 方法不应该被用在 synchronization 修饰的方法中
50“hashCode” and “toString” should not be called on array instancesarray 实例中不应该使用 hashCode 和 toString 方法
51“HostnameVerifier.verify” should not always return trueHostnameVerifier.verify 不应该一直返回 true
52“HttpOnly” should be set on cookies应该在 cookies 中设置 HttpOnly 属性,可以有效地防止XSS攻击
53“HttpSecurity” URL patterns should be correctly ordered用 HttpSecurity 方法配置 url 应该按照一定的声明顺序
54“HttpServletRequest.getRequestedSessionId()” should not be used不应该使用 HttpServletRequest.getRequestedSessionId() 方法获取 sessionId
55“if … else if” constructs should end with “else” clausesif … else if 结构应该以 else 语句结束
56“indexOf” checks should not be for positive numbersindexOf() 方法结果判断不应该仅针对于正数
57“indexOf” checks should use a start positionindexOf 方法应该传入起始地址参数
58“instanceof” operators that always return “true” or “false” should be removed如果 instanceof 操作符的结果一直返回 true 或者 false,那么相关的调用语句应该被删除
59“Integer.toHexString” should not be used to build hexadecimal stringsInteger.toHexString 方法不应该用于构建16进制字符串
60“InterruptedException” should not be ignored不应该忽略 InterruptedException(方法阻塞)报错
61“iterator” should not return “this”iterator() 方法不应该返回 this
62“Iterator.hasNext()” should not call“Iterator.next()” Iterator.hasNext() 是判断是否有下一个元素,但并不会改变指针指向,而 next() 会改变指针指向,如果没有下一个元素,会直接报空指针异常
63“Iterator.next()” methods should throw “NoSuchElementException”Iterator.next() 方法应该抛出 NoSuchElementException 异常
64“java.lang.Error” should not be extendedjava.lang.Error 不应该被继承
65“java.nio.Files#delete” should be preferred因为 java.nio.Files#delete 会抛异常并说明异常的原因,所以在删除文件时应优先考虑 java.nio.Files#delete 方法
66“java.time” classes should be used for dates and times获取日期或者时间,应该使用 java.time 方法
67“javax.crypto.NullCipher” should not be used for anything other than testingjavax.crypto.NullCipher 应该只用于测试
68“Lock” objects should not be “synchronized”被锁定的对象不应该被 synchronized 修饰
69“main” should not “throw” anythingmain 方法不应该抛出任何异常
70“Map.get” and value test should be replaced with single method call需要同时获取 map 的键值对时,应该使用单个的获取方法
71“notifyAll” should be used应该使用 notifyAll() 方法唤醒所有休眠的进程
72“null” should not be used with “Optional”Optional 修饰的对象不应该被赋值为 null
73“Object.finalize()” should remain protected (versus public) when overridingObject.finalize() 方法应该只有垃圾回收器才可以调用
74“Object.wait(…)” and “Condition.await(…)” should be called inside a “while” loopObject.wait(…)和 condition .wait(…) 应该在 while 循环中调用
75“Object.wait(…)” should never be called on objects that implement “java.util.concurrent.locks.Condition”实现"java.util.concurrent.locks.Condition"的对象不应该调用"Object.wait(…)"方法
76“Preconditions” and logging arguments should not require evaluation先决条件和日志参数不应该需要计算,换言之,在调用"Preconditions"和 logging() 方法时,参数应该是可确定的
77“PreparedStatement” and “ResultSet” methods should be called with valid indices应该使用有效的索引(>0)调用"PreparedStatement"和"ResultSet"方法,因为"PreparedStatement"和"ResultSet"方法的索引都是从1开始
78“private” methods called only by inner classes should be moved to those classes只由内部类调用的私有方法应该放到这些类里
79“public static” fields should be constant公共静态字段应该是常量
80“Random” objects should be reused应该重用随机对象 随机数种子在创建一个 random 对象的时候生成,相同的随机数种子,产生相同随机数的几率非常高
81“read” and “readLine” return values should be used“read” 和 "readLine"返回值应该被使用
82“read(byte[],int,int)” should be overriddenread(byte[],int,int) 方法应该被重载
83“readObject” should not be “synchronized”readObject 方法不应该被同步修饰符(synchronized)修饰
84“readResolve” methods should be inheritable"readResolve"方法应该是可继承的,因为 readResolve() 允许在反序列化期间对于对象的状态进行微调
85“ResultSet.isLast()” should not be used不应该使用"ResultSet.isLast()"方法,因为 .isLast() 方法会将指针的指向移动到下一个元素上,从而可能导致空指针,而 .next() 方法则是先判断下一个元素是否存在
86“runFinalizersOnExit” should not be called不应该调用"runFinalizersOnExit",因为 runFinalizersOnExit() 方法可能导致正在被其他进程调用的对象被终止,是不安全的
87“ScheduledThreadPoolExecutor” should not have 0 core threadsScheduledThreadPoolExecutor(任务调度进程池)的大小和 corePoolSize 的一致,所以核心进程的个数不能为0
88“SecureRandom” seeds should not be predictable安全随机数种子不应该是可预测的
89“Serializable” inner classes of non-serializable classes should be “static”序列化/反序列化方法应该是被 static 修饰符修饰的
90“SingleConnectionFactory” instances should be set to “reconnectOnException”“SingleConnectionFactory"实例应该设置为"reconnectOnException”,因为在不启用 reconnectOnException 设置的情况下使用 SingleConnectionFactory 将在连接出错时无法自动恢复连接
91“StandardCharsets” constants should be preferred应该首先考虑标准字符集(ISO_8859_1、US_ASCII、UTF_16 、UTF_16BE 、UTF_16LE 、UTF_8)
92“static” members should be accessed statically静态常量应该被静态访问
93“Stream” call chains should be simplified when possible流的方法调用应当尽可能的简洁
94“Stream.peek” should be used with caution.peek() 方法主要用于 debug,而且仅在对流内元素进行操作时,peek() 才会被调用,所以在使用时需要谨慎
95“StringBuilder” and “StringBuffer” should not be instantiated with a character"StringBuilder"和"StringBuffer"不应该被单个字符实例化
96“super.finalize()” should be called at the end of “Object.finalize()” implementationssuper.finalize() 应该在 Object.finalize() 方法中最后一行被调用,防止系统资源冲突
97“switch” statements should have “default” clausesswitch() 方法中需要用 default 子句,控制除了 case 以外的其他场景
98“switch” statements should have at least 3 “case” clausesswitch() 方法至少需要有3个 case 子句,case 子句 <=2 的场景,用 if…else 即可
99“switch” statements should not contain non-case labelsswitch 语句不应该包含无 case 关键字的列举情况
100“switch” statements should not have too many “case” clausesswitch 语句不应该包含太多(>30)的 case 子句,子句太多时,用 map 的性能会更高
101“Thread.run()” should not be called directlyThread.run() 方法不应该被直接调用,因为 Thread.run() 方法会导致代码在当前进程中被执行
102“Thread.sleep” should not be used in testsThread.sleep() 方法不应该在测试过程中被调用
103“ThreadGroup” should not be usedThreadGroup() 不应该被调用
104“ThreadLocal.withInitial” should be preferred应优先考虑 ThreadLocal.withInitial() 方法
105“Threads” should not be used where “Runnables” are expected线程不应该使用在预期可运行项的地方
106“throws” declarations should not be superfluousthrows 声明不应该抛出多个异常
107“toArray” should be passed an array of the proper type在没有参数的情况下,.toArray() 方法将会返回一个 object,若用 .toArray() 方法来转换固定类型的数组,需要将正确类型的参数传入
108“toString()” and “clone()” methods should not return nulltoString() 和 clone() 方法,不应该返回 null
109“toString()” should never be called on a String object 在 String 对象上不应该调用 toString() 方法
110“URL.hashCode” and “URL.equals” should be avoided url 的equals 和 hashCode 方法都可能触发名称服务(通常是DNS)查找来解析主机名或 IP 地址。根据配置和网络状态,这可能需要很长时间,应该避免调用 “URL.hashCode” 和 “URL.equals”
111“volatile” variables should not be used with compound operators对被 volatile 修饰的变量不应该进行复合型操作符运 算(应该只进行原子运算)
112“wait” should not be called when multiple locks are held当持有多个锁时,不应调用"wait"
113“wait”, “notify” and “notifyAll” should only be called when a lock is obviously held on an object“wait”、"notify"和"notifyAll"只应在对象上明显持有锁时(如被synchronized修饰)调用
114“wait(…)” should be used instead of “Thread.sleep(…)” when a lock is held如果在当前线程持有锁时调用 thread .sleep(…),可能会导致性能和可伸缩性问题,或者更糟的情况是死锁。所以当锁被持有时,应该使用"wait(…)"而不是"Thread.sleep(…)"方法
115“write(byte[],int,int)” should be overridden当直接子类化 java.io.OutputStream 或者 java.io.FilterOutputStream 时,因为不能每次传递一个 byte 的数据,"write(byte[],int,int)"方法应该被重写
116“writeObject” should not be the only “synchronized” code in a class"writeObject"不应该是类中唯一的"synchronized"修饰符修饰的方法
117A “for” loop update clause should move the counter in the right directionfor 循环更新子句应该将计数器移动到正确的方向
118A “while” loop should be used instead of a “for” loop当 for 循环中只定义了条件表达式,并且缺少初始化和增量表达式时,应该使用while循环来增加可读性
119A conditionally executed single line should be denoted by indentation有 if 条件执行的单行应该用缩进表示(未添加{}时)
120A field should not duplicate the name of its containing class字段不应重复其包含的类的名称
121Abstract classes without fields should be converted to interfaces没有字段的抽象类应该转换为接口 接口是为了暴露给外部,内部抽象类被继承即可
122Abstract methods should not be redundant抽象方法不应该是多余的
123Accessing Android external storage is security-sensitive访问 Android 外部存储是安全敏感的
124AES encryption algorithm should be used with secured modeAES 加密算法应采用安全模式(ECB 模式并不安全,不建议用 ECB 进行组合)
125All branches in a conditional structure should not have exactly the same implementation条件结构(if…else/switch等)中不建议有相同操作的分支
126An iteration on a Collection should be performed on the type handled by the Collection对集合的迭代应该是对集合所处理的类型执行
127Annotation repetitions should not be wrapped不应该重复包装注解
128Anonymous inner classes containing only one method should become lambdas只包含一个方法的匿名内部类应该成为 lambdas
129Array designators “[]” should be located after the type in method signatures数组指示符"[]"应该位于方法签名中的类型之后
130Array designators “[]” should be on the type, not the variable数组指示符"[]"应该位于类型后,而不是变量后
131Arrays should not be created for varargs parameters不应该为不定长参数参数创建数组
132Assertion arguments should be passed in the correct order应该按照正确的顺序传递断言参数
133Assertions should be complete断言应该是完整的
134Asserts should not be used to check the parameters of a public method断言不应用于检查公共方法的参数
135Assignments should not be made from within sub-expressions不应该在子表达式中进行赋值
136Assignments should not be redundant任务不应该是多余的
137Authentication should not rely on insecure “PasswordEncoder”身份验证不应该依赖于不安全的密码编码器
138Basic authentication should not be used不应该使用 Basic 身份认证方式 Basic 身份认证方式是当前最常用的方式,Base64 编码加密后,配合 username+password 可以满足通常的需求
139Blocks should be synchronized on “private final” fields块应该在"private final"修饰的字段上同步
140Boolean checks should not be inverted不应该使用反转布尔操作
141Boolean expressions should not be gratuitous布尔表达式不应该是完全不变的(应该有改变其值的操作)
142Boolean literals should not be redundant不应该进行无意义的布尔计算(如表达式和 true/false 判等、表达式反转等)
143Boxing and unboxing should not be immediately reversed装箱(创建 int/Integer 类型值的对象)和拆箱(将对象中原始值解出来)不应连续操作
144Broadcasting intents is security-sensitive广播意图是不安全的
145Case insensitive string comparisons should be made without intermediate upper or lower casing不区分大小写的字符串比较应该在没有中间大小写转化的情况下进行
146Catches should be combined相同代码块的 Catches 异常操作应该合并
147Changing or bypassing accessibility is security-sensitive更改或绕过可访问性检查是不安全的
148Child class fields should not shadow parent class fields子类不应该有和父类的字段名相同的字段
149Child class methods named for parent class methods should be overrides子类中重写的与父类方法命名一致的方法,static 修饰符等也要和父类保持一致
150Class names should comply with a naming convention类名应该符合命名约定
151Class names should not shadow interfaces or superclasses类名不应和他实现的接口或父类命名相同
152Class variable fields should not have public accessibility类变量字段应该是私有的
153Classes extending java.lang.Thread should override the “run” method扩展的 java.lang 线程应该是有重载的 run() 方法
154Classes from “sun." packages should not be used "sun.packages 不应该被使用,几乎总是有应该使用的 Java API 类包装
155Classes named like “Exception” should extend “Exception” or a subclass像"Exception"这样命名的类应该继承了"Exception"或其子类,否则不符合清晰、交流式的命名规范
156Classes should not access their own subclasses during initialization类在初始化期间不应该访问它们自己的子类
157Classes should not be compared by name类不应该按名称进行比较
158Classes should not be empty类不应该是空的
159Classes that override “clone” should be “Cloneable” and call“super.clone()” 重载了 clone() 方法的类应该是实现 Cloneable 接口的,并且调用了 super.clone() 方法
160Classes with only “static” methods should not be instantiated只有静态方法的类不应该被实例化
161Cognitive Complexity of methods should not be too high方法的功能复杂度不应过高
162Collapsible “if” statements should be merged应该合并无需分层的"if"语句
163Collection sizes and array length comparisons should make sense集合大小和数组长度比较应该是有意义的
164Collection.isEmpty() should be used to test for emptiness应该使用 Collection.isEmpty() 来判断是否为空
165Collections should not be passed as arguments to their own methods集合不应该作为参数传递给它们自己的方法
166Composed “@RequestMapping” variants should be preferred应该首选组合的"@RequestMapping"变体(@GetMapping、@PostMapping)
167Conditionally executed blocks should be reachable条件执行的块应该都是可以访问(不能导致死锁)
168Conditionals should start on new lines条件句应该从新行开始(if…else…/if…else if…/if…)
169Configuring loggers is security-sensitive配置日志记录器是不安全的 配置日志记录器是不安全的
170Constant names should comply with a naming convention常量名称应该符合命名约定
171Constants should not be defined in interfaces常量不应该在接口中定义
172Constructors should not be used to instantiate “String”, “BigInteger”, “BigDecimal” and primitive-wrapper classes构造函数不应该用于实例化"String"、“BigInteger”、"BigDecimal"和原子类包装
173Consumed Stream pipelines should not be reused使用的流管道不应重用
174Controlling permissions is security-sensitive权限控制是不安全的 有权限划分控制,才能满足不同的用户权限的不同,从而抵御黑客攻击
175Cookie domains should be as narrow as possibleCookie 域设置应该尽可能的详细
176Creating cookies without the “secure” flag is security-sensitive创建没有"secure"标志的 cookie 是不安全的
176Credentials should not be hard-coded凭证不应该直接赋值(需要通过调用方法等方式去获取)
177Cryptographic keys should not be too short秘钥不应该太短(对于Blowfish算法,密钥至少128位长,对于RSA算法,密钥至少2048位长。)
178Cryptographic RSA algorithms should always incorporate OAEP (Optimal Asymmetric Encryption Padding)密码 RSA 算法应该始终包含 OAEP(最佳非对称加密填充)
179Custom serialization method signatures should meet requirements自定义序列化方法签名应满足要求(作用域的限制等)
180Databases should be password-protected数据库应该有密码保护
181Dead stores should be removed死存储的变量代码应该被移除
182Declarations should use Java collection interfaces such as “List” rather than specific implementation classes such as “LinkedList”类中字段声明应该使用 Java 集合接口,如"List"、“Set”
183Default EJB interceptors should be declared in “ejb-jar.xml”缺省 EJB 拦截器应该在 EJB-jar.xml 中声明。
184Defined filters should be used已定义的过滤器应该被调用
185Delivering code in production with debug features activated is security-sensitive在生产环境中交付被激活的调试特性的代码是不安全的
186Dependencies should not have “system” scope依赖声明中不应该包含 system scope
187Deprecated “${pom}” properties should not be used弃用的 ${pom} 特性不应该再被使用
188Deprecated code should be removed弃用的代码应该被删除
189Deprecated elements should have both the annotation and the Javadoc tag被弃用的代码块应该添加 @Deprecated 注解以及标签
190Deserializing objects from an untrusted source is security-sensitive从不可信源反序列化对象是不安全的
191Deserializing with XMLDecoder is security-sensitive反序列化 XMLDecoder 对象是不安全的
192Disabling Spring Security’s CSRF protection is security-sensitive禁用spring 的跨域资源共享(CSRF)保护是不安全的
193Dissimilar primitive wrappers should not be used with the ternary operator without explicit casting在没有显式强制转换的情况下,不应该将不同的基本类型与三元运算符一起使用
194Double Brace Initialization should not be used不应该使用双花括号初始化
195Double-checked locking should not be used不应该使用双重检查锁定
196Empty arrays and collections should be returned instead of null需要返回数组/集合的方法,应该返回空数组/集合,而不是 null
197Empty statements should be removed应该删除空语句
198Enabling Cross-Origin Resource Sharing is security-sensitive启用跨域资源共享是不安全的
199Encrypting data is security-sensitive(不具备随机性的)加密数据是不安全的
200Enumeration should not be implemented枚举不应该像其他接口一样被实现,而复制后的迭代器是可以被实现的
201Exception classes should be immutable异常类应该是不可变的
202Exception should not be created without being thrown创建的异常应该被抛出
203Exception types should not be tested using “instanceof” in catch blocks不应该在 catch 代码块中用instanceof 对异常的类型进行判断处理
204Exceptions should be either logged or rethrown but not both异常应该被记录或者抛出,但不能同时被记录和抛出 存在通过日志将异常打印,同时让异常被其他的进行捕获的场景
205Exceptions should not be thrown from servlet methods不应该从 servlet 方法中抛出异常
206Exceptions should not be thrown in finally blocks不应该在 finally 中抛出异常
207Execution of the Garbage Collector should be triggered only by the JVM垃圾回收器只能由 JVM 触发
208Expanding archive files is security-sensitive展开归档文档是不安全的(应该验证归档文件展开的路径;不应展开到可以展开存档文件的根目录之外;应用程序应该控制扩展数据的大小,以避免成为 Zip 炸弹攻击的受害者)
209Expressions used in “assert” should not produce side effects“断言”中使用的表达式不应该需要计算(由于 assert 语句在默认情况下不被执行(断言必须使用 JVM 标志启用),永远不应该依赖于他们的解决方案来评估正确程序功能所需的任何逻辑。)
210Factory method injection should be used in “@Configuration” classes当在 @Configuration 修饰的类中使用 @Autowired 时,依赖关系需要在类实例化前得到解决,这可能会导致 bean 的早期初始化出问题,或者导致上下文查找不应该找到 bean 的位置。为了避免这个棘手的问题并优化上下文加载的方式,应该尽可能晚地请求依赖项。这意味着对于仅在单个 @Bean 方法中使用的依赖项,使用参数注入而不是字段注入
211Field names should comply with a naming convention字段名应该符合命名约定(正则表达式)
212Fields in a “Serializable” class should either be transient or serializable可序列化类中的字段应该是可转换的或可序列化的
213Fields in non-serializable classes should not be “transient”不可序列化的类中的字段不应该被"transient"关键字修饰
214Files opened in append mode should not be used with ObjectOutputStream在 append 模式下打开的文件不应该和 ObjectOutputStream一起使用
215Formatting SQL queries is security-sensitive格式化 SQL 查询是不安全的
216Future keywords should not be used as names关键字不应该用作名称,可能无法被解析
217Generic exceptions should never be thrown永远不应该抛出泛型异常
218Generic wildcard types should not be used in return parameters方法返回的参数类型不应该是泛型 可以对于子类继承的父类A和子类A1本身进行相同的操作,但是返回的类型不同,此处需要返回参数为泛型
219Getters and setters should access the expected fields getter 和 setter方法应该访问预期的字段
220Getters and setters should be synchronized in pairsgetter 和 setter 应该成对同步
221Hashing data is security-sensitive哈希数据是不安全的(为了安全目的,只使用目前已知较强的哈希算法。完全避免在安全上下文中使用 MD5 和 SHA1 之类的算法。)
222Hibernate should not update database schemas Hibernate不应该更新数据库模式(hibernate.hbm2ddl.auto 只有在 validate 时才可以使用,否则可能导致数据库的模式被更改)
223Identical expressions should not be used on both sides of a binary operator不应该在二元操作符的两边使用相同的表达式
224IllegalMonitorStateException should not be caught不应该捕获非法的 MonitorStateException 异常
225Inappropriate “Collection” calls should not be made不应该做不合适的 Collection 方法调用(当提供给 Collection.remove() / Collection.contains() 方法的对象的实际类型与集合实例化的 declaredon 类型不一致时,这些方法总是返回 false 或 null)
226Inappropriate regular expressions should not be used不应该使用不合适的正则表达式
227Inheritance tree of classes should not be too deep类的继承树不应该太深(限制5层)
228Inner class calls to super class methods should be unambiguous对超类方法的内部类的调用应该是明确的
229InputSteam.read() implementation should not return a signed byteInputSteam.read() 的实现不应该返回带符号的字节(java 文档注明,InputSteam.read() 方法的值字节必须是0到255范围内的整数。如果由于到达了流的末尾而没有可用的字节,则返回值启用1。)
230Instance methods should not write to “static” fields"static"字段不应该在实例方法中处理
23Interface names should comply with a naming convention接口的命名应该符合命名规范
231Intermediate Stream methods should not be left unused中间流方法不应该闲置,应该提供对应的终端操作(流操作有两种类型:中间操作(返回另一个流)和终端操作(返回比流更多的内容)。中间操作是惰性的,如果中间流操作的结果没有提供给终端操作,那么它就没有任何作用)
232Ints and longs should not be shifted by zero or more than their number of bits-1int 和 long 类型数据的位移不应该 > 或者等于0
233Invalid “Date” values should not be used不应使用无效的日期值(需要确定year\month\day的有效取值范围)
234Java 8 features should be preferred to GuavaJava 8 特性应该优先于 Guava 特性(Guava 特性修复了 java 7 中一些缺少的 Api,在 java8 中,这些 Api 被修复)
235Java 8’s “Files.exists” should not be usedJava 8 中不应该使用"Files.exists"方法(exists 方法在 JDK 8 中性能明显较差,当用于检查实际上不存在的文件时,会显著降低应用程序的运行速度。)
236Jump statements should not be redundant不应该有多余的跳转语句
237Jump statements should not occur in “finally” blocks跳转语句(break, continue, return, throw, goto)不应该出现在 finally 代码块中
238JUnit assertions should not be used in “run” methodsJUnit 断言不应该在"run"方法中使用
239JUnit framework methods should be declared properly应该正确地声明JUnit框架方法(命名要正确)
240JUnit rules should be used应该使用 JUnit 规则(没有被使用的任何测试类字段都不应该被定义)
241JUnit test cases should call super methodsJUnit 测试用例应该调用 super() 方法
242Labels should not be usedLabels 不应该被使用
243Lambdas containing only one statement should not nest this statement in a block只包含一条语句的 Lambdas(匿名函数)不应该将此语句嵌套在块中(无需用{})
244Lambdas should be replaced with method references应该用方法引用替换 Lambdas(匿名函数)
245LDAP connections should be authenticated应该对 LDAP 连接进行身份验证
246LDAP deserialization should be disabled应该禁用 LDAP 反序列化
247Local variable and method parameter names should comply with a naming convention局部变量和方法参数的名称应该符合命名约定
248Local variables should not be declared and then immediately returned or thrown不应该在声明局部变量后,立即将变量返回或抛出
249Local variables should not shadow class fields局部变量不应该和类字段同名
250Locks should be released锁应该被释放
251Loggers should be named for their enclosing classes日志记录器应该用他们的封闭类来命名
252Loop conditions should be true at least once循环体至少需要被执行一次
253Loops should not be infinite循环不应该是无限的
254Loops should not contain more than a single “break” or “continue” statement循环应该只包含一个"break"或"continue"语句
255Loops with at most one iteration should be refactored最多只执行一次的循环应该被重构
256Map values should not be replaced unconditionally不应该无条件的替换映射(Map)值
257Maps with keys that are enum values should be replaced with EnumMap带有 enum 值键的映射应该替换为 EnumMap
258Math operands should be cast before assignment应该在数学计算之前,至少对一个操作数完成对最终类型的强制类型转换
259Method names should comply with a naming convention方法的命名应该满足命名规则
260Method overrides should not change contracts方法重写不应更改约定(超类方法参数如果被 @Nullable、@CheckForNull、@NotNull、@NonNull 和 @NonNull 修饰,则子类重写的方法参数也应该有相应的限制)
261Method parameters, caught exceptions and variables’ initial values should not be ignored方法参数、捕获的异常和 foreach 变量的初始值不应该被忽略
262Methods “wait(…)”, “notify()” and “notifyAll()” should not be called on Thread instances方法"wait(…)","notify()"和"notifyAll()"不应该在线程实例上调用
263Methods and field names should not be the same or differ only by capitalization类里面的方法和字段名不应该完全相同或者仅大小写不同
264Methods and field names should not be the same or differ only by capitalization在随机整数生成中,不应该使用返回浮点值的随机方法
265Methods returns should not be invariant方法返回不应该是不变的
266Methods should not be empty方法不应该是空的
267Methods should not be named “tostring”, “hashcode” or “equal”方法不应该被命名为"tostring"、“hashcode"或"equal”
268Methods should not call same-class methods with incompatible “@Transactional” values方法不应该调用具有不兼容的"@Transactional"值的同类方法
269Methods should not have identical implementations两个方法不应该有相同的实现
270Methods should not have too many parameters方法不应该有太多的参数
271Methods should not return constants方法不应该返回常量
272Min and max used in combination should not always return the same value组合使用的 Min 和 Max 不应该总是返回相同的值
273Modifiers should be declared in the correct order修饰符应该按照正确的顺序声明
274Multiline blocks should be enclosed in curly braces多行代码块应该用大括号括起来
275Multiple variables should not be declared on the same line多个变量不应该在同一行中声明
276Mutable fields should not be “public static”可变字段不应该是"public static"
277Neither “Math.abs” nor negation should be used on numbers that could be “MIN_VALUE”Math.abs 和逻辑非的运算不应该作用在可以设置为 MIN_VALUE 的数字上
278Neither DES (Data Encryption Standard) nor DESede (3DES) should be used不应该使用 DES(数据加密标准)或 DESede (3DES)
279Nested "enum"s should not be declared static嵌套的枚举类型不应该声明为静态的
280Nested blocks of code should not be left empty嵌套的代码块不应该是空的
281Nested code blocks should not be used不应该使用嵌套代码块
282Non-constructor methods should not have the same name as the enclosing class非构造函数方法不应该具有与所包含类相同的名称
283Non-primitive fields should not be “volatile”非基础字段(数组、对象等)不应该被 volatile 修饰符修饰
284Non-public methods should not be “@Transactional”不应该在非 public 方法上添加 @Transactional注解
285Non-serializable classes should not be written类应该都是可序列化的
286Non-serializable objects should not be stored in “HttpSession” objects不可序列化的对象不应该存储在"HttpSession"对象中
287Non-thread-safe fields should not be static非线程安全字段不应该是静态的
288Null checks should not be used with “instanceof”判空检查不应与"instanceof"一起使用
289Null pointers should not be dereferenced不应该取消对空指针的引用
290Null should not be returned from a “Boolean” method不应该从返回值为布尔类型的方法返回 Null
291Nullness of parameters should be guaranteed应保证方法参数不为空
292Objects should not be created only to “getClass”对象不应该只为了"getClass"方法创建(仅仅为了调用 getClass 而创建对象是对内存和周期的浪费)
293Only static class initializers should be used应该只使用静态初始化方法
294Optional value should only be accessed after calling isPresent()在调用 get() 方法之前,应该先判空处理
295Overrides should match their parent class methods in synchronization子类重写的方法应该与父类方法的同步保持一致
296Overriding methods should do more than simply call the same method in the super class子类中重写一个方法不应该只是为了简单的调用父类的同名方法
297Package declaration should match source file directory包声明应该匹配源文件目录
298Package names should comply with a naming convention包的名称应该符合命名规则
299Packages containing only “package-info.java” should be removed只包含"package-info.java"包应该被删除
300Parameters should be passed in the correct order方法的参数应该按照正确的顺序传递
301Parentheses should be removed from a single lambda input parameter when its type is inferred带单参数的 lambda(匿名函数),应该将该参数的圆括号删除
302Parsing should be used to convert “Strings” to primitives可以使用解析方法将 String 解析为期望的基本类型
303Persistent entities should not be used as arguments of “@RequestMapping” methods持久化实体不应该用作"@RequestMapping"方法的参数
304Primitive wrappers should not be instantiated only for “toString” or “compareTo” calls应该使用基本包装器类的静态 toString() 或 compare() 方法
305Primitives should not be boxed just for “String” conversion不应该为了调用 toString() 方法而将基本类型的数据进行类型转换
306Printf-style format strings should be used correctlyPrintf 启用 style 格式字符串应该被正确使用(Printf-style 的字符串是在运行时解释的,而不是由编译器验证的,所以它们可能包含导致创建错误字符串的错误)
307Printf-style format strings should not lead to unexpected behavior at runtimePrintf-style 格式字符串不应该在运行期间导致意外的操作发生
308Private fields only used as local variables in methods should become local variables只在方法中用作局部变量的私有字段应该设置为局部变量
309Public constants and fields initialized at declaration should be “static final” rather than merely “final”在初始化时声明的公共常量和字段应该是"static final",而不仅仅是"final"
310Raw byte values should not be used in bitwise operations in combination with shifts带符号的原始字节值不应该进行位移操作
311Reading the Standard Input is security-sensitive读取标准输入的数据是不安全的
312Receiving intents is security-sensitive公开的接收器是不安全的
313Redundant casts should not be used不应该使用冗余类型转换
314Redundant pairs of parentheses should be removed应该删除多余的括号
315Reflection should not be used to check non-runtime annotations反射不应用与检查非运行时注解(只有已被赋予运行时保留策略的注释才可用于反射。使用其他保留策略测试总是返回 false)
316Related “if/else if” statements should not have the same condition相关的 if…/else if… 代码块中不应该有相同的判断条件
317Resources should be closed(实现 close-able 接口或其超级接口 autoclose-able 的连接、流、文件和其他)类在使用后需要关闭。必须在 finally 块 else 中执行 close 调用,否则将无法执行调用
318Return of boolean expressions should not be wrapped into an “if-then-else” statement布尔表达式的返回不应该封装到"if-then-else"语句中
319Return values from functions without side effects should not be ignored不应该忽略没有副作用的函数的返回值(可能是无效代码,或者代码的效果与预期不符)
320Return values should not be ignored when they contain the operation status code不应该忽略返回值中包含的操作状态代码
321Sections of code should not be commented out不应该保留被注释的代码
322Sending emails is security-sensitive代码中发送电子邮件是不安全的
323Servlets should not have mutable instance fields Servlets实例中不应该包含可变的字段
324Setting JavaBean properties is security-sensitive设置 JavaBean 属性是不安全的
325Short-circuit logic should be used in boolean contexts短路逻辑应该在布尔上下文中使用
326Silly bit operations should not be performed有些可预期得到结果的位操作(如 & 1得到原始值)是不需要执行的
327Silly equality checks should not be made一些对等检查是不需要做的(不同类型的判等、两个数组的判等)
328Silly math should not be performed一些可预测结果的数学运算不需要做(如 x % 1)
329SMTP SSL connection should check server identitySMTP SSL 连接应该检查服务器标识
330Source files should not have any duplicated blocks原文件中不应该存在重复的块
331Standard outputs should not be used directly to log anything应该使用日志程序记录输出内容(便于检索)
332Static fields should not be updated in constructors不应该在构造函数中更新静态的字段
333Static non-final field names should comply with a naming convention被 static 修饰(但未被 final 修饰)的字段,命名应该符合命名规范
334String function use should be optimized for single characters字符串函数(如 indexOf(“”))的使用应该优化为单个字符
335String literals should not be duplicated字符串文字不应该重复
336String offset-based methods should be preferred for finding substrings from offsets基于字符串偏移量的方法才应该是从偏移量中寻找子字符串的首选方法
337String.valueOf() should not be appended to a Stringvalueof() 不应该被附加到字符串中
338Strings and Boxed types should be compared using “equals()”字符串内容以及数据类型的比较应该使用 equals() 方法
339Strings should not be concatenated using ‘+’ in a loop字符串在遍历过程中不应该通过"+"号来进行扩展(应该使用 append())
340Struts validation forms should have unique namesStruts 验证表单应该名称惟一
341Subclasses that add fields should override “equals”父类中包含 equals() 方法,添加了字段的子类中需要重写 equals() 方法
342Switch cases should end with an unconditional “break” statementSwitch case 应该以无条件的"break"语句结束
343Synchronization should not be based on Strings or boxed primitives同步不应该基于字符串或基础类型的数据
344Synchronized classes Vector, Hashtable, Stack and StringBuffer should not be used不应该使用 Synchronized 修饰类向量、散列表、堆栈和 StringBuffer
345Ternary operators should not be nested三元式运算不应该嵌套
346TestCases should contain tests测试用例文件中应该包含测试方法
347Tests should include assertions测试应该包含断言(该条规则支持自扩展)
348Tests should not be ignored不应该跳过测试
349The default unnamed package should not be used不应该使用默认的未命名包
350The diamond operator (“<>”) should be used应该使用 diamond 操作符(“<>”)(不必在声明和构造函数中都声明 Lis t的类型,可以使用 <> 简化构造函数声明,编译器将推断出类型。)
351The non-serializable super class of a “Serializable” class should have a no-argument constructor可序列化类的不可序列化超类应该包含无参的构造函数
352The Object.finalize() method should not be called不应该调用 Object.finalize() 方法(Object.finalize() 方法应该由垃圾回收器调用)
353The Object.finalize() method should not be overridenObject.finalize() 不应该被重载(应该只由垃圾回收器调用)
354The signature of “finalize()” should match that of “Object.finalize()”"finalize()"的签名应该与"Object.finalize()"的签名匹配(Object.finalize() 方法应该由垃圾回收器调用,其他方法不应该命名为 finalize)
355The value returned from a stream read should be checked应该检查从流读取的返回值的长度是否大于0(不能保证流返回的不是0字节)
356Throwable and Error should not be caughtThrowable 和 Error 不应该被捕获(Throwable 是所有异常的超类, Error 是所有错误的超类,程序捕捉到也无法处理)
357Throwable.printStackTrace(…) should not be calledprintStackTrace(…) 不应该被调用(默认情况下,printStackTrace(…)将一个 Throwable 及其堆栈信息打印到某个流,这可能会无意中暴露敏感信息)
358Track uses of “FIXME” tags跟踪"FIXME"标签的使用(FIXME 标记通常用于标记怀疑有 bug 的地方,但是开发人员希望稍后处理这些地方。)
359Track uses of “TODO” tags跟踪 TODO 标签
360TrustManagers should not blindly accept any certificatesTrustManagers(信托管理) 不能盲目的接受任何证书
361Try-catch blocks should not be nested不应该嵌套的使用 try-catch 代码块
362Try-with-resources should be used应该使用 try-with 启用 resources 结构(代替 try-finally 结构)
362Two branches in a conditional structure should not have exactly the same implementation(switch 启用 case/if…else if/if…else)条件结构中的两个分支不应该具有完全相同的实现
363Type parameter names should comply with a naming convention类型参数名称应该符合命名约定
364Unary prefix operators should not be repeated不应该重复使用一元表达式的前缀操作符(针对于"!, ~, -, +")
365Unnecessary imports should be removed应该删除不必要的 import
366Untrusted XML should be parsed with a local, static DTD不可信的 XML 应该使用本地静态 DTD 进行解析
367Unused “private” classes should be removed应该删除未使用的 private 类(未使用的私有类属于死代码)
368Unused “private” fields should be removed未使用的 private 字段应该被删除(死代码应该被处理)
369Unused “private” methods should be removed未使用的 private 方法应该被删除(死代码应该被清理)
370Unused labels should be removed未使用的标签应该被删除
371Unused local variables should be removed未使用的局部变量应该被删除
372Unused method parameters should be removed方法中未使用的参数应该被删除
373Unused type parameters should be removed未使用的方法返回参数类型应该被删除
374URIs should not be hardcodedURI永远不应该硬编码,应该用可定制的参数替换它,保证代码的可移植性(此外,即使动态获取URI的元素,如果路径分隔符是硬代码,那么可移植性仍然是有限的)
375Using command line arguments is security-sensitive使用命令行参数是不安全的
376Using environment variables is security-sensitive使用环境变量是不安全的
377Using hardcoded IP addresses is security-sensitive硬编码(直接编码)IP 地址是不安全的
378Using non-standard cryptographic algorithms is security-sensitive使用非标准的密码编码算法是不安全的
379Using pseudorandom number generators (PRNGs) is security-sensitive使用伪随机数生成器是不安全的(确定的算法产生的随机数都是伪随机数,很容易被黑客获取 seed 从而破解)
380Using regular expressions is security-sensitive使用正则表达式是不安全的(影响性能)
381Using Sockets is security-sensitive(直接)使用套接字是不安全的
382Using unsafe Jackson deserialization configuration is security-sensitive不应该使用不安全的 JACKSON 反序列化方法(如果可能,使用 @JsonTypeInfo(use = Id. name) 代替 @JsonTypeInfo(use = Id. class) 或 @JsonTypeInfo(use = Id. MINIMAL_CLASS),因此需要使用 @JsonTypeName 和 @JsonSubTypes 注解)
383Utility classes should not have public constructorsUtility 是静态类,不能被实例化,就算扩展,也不应该有公共的构造函数
384Validating SSL/TLS connections is security-sensitive验证 SSL/TLS 链接是不安全的(SSL/TLS 协议加密网络连接,服务器通常提供一个数字证书来证明其身份。接受所有 SSL/TLScertificates 会使应用程序容易受到中间人攻击(Man-in-the-middle attack, MITM)的攻击)
385Value-based classes should not be used for locking基于值的类不应该用于锁定(基于值的类只为了作为值的包装器,没有构造函数,通过工厂化方法实例化,不会指定返回实例的标识)
386Values should not be uselessly incremented值不应该毫无意义的递增
387Variables should not be self-assigned
388Weak SSL protocols should not be used不应该使用弱 SSL 协议
389Web applications should not have a “main” methodweb 应用不应该有 main() 方法
390Week Year (“YYYY”) should not be used for date formatting日期格式不应使用 Week Year (“YYYY”) (因为存在一周中跨年的情况)
391Writing cookies is security-sensitive编写 cookies 是不安全的(cookie 应该只用于管理用户会话。最佳实践是将所有与用户相关的信息保存在服务器端,并将它们链接到用户会话,而不是将它们发送到客户机)
392XML transformers should be securedXML 转换程序应该受到保护
393Zero should not be a possible denominator0不应该被作为分母

感谢

博主看到别人的博客凌乱不堪,我自己亲自花了大量的自己时间敲的调整了格式,希望能帮助大家,一起成长。!!!

如果您认为这篇文章还不错或者有所收获,您可以点击右下角的【点赞】支持,或请我喝杯咖啡【赞赏】,这将是我继续写作,分享的最大动力!
作者:勤快的小蚂蚁
声明:原创博客请在转载时保留原文链接或者在文章开头加上本人博客地址,如发现错误,欢迎批评指正。凡是转载于本人的文章,不能设置打赏功能,如有特殊需求请与本人联系!
————————————————
版权声明:本文为CSDN博主「勤快的小蚂蚁」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/fxzzq/article/details/126424343

  • 2
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

勤快的小蚂蚁

奖励下我呗!

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值