TouK/sputnik

Sonar Reviewer reports zero violations

mirkosertic opened this issue · 1 comments

I am using Sputnik 1.5.0.

Die SonarRunner detects issues in the changed files, here is the content of sonar-report.json

{
  "version": "4.5.2",
  "issues": [
    {
      "key": "3c576370-2de6-4bbe-83a9-5deb904b1ed9",
      "component": "de.buch.shop:webshop:src\/java\/com\/freiheit\/buch\/common\/util\/LazyInitProxyFactory.java",
      "line": 111,
      "message": "Replace this usage of System.out or System.err by a logger.",
      "severity": "MAJOR",
      "rule": "squid:S106",
      "status": "OPEN",
      "isNew": true,
      "creationDate": "2015-09-21T15:56:43+0200",
      "updateDate": "2015-09-21T15:56:43+0200"
    },
    {
      "key": "ed24633d-175e-41c7-a4da-a58cec76fd37",
      "component": "de.buch.shop:webshop:src\/java\/com\/freiheit\/buch\/common\/util\/LazyInitProxyFactory.java",
      "line": 107,
      "message": "Remove this unused \"lala\" private field.",
      "severity": "MAJOR",
      "rule": "squid:S1068",
      "status": "OPEN",
      "isNew": true,
      "creationDate": "2015-09-21T15:56:43+0200",
      "updateDate": "2015-09-21T15:56:43+0200"
    }
  ],
  "components": [
    {
      "key": "de.buch.shop:webshop"
    },
    {
      "key": "de.buch.shop:webshop:src\/java\/com\/freiheit\/buch\/common\/util",
      "path": "src\/java\/com\/freiheit\/buch\/common\/util",
      "moduleKey": "de.buch.shop:webshop"
    },
    {
      "key": "de.buch.shop:webshop:src\/java\/com\/freiheit\/buch\/common\/util\/LazyInitProxyFactory.java",
      "path": "src\/java\/com\/freiheit\/buch\/common\/util\/LazyInitProxyFactory.java",
      "moduleKey": "de.buch.shop:webshop",
      "status": "CHANGED"
    }
  ],
  "rules": [
    {
      "key": "squid:S1068",
      "rule": "S1068",
      "repository": "squid",
      "name": "Unused private fields should be removed"
    },
    {
      "key": "squid:S106",
      "rule": "S106",
      "repository": "squid",
      "name": "Standard ouputs should not be used directly to log anything"
    }
  ],
  "users": [

  ]
}

However, Sputnik reports zero violations and reports +1 to gerrit:

 [java] 15:56:49.204 INFO  - Store results in database
 [java] 15:56:49.205 DEBUG - Execute org.sonar.batch.index.MeasurePersister
 [java] 15:56:49.254 DEBUG - Execute org.sonar.batch.index.DuplicationPersister
 [java] 15:56:49.255 DEBUG - Execute org.sonar.batch.index.ComponentDataPersister
 [java] 15:56:49.257 DEBUG - Execute org.sonar.batch.issue.IssuePersister
 [java] 15:56:49.257 DEBUG - IssuePersister skipped in preview mode
 [java] 15:56:49.257 DEBUG - Execute org.sonar.batch.phases.GraphPersister
 [java] 15:56:49.292 INFO  - ANALYSIS SUCCESSFUL
 [java] 15:56:49.293 DEBUG - Post-jobs : 
 [java] 15:56:49.432 [main] INFO  pl.touk.sputnik.engine.ReviewRunner - Review finished for processor Sonar. Took 11 s
 [java] 15:56:49.432 [main] INFO  pl.touk.sputnik.engine.ReviewRunner - Review for processor Sonar returned 0 violations
 [java] 15:56:49.435 [main] INFO  p.t.s.e.v.SummaryMessageVisitor - Adding summary message to review: Perfect!
 [java] 15:56:49.437 [main] INFO  p.t.s.e.v.score.ScoreAlwaysPass - Adding static passing score {Code-Review=1} to review

I am using the following configuration options:

connector.type=gerrit
connector.host=secret
connector.path=/gerrit
connector.port=80
connector.username=secret
connector.password=secret
connector.useHttps=false
checkstyle.enabled=true
checkstyle.configurationFile=lib/sputnik-1.5.0/conf/checkstyle.xml
checkstyle.propertiesFile=
pmd.enabled=false
pmd.ruleSets=rulesets/java/android.xml,rulesets/java/basic.xml
findbugs.enabled=true
findbugs.includeFilter=lib/sputnik-1.5.0/conf/findbugs.xml
findbugs.excludeFilter=
codenarc.enabled=false
codenarc.ruleSets=
codenarc.excludes=*/.java
jslint.enabled=false
jshint.enabled=false
jshint.configurationFile=jshint.json
sonar.enabled=true
sonar.configurationFiles=sonar/sonar.properties
sonar.verbose=true

Any ideas what is going wrong here?

mihn commented

Ha! I just found out same error, also prepared solutions with some additional tests. :)