5

I was trying to analyse our code base using Sonarqube. After refactoring a specific file "ReportHelper.java", the last analysis failed.

Caused by: java.lang.IllegalStateException: Fail to process issues of
    component
    'com.vls.nost:Nost_business:src/main/java/com/velos/nost/business/helper/ReportHelper.java'
        at
    org.sonar.server.computation.task.projectanalysis.issue.IntegrateIssuesVisitor.visitAny(IntegrateIssuesVisitor.java:70)
        at
    org.sonar.server.computation.task.projectanalysis.component.TypeAwareVisitorWrapper.visitAny(TypeAwareVisitorWrapper.java:82)
        at
    org.sonar.server.computation.task.projectanalysis.component.VisitorsCrawler.visitNode(VisitorsCrawler.java:117)
        at
    org.sonar.server.computation.task.projectanalysis.component.VisitorsCrawler.visitImpl(VisitorsCrawler.java:100)
        at
    org.sonar.server.computation.task.projectanalysis.component.VisitorsCrawler.visit(VisitorsCrawler.java:72)
        ... 26 more Caused by: java.lang.IllegalStateException: Source of
    file
    'ComponentImpl{key='com.velos.nostradamus:Nostradamus_business:src/main/java/com/vls/nost/business/helper/ReportHelper.java',
    type=FILE, uuid='AWKq2KypGCJ2XfmqS536',
    name='com.vls.nostradamus:Nostradamus_business:src/main/java/com/vls/nost/business/helper/nost.java',
    description='null', fileAttributes=FileAttributes{languageKey='java',
    unitTest=false, lines=3611}, reportAttributes=ReportAttributes{ref=67,
    version='null',
    path='src/main/java/com/vls/nost/business/helper/ReportHelper.java',
    scmPath='business/src/main/java/com/velos/nost/business/helper/ReportHelper.java'}}'
    has less lines (3512) than the expected number (3611)

Not sure, why the number of lines should not be less than the expected number after refactoring? Also, I am wondering about how that expected number is arrived at by Sonar?

Any help would be much appreciated?

Victor M Perez
  • 2,185
  • 3
  • 19
  • 22
Raja
  • 73
  • 2
  • 7
  • Did you try it for a second time? – Jeroen Heier Apr 18 '18 at 15:47
  • We tried several times. It didn't work. However, when we cleaned the build and ran the build again, it worked. Thanks for your time! I appreciate it. – Raja Apr 19 '18 at 11:10
  • To be clear, does this fail on the analyzer side or once the analysis report has been submitted to the server? Also, is there any more to the stacktrace/error message? – G. Ann - SonarSource Team Apr 19 '18 at 11:28
  • Thanks for taking your time to look into this, Ann. This exception was found from the analyzer side. From the Administration->Background Tasks, we found the failed analysis. Against the specific Task, I saw a "Show Error details" menu. The exception mentioned in the issue statement here showed up when the "Show Error Details" option was used. – Raja Apr 20 '18 at 12:15

0 Answers0