<dev>
1. 整理代码
Showing
| ... | ... | @@ -18,9 +18,12 @@ public class TransactionLogDesensitization { |
| private static final int PARAM_LENGTH = 4; | ||
| public static void main(String[] args) { | ||
| public static void main(String[] args) throws Exception{ | ||
| long start = System.currentTimeMillis(); | ||
| if (args.length != PARAM_LENGTH) { | ||
| String error = "参数缺失,请输入配置文件,例如: --conf E:\\Codes\\fork\\transaction_log_desensitization\\src\\main\\resources\\application.yml --regular E:\\Codes\\fork\\transaction_log_desensitization\\src\\main\\resources\\regular "; | ||
| String error = "参数缺失,请输入配置文件,例如: " + | ||
| "--conf E:\\Codes\\fork\\transaction_log_desensitization\\src\\main\\resources\\application.yml " + | ||
| "--regular E:\\Codes\\fork\\transaction_log_desensitization\\src\\main\\resources\\regular "; | ||
| log.error(error); | ||
| } | ||
| try { | ||
| ... | ... | @@ -36,6 +39,7 @@ public class TransactionLogDesensitization { |
| } catch (ZorkException e) { | ||
| log.info(String.valueOf(e)); | ||
| } | ||
| long stop = System.currentTimeMillis(); | ||
| System.out.println("耗时统计:" + (stop - start) + "ms"); | ||
|
||
| } | ||
| } | ||
This diff is collapsed.
-
SonarQube analysis reported 105 issues
-
🚫 22 critical -
⚠ 58 major -
🔽 24 minor -
ℹ 1 info
Watch the comments in this conversation to review them.
Top 30 extra issues
Note: The following issues were found on lines that were not modified in the commit. Because these issues can't be reported as line comments, they are summarized here:
-
🚫 Add a default case to this switch.📘 -
🚫 switch中每个case需要通过break/return等来终止📘 -
🚫 switch块缺少default语句📘 -
🚫 Define a constant instead of duplicating this literal " {\n" 11 times.📘 -
🚫 [Define a constant instead of duplicating this literal " "type": \n" 11 times.📘 -
🚫 Define a constant instead of duplicating this literal " "string",\n" 6 times.📘 -
🚫 Define a constant instead of duplicating this literal " "null"\n" 6 times.📘 -
🚫 [Define a constant instead of duplicating this literal " ]\n" 11 times.](https://git.zorkdata.com/liaomingtao/transaction_log_desensitization/blob/1cb26b747dbf966f4d0a2dce559bbb93bde9f340/src/main/java/com/zorkdata/desensitization/avro/AvroSchemaDef.java#L23)📘 -
🚫 Define a constant instead of duplicating this literal " },\n" 9 times.📘 -
🚫 Define a constant instead of duplicating this literal " "null",\n" 5 times.📘 -
🚫 Define a constant instead of duplicating this literal " {\n" 5 times.📘 -
🚫 Define a constant instead of duplicating this literal " "type": "map",\n" 5 times.📘 -
🚫 Define a constant instead of duplicating this literal " "values": "string"\n" 3 times.📘 -
🚫 Define a constant instead of duplicating this literal " }\n" 5 times.📘 -
🚫 Define a constant instead of duplicating this literal "序列化失败" 13 times.📘 -
🚫 Refactor this method to reduce its Cognitive Complexity from 22 to the 15 allowed.📘 -
🚫 Refactor this method to reduce its Cognitive Complexity from 22 to the 15 allowed.📘 -
🚫 Add a nested comment explaining why this method is empty, throw an UnsupportedOperationException or complete the implementation.📘 -
🚫 Change this "try" to a try-with-resources. (sonar.java.source not set. Assuming 7 or greater.)📘 -
🚫 Refactor this code to not throw exceptions in finally blocks.📘 -
🚫 Refactor this code to not throw exceptions in finally blocks.📘 -
🚫 Change this "try" to a try-with-resources. (sonar.java.source not set. Assuming 7 or greater.)📘 -
⚠ This block of commented-out lines of code should be removed.📘 -
⚠ 及时清理不再使用的代码段或配置信息。📘 -
⚠ Replace this use of System.out or System.err by a logger.📘 -
⚠ Replace this use of System.out or System.err by a logger.📘 -
⚠ String contains no format specifiers.📘 -
⚠ Replace this use of System.out or System.err by a logger.📘 -
⚠ Rename "jsonObject" which hides the field declared at line 39.📘 -
⚠ Remove this expression which always evaluates to "true"📘
- ... 73 more
-