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

java.lang.NullPointerException #258

Closed
4 tasks done
LionWY opened this issue Dec 12, 2019 · 3 comments
Closed
4 tasks done

java.lang.NullPointerException #258

LionWY opened this issue Dec 12, 2019 · 3 comments

Comments

@LionWY
Copy link

LionWY commented Dec 12, 2019

New Issue Checklist

Issue Description

It's very strange, when I delete lizard-report.xml, and run sonar-scanner, the result is sucess. otherwise it's failed, and the error log is "ERROR: Error during SonarQube Scanner execution
java.lang.NullPointerException
at com.backelite.sonarqube.swift.complexity.LizardReportParser.addComplexityFileMeasures(LizardReportParser.java:173)", I think it's a bug, anyone help me?

$oclint-json-compilation-database -- -report-type pmd -o sonar-reports/oclint.xml
$lizard --xml > sonar-reports/lizard-report.xml
$sonar-scanner
result:
ERROR: Error during SonarQube Scanner execution
java.lang.NullPointerException
at com.backelite.sonarqube.swift.complexity.LizardReportParser.addComplexityFileMeasures(LizardReportParser.java:173)
at com.backelite.sonarqube.swift.complexity.LizardReportParser.parseMeasure(LizardReportParser.java:120)
at com.backelite.sonarqube.swift.complexity.LizardReportParser.parseFile(LizardReportParser.java:89)
at com.backelite.sonarqube.swift.complexity.LizardReportParser.parseReport(LizardReportParser.java:69)
at com.backelite.sonarqube.swift.complexity.LizardSensor.execute(LizardSensor.java:71)
at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:48)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:85)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$1(ModuleSensorsExecutor.java:59)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy(ModuleSensorsExecutor.java:77)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:59)
at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:82)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:387)
at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:383)
at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:346)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:141)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:72)
at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:66)
at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
at com.sun.proxy.$Proxy0.execute(Unknown Source)
at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:185)
at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:137)
at org.sonarsource.scanner.cli.Main.execute(Main.java:112)
at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
at org.sonarsource.scanner.cli.Main.main(Main.java:61)
ERROR:

Command executed
Complete output when running fastlane, including the stack trace and command used
 [REPLACE THIS WITH YOUR INFORMATION] 

Environment

Sonarqube: 8.0 (community edition)
OS: macOS Catalina
SonarQube Scanner 4.2.0.1873
sonar-swift: backelite-sonar-swift-plugin-0.4.5.jar
oclint: 0.14

@LionWY
Copy link
Author

LionWY commented Dec 12, 2019

like this 253

@himanshuNetsol
Copy link

Facing the exact same issue. Can anyone please help ?

@zippy1978
Copy link
Contributor

Hi,
The problem is related to complexity sensor trying to index data on a source file which is not located into sources or tests directories (sonar.sources and sonar.tests).

However the plugin should not crash and only display a warning instead.

Issue is fixed on develop branch

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

3 participants