crpm-proj-code-set/rjdmaiznscxt/sql/data/crpm_95e998_c582ce.sql
2025-06-30 15:17:54 +08:00

10 lines
1.7 KiB
SQL
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

INSERT INTO `crpm_95e998_c582ce` (`yfjcgz`,`djcdm`,`jcjg`) VALUES ('方法必须有返回值','public void calculate() { return 1; }','错误void类型方法不应有返回值');
INSERT INTO `crpm_95e998_c582ce` (`yfjcgz`,`djcdm`,`jcjg`) VALUES ('变量必须先声明后使用','int b = a + 1; int a = 0;','错误变量a在使用前未声明');
INSERT INTO `crpm_95e998_c582ce` (`yfjcgz`,`djcdm`,`jcjg`) VALUES ('字符串比较应使用equals()','if (str == "test") { ... }','警告字符串比较建议使用equals()方法');
INSERT INTO `crpm_95e998_c582ce` (`yfjcgz`,`djcdm`,`jcjg`) VALUES ('数组下标从0开始','int[] arr = new int[5]; arr[5] = 10;','错误数组越界最大下标为4');
INSERT INTO `crpm_95e998_c582ce` (`yfjcgz`,`djcdm`,`jcjg`) VALUES ('注释规范检查','// 这是一个方法','警告方法注释应使用javadoc格式');
INSERT INTO `crpm_95e998_c582ce` (`yfjcgz`,`djcdm`,`jcjg`) VALUES ('空指针检查','obj.toString();','警告对象obj可能为null');
INSERT INTO `crpm_95e998_c582ce` (`yfjcgz`,`djcdm`,`jcjg`) VALUES ('异常处理规范','try { ... } catch (Exception e) { e.printStackTrace(); }','警告:异常处理不应仅打印堆栈信息');
INSERT INTO `crpm_95e998_c582ce` (`yfjcgz`,`djcdm`,`jcjg`) VALUES ('未使用的变量','int a = 10; // 未使用','警告变量a已声明但未使用');
INSERT INTO `crpm_95e998_c582ce` (`yfjcgz`,`djcdm`,`jcjg`) VALUES ('魔法数值检查','if (x > 100) { ... }','警告100是魔法数值应定义为常量');
INSERT INTO `crpm_95e998_c582ce` (`yfjcgz`,`djcdm`,`jcjg`) VALUES ('方法参数过多','public void process(int a, int b, int c, int d, int e) { ... }','警告方法参数超过4个建议封装为对象');