Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-59426

Spotbugs analyzer reports incorrect priority

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Critical
    • Resolution: Not A Defect
    • Component/s: analysis-model
    • Labels:
      None
    • Environment:
      Jenkins ver. 2.176.3
      Warnings Next Generation Plugin 6.0.4
      Spotbugs 3.1.9
      Maven
    • Similar Issues:

      Description

      All Spotbugs bug is report as low priority bug but actually it is high priority bug

      Attach image is capture from spotbugsXml.xml is show that bug has priority = 1 mean high

       

        Attachments

        1. 100.PNG
          100.PNG
          77 kB
        2. 99.PNG
          99.PNG
          116 kB
        3. Untitled.png
          Untitled.png
          209 kB

          Activity

          robot9xvt Ngoc Do Minh created issue -
          robot9xvt Ngoc Do Minh made changes -
          Field Original Value New Value
          Attachment 100.PNG [ 48779 ]
          robot9xvt Ngoc Do Minh made changes -
          Description All Spotbugs bug is report as low priority bug but actually it is high priority bug

          Attach image is capture from spotbugsXml.xml is show that bug has priority = 1 mean high.

          Bellow is my spotbug pom.xml setting
          {quote}            <plugin>            <plugin>                <groupId>com.github.spotbugs</groupId>                <artifactId>spotbugs-maven-plugin</artifactId>                <version>3.1.9</version>                <configuration>                 <effort>Max</effort>                 <threshold>Low</threshold>                 <failOnError>true</failOnError>                 <plugins>                     <plugin>                         <groupId>com.h3xstream.findsecbugs</groupId>                         <artifactId>findsecbugs-plugin</artifactId>                         <version>LATEST</version> <!-- Auto-update to the latest stable -->                     </plugin> <plugin> <groupId>com.mebigfatguy.sb-contrib</groupId> <artifactId>sb-contrib</artifactId> <version>7.4.6</version> </plugin>                 </plugins>            </configuration>            </plugin>
          {quote}
          All Spotbugs bug is report as low priority bug but actually it is high priority bug

          Attach image is capture from spotbugsXml.xml is show that bug has priority = 1 mean high

           
          robot9xvt Ngoc Do Minh made changes -
          Priority Minor [ 4 ] Critical [ 2 ]
          Hide
          drulli Ulli Hafner added a comment -

          What value are you using for setUseRankAsPriority? The parser maps the rank to the severity if this value is true. You need to set to false if you want to map by priority.

          Show
          drulli Ulli Hafner added a comment - What value are you using for setUseRankAsPriority ? The parser maps the rank to the severity if this value is true . You need to set to false if you want to map by priority.
          Hide
          robot9xvt Ngoc Do Minh added a comment -

          Ulli Hafner thanks for your comment. Actually, this is the first time i came here, I use jenkins for a while and i just found this weird behaviour today.  Could you include your mention fix in next version or can you give me a way to workaround it? I'm not familiar with jenkins's source code

          Show
          robot9xvt Ngoc Do Minh added a comment - Ulli Hafner thanks for your comment. Actually, this is the first time i came here, I use jenkins for a while and i just found this weird behaviour today.  Could you include your mention fix in next version or can you give me a way to workaround it? I'm not familiar with jenkins's source code
          Hide
          drulli Ulli Hafner added a comment -

          There is no fix required. It already works by using a property. How did you configure your job?

          Show
          drulli Ulli Hafner added a comment - There is no fix required. It already works by using a property. How did you configure your job?
          drulli Ulli Hafner made changes -
          Resolution Not A Defect [ 7 ]
          Status Open [ 1 ] Resolved [ 5 ]
          robot9xvt Ngoc Do Minh made changes -
          Attachment Untitled.png [ 48800 ]
          Hide
          robot9xvt Ngoc Do Minh added a comment - - edited

          Ulli Hafner Thanks for your comment. 

          I found some similar issue in the past. There is a tool call pipeline, is this is the way to configure UseRankAsPriority properties you are talking about? Something like this?

           

          recordIssues {   
              tools {          
                  spotBugs { 
                      id('bugs')             
                      name('SpotBugs Warnungen')             
                      pattern('**/spotbugsXml.xml')             
                      reportEncoding('UTF-8')             
                      useRankAsPriority(true)          
                  }         
              }      
          }

           

          Below is my current configuration, it is a maven job

           

          Show
          robot9xvt Ngoc Do Minh added a comment - - edited Ulli Hafner Thanks for your comment.  I found some similar issue in the past. There is a tool call pipeline, is this is the way to configure UseRankAsPriority properties you are talking about? Something like this?   recordIssues {   tools {          spotBugs {  id('bugs')              name('SpotBugs Warnungen')              pattern('**/spotbugsXml.xml')              reportEncoding('UTF-8')              useRankAsPriority(true)          }          }      }   Below is my current configuration, it is a maven job  
          Hide
          robot9xvt Ngoc Do Minh added a comment -

          Ulli Hafner I just saw the "Use rank as severity" checkbox right after i post my previous comment. I will uncheck it and try again. Many thanks

          Show
          robot9xvt Ngoc Do Minh added a comment - Ulli Hafner I just saw the "Use rank as severity" checkbox right after i post my previous comment. I will uncheck it and try again. Many thanks

            People

            Assignee:
            drulli Ulli Hafner
            Reporter:
            robot9xvt Ngoc Do Minh
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: