Idean / sonar-swift

Open source Swift plugin for SonarQube (also supports Objective-C)
Other
896 stars 276 forks source link

LizardSensor logs full stacktrace exception instead warning if report file not exists #182

Closed nfalco79 closed 5 years ago

nfalco79 commented 6 years ago

We had update backelite plugin from the old one objectivec to sonar-swift. During sonarqube analysis LizardSensor logs error with a full stacktrace if the report file not exists. This is annoying specially when sonarqube analysis is in autodetect language where all plugin sensors are called. Other sensor (also from this plugin simply log a WARN error instead ERROR).

gaelfoppolo commented 5 years ago

Could you provide more explanations on this issue? Did you submit a PR?

nfalco79 commented 5 years ago

A PR #183 has been sybmitted and refers this issue in the title

When I run a sonar analisys on a project that does not produce any lizard report, this sonar plugin always logs the full stack trace of a FileNotFoundException. With the patch instead of the full stack trace it print a warning like this:

INFO: Sensor Lizard [backelitesonarswiftplugin] WARN: Lizard report file not found at /Users/xxx/jenkins-slave/workspace/myproject/sonar-reports/lizard-report.xml

gaelfoppolo commented 5 years ago

Thank you for the explanation @nfalco79. It looks more like a Lizard issue. Before evalutating your PR, let's check Lizard. Did you installed lizard? Check withwhich lizard.

nfalco79 commented 5 years ago

It's not a lizard issue. We do not produce any lizard report intentionally. Any sensor is enabled by default and the sensor must not fails if the report has not been generated like other does.