--- title: "Common static analysis issues" sidebar_label: "Common static analysis issues" hide_title: true --- import { RecipeHeader, RecipeMeta, RecipeList, OptionsTable, ExampleList, UsageList, DataTableList } from '@site/src/components/recipe'; Common static analysis issues Resolve common static analysis issues (also known as SAST issues). ## Definition strList, String str) {\n if (strList.indexOf(str) > 0) {\n }\n return strList.indexOf(str) > 0;\n }\n}\n","after":"import java.util.List;\n\nclass Test {\n static boolean hasIndex(List strList, String str) {\n strList.indexOf(str);\n return strList.indexOf(str) >= 1;\n }\n}\n","diff":"@@ -5,3 +5,2 @@\nclass Test {\n static boolean hasIndex(List strList, String str) {\n- if (strList.indexOf(str) > 0) {\n- }\n- return strList.indexOf(str) > 0;\n+ strList.indexOf(str);\n+ return strList.indexOf(str) >= 1;\n }\n","newFile":false}]},{"variants":[{"language":"java","before":"import java.util.List;\n\nclass Test {\n static boolean hasIndex(List strList, String str) {\n if (strList.indexOf(str) > 0) {\n }\n return strList.indexOf(str) > 0;\n }\n}\n","after":"import java.util.List;\n\nclass Test {\n static boolean hasIndex(List strList, String str) {\n strList.indexOf(str);\n return strList.indexOf(str) >= 1;\n }\n}\n","diff":"@@ -5,3 +5,2 @@\nclass Test {\n static boolean hasIndex(List strList, String str) {\n- if (strList.indexOf(str) > 0) {\n- }\n- return strList.indexOf(str) > 0;\n+ strList.indexOf(str);\n+ return strList.indexOf(str) >= 1;\n }\n","newFile":false}]}]}> ## Examples ## Usage ## Data tables