Questions tagged [spotbugs]

SpotBugs is a program which uses static analysis to look for bugs in Java code. SpotBugs is the spiritual successor of FindBugs, carrying on from the point where it left off with support of its community.

SpotBugs is a program which uses static analysis to look for bugs in Java, Groovy, Kotlin, Scala, JSP and Closure code.

SpotBugs is the spiritual successor of FindBugs, carrying on from the point where it left off with the support of its community. It is free software, distributed under the terms of the Lesser GNU Public License.

SpotBugs requires JRE (or JDK) 1.8.0 or later to run. However, it can analyze programs compiled for any version of Java, from 1.0 to 1.9.

165 questions
0
votes
1 answer

SpotBugs site report inconsistent with spotbugs:gui goal

I have set up SpotBugs to help us adhere to some standards, but I get different results in my generated site compared to SpotBugs user interface. This is my configuration of SpotBugs in my pom file:
jokarl
  • 1,913
  • 2
  • 24
  • 52
0
votes
1 answer

How to encode response to JSON in filter without failing XSS

BELOW IS THE static code analysis report from SpotBugs XSS_SERVLET: Potential XSS in Servlet A potential XSS was found. It could be used to execute unwanted JavaScript in a client's browser. (See references) Vulnerable Code: protected void…
Stin
  • 141
  • 1
  • 2
  • 12
0
votes
1 answer

Unable to read repository at https://spotbugs.github.io/eclipse/content.xml

I try to install SpotBugs but below error appeared. Unable to read repository at https://spotbugs.github.io/eclipse/content.xml. java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors…
cuttlas
  • 1
  • 3
0
votes
1 answer

SpotBugs "No value has been specified for property 'spotbugsClasspath'"

I want to use the spotbugs in my android project, but it failed with an exception. Run task: gradle->module->other->spotbugs I have this exception: FAILURE: Build failed with an exception. * What went wrong: A problem was found with the…
0
votes
2 answers

Findbug ES_COMPARING_STRINGS_WITH_EQ not triggering if one string is member of parameter object

public static void findbugDoesNotTrigger(List object) { String string2 = "AnyString"; if(object.get(0) == string2) { System.out.println("Does not matter at all"); } } Here I expected either…
Pulkit Agarwal
  • 159
  • 2
  • 10
0
votes
0 answers

findbugs linking report to source code

How to link source code files in Findbugs report generated using maven? The requirement is to navigate from the Findbugs HTML report to source code file cross references generated using jxr plugin or to the actual source code files. maven…
Kiran Mohan
  • 2,696
  • 6
  • 36
  • 62
0
votes
0 answers

SpotBugs Eclipse Plugin Logging

I am trying to log details inside of a custom SpotBugs Plugin being executed inside of Eclipse. However, I can't get anything to output to the console. This is what I have: import edu.umd.cs.findbugs.log.ConsoleLogger; import…
Derek Brown
  • 4,232
  • 4
  • 27
  • 44
0
votes
1 answer

How to write custom detector for find sec bug plugin?

How to write custom detector for find sec bug plugin ? It will be help full if someone write a sample detector to detect the use of a word. Thanks in advance
niraj
  • 47
  • 7
-1
votes
3 answers

Share a single instance of LinkedHashMap in Multithreaded environiment

I need to initialize a single instance of LinkedHashMap while starting my SpringBoot application .I tried to initialize the same in the following way @Getter private Map myMap; @Override public void…
-1
votes
1 answer

Is SonarQube sufficient for static code reviews?

My applications are based on Java, Kotlin and React. Besides SonarQube there are other popular tools like: Amazon CodeGuru helps you improve code quality and automate code reviews by scanning and profiling Java and Python applications. CodeGuru…
-1
votes
1 answer

SpotBugs warning: Inefficient use of keySet iterator instead of entrySet iterator

Existing Code: Map rolePrincipleMap = cnRoleHolder.getRolePrincipalMap(); Iterator cnRoleIterator = rolePrincipleMap.keySet().iterator(); while (cnRoleIterator.hasNext()) { Object…
-1
votes
1 answer

how to create a custom task using spotbugs to run static code analysis in gradle?

Im trying to create custom spotbugs task to do static code analysis. since its big project. while in execution, gradle throws out some errors and ultimately leading to build failure. My custom task : apply plugin: "com.github.spotbugs-base" task…
Vishal VR
  • 19
  • 6
-1
votes
1 answer

getEncryptedData(String) invokes inefficient new String(String) constructor - Findbugs

I'm trying to convert byte[] to String.and its working fine. But FindBugs is pointing me a Minor issue in my code snippet. code snippet: //Encrypt the data withe public key. Cipher cipher = Cipher.getInstance(TRASFORMATION); …
kavie
  • 2,154
  • 4
  • 28
  • 53
-2
votes
1 answer

Spotbugs - Null pointer dereference issue on Optional

I have simple case, but struggle to understand what is wrong, seems that optional is checked, however Spotbugs sees this as null pointer dereference. Tried orElseThrow() as well, same thing. package com.bam; import java.util.HashSet; import…
1 2 3
10
11