Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Support SpotBugs #11

Open
jtiala opened this issue Aug 12, 2022 · 0 comments
Open

[Feature] Support SpotBugs #11

jtiala opened this issue Aug 12, 2022 · 0 comments

Comments

@jtiala
Copy link

jtiala commented Aug 12, 2022

SpotBugs can output it's results as XML that could be used for a report. The file looks something like this:

<?xml version="1.0" encoding="UTF-8"?>

<BugCollection version="4.7.1" sequence="0" timestamp="1660217986614" analysisTimestamp="1660217986614" release="">
  <Project projectName="app (spotbugsMain)">
    <Jar>/*path*/App.class</Jar>
    <Jar>/*path*/ExceptionHandler.class</Jar>
    <AuxClasspathEntry>/*path*/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-configuration-processor/2.7.2/12575686ba3820571ea79bfd08d6d27534b97a0e/spring-boot-configuration-processor-2.7.2.jar</AuxClasspathEntry>
    <AuxClasspathEntry>/*path*/.gradle/caches/modules-2/files-2.1/com.github.spotbugs/spotbugs-annotations/4.7.1/50e29adaec8cf4299441a6786a909a0b105326ad/spotbugs-annotations-4.7.1.jar</AuxClasspathEntry>
    <SrcDir>/*path*/src/main/resources</SrcDir>
    <SrcDir>/*path*/src/main/java</SrcDir>
    <Plugin id="com.h3xstream.findsecbugs" enabled="true"/>
  </Project>
  <Errors errors="1" missingClasses="3">
    <Error>
      <ErrorMessage>Exception analyzing *class* using detector com.h3xstream.findsecbugs.spring.SpringEntityLeakDetector</ErrorMessage>
      <Exception>java.lang.IllegalArgumentException: Invalid class name java/lang/String;Ljava/lang/Object</Exception>
      <StackTrace>edu.umd.cs.findbugs.classfile.ClassDescriptor.&lt;init&gt;(ClassDescriptor.java:59)</StackTrace>
      <StackTrace>edu.umd.cs.findbugs.classfile.DescriptorFactory.getClassDescriptor(DescriptorFactory.java:128)</StackTrace>
      <StackTrace>edu.umd.cs.findbugs.AnalysisCacheToRepositoryAdapter.loadClass(AnalysisCacheToRepositoryAdapter.java:90)</StackTrace>
      <StackTrace>org.apache.bcel.Repository.lookupClass(Repository.java:65)</StackTrace>
      <StackTrace>com.h3xstream.findsecbugs.spring.SignatureParserWithGeneric.typeToJavaClass(SignatureParserWithGeneric.java:75)</StackTrace>
      <StackTrace>com.h3xstream.findsecbugs.spring.SignatureParserWithGeneric.getReturnClasses(SignatureParserWithGeneric.java:60)</StackTrace>
      <StackTrace>com.h3xstream.findsecbugs.spring.SpringEntityLeakDetector.analyzeMethod(SpringEntityLeakDetector.java:112)</StackTrace>
      <StackTrace>com.h3xstream.findsecbugs.spring.SpringEntityLeakDetector.visitClassContext(SpringEntityLeakDetector.java:69)</StackTrace>
      <StackTrace>edu.umd.cs.findbugs.DetectorToDetector2Adapter.visitClass(DetectorToDetector2Adapter.java:76)</StackTrace>
      <StackTrace>edu.umd.cs.findbugs.FindBugs2.lambda$analyzeApplication$1(FindBugs2.java:1108)</StackTrace>
      <StackTrace>java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)</StackTrace>
      <StackTrace>edu.umd.cs.findbugs.CurrentThreadExecutorService.execute(CurrentThreadExecutorService.java:86)</StackTrace>
      <StackTrace>java.base/java.util.concurrent.AbstractExecutorService.invokeAll(AbstractExecutorService.java:242)</StackTrace>
      <StackTrace>edu.umd.cs.findbugs.FindBugs2.analyzeApplication(FindBugs2.java:1118)</StackTrace>
      <StackTrace>edu.umd.cs.findbugs.FindBugs2.execute(FindBugs2.java:309)</StackTrace>
      <StackTrace>edu.umd.cs.findbugs.FindBugs.runMain(FindBugs.java:395)</StackTrace>
      <StackTrace>edu.umd.cs.findbugs.FindBugs2.main(FindBugs2.java:1231)</StackTrace>
    </Error>
    <MissingClass>apply</MissingClass>
    <MissingClass>makeConcatWithConstants</MissingClass>
    <MissingClass>test</MissingClass>
  </Errors>
  <FindBugsSummary timestamp="Thu, 11 Aug 2022 14:39:46 +0300" total_classes="0" referenced_classes="0" total_bugs="0" total_size="0" num_packages="0" java_version="11.0.15" vm_version="11.0.15+0" cpu_seconds="10.43" clock_seconds="3.11" peak_mbytes="278.01" alloc_mbytes="4096.00" gc_seconds="0.05">
    <FindBugsProfile></FindBugsProfile>
  </FindBugsSummary>
  <ClassFeatures></ClassFeatures>
  <History></History>
</BugCollection>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant