Created
October 31, 2022 02:59
-
-
Save kitsook/b2f6df549c6e50e161e7c8a3e7f511a7 to your computer and use it in GitHub Desktop.
Rule based static analysis - rules
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: "BigDecimal explicit toString" | |
description: "find code that explicitly call BigDecimal toString" | |
condition: "resolvedMethodRef.getPackageName().toString().equals(\"java.math\") && | |
resolvedMethodRef.getClassName().toString().equals(\"BigDecimal\") && | |
node.getName().toString() == \"toString\"" | |
actions: | |
- "System.out.print(\"Cautions! Explicitly calling BigDecimal toString() in \" + file.toString()); | |
if (node.getRange().isPresent()) { | |
System.out.println(\" at \" + node.getRange().get().toString()); | |
}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment