Open jlerbsc opened 9 months ago
We also noticed that you had 60 violations of rule [S2129] Constructors should not be used to instantiate 'String', 'BigInteger', 'BigDecimal' and primitive-wrapper classes.
This fix eliminates the need to use the constructor for objects that wrap primitives, which improves the readability of the code and the memory footprint.
https://indepth.fr/documentation.html#ConstructorsShouldNotBeUsedToInstantiateRule
You also have 151 violations of rule [S1148] Throwable.printStackTrace(...) should never be called.
https://www.indepth.fr/documentation.html#BooleanChecksShouldNotBeInvertedRule
You also have 60 violations of the rule [S1130] "throws" declarations should not be superfluous
https://www.indepth.fr/documentation.html#ThrowsDeclarationsShouldNotBeSuperfluousRule
You can also improve the readability of some methods by applying the following patches which correct the Sonar RSPEC-2692 violation "Checking if a value is included in a String or List using indexOf(value)>-1 or indexOf(value)>=0 can be replaced with contains(value)"
com\eviware\soapui\impl\wsdl\support\PathUtils.java
@@ -159,5 +159,5 @@
}
\- if (StringUtils.isNullOrEmpty(project.getPath()) && project.getResourceRoot().indexOf("${projectDir}") >= 0) {
\+ if (StringUtils.isNullOrEmpty(project.getPath()) && project.getResourceRoot().contains("${projectDir}")) {
if (UISupport.confirm("Save project before setting path?", "Project has not been saved")) {
try {
com\eviware\soapui\model\propertyexpansion\PropertyExpansionUtils.java
@@ -460,5 +460,5 @@
public static boolean containsPropertyExpansion(String str) {
\- return str != null && str.indexOf("${") >= 0 && str.indexOf('}') > 2;
\+ return str != null && str.contains("${") && str.indexOf('}') > 2;
}
}
com\eviware\soapui\support\SecurityScanUtil.java
@@ -101,5 +101,5 @@
}
} else {
\- if (content.toUpperCase().indexOf(replToken.toUpperCase()) >= 0) {
\+ if (content.toUpperCase().contains(replToken.toUpperCase())) {
result = replToken;
}
First of all I'd like to say that, as a contributor to an Open Source project, I'm very grateful for the work you do and the benefits you bring to the community.
Please don't be angry with me for the rest of my comments, my intention is just to make a small contribution to your project by demonstrating the usefulness of the product we've developed, the main aim of which is to significantly improve the quality of developments.
This tool is completely free for open source projects. It is very easy to use and you can use it on your own. If you want to quickly improve the quality of your project, you can find all the information you need at https://www.indepth.fr
The documentation on this rule is here https://www.indepth.fr/documentation.html#BooleanChecksShouldNotBeInvertedRule
We used our automatic code remediation solution to check whether the project's source code contained violations of certain Sonar rules. In particular, the tool detected 3 violations of the rule "Boolean checks should not be inverted.". Given the small number of violations, you can make these changes manually... But there are also a larger number of violations that would require automatic modifications.