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

Cannot get Code Complexity info at the project dashboard #7

Open
RunsFor opened this issue Dec 17, 2015 · 3 comments
Open

Cannot get Code Complexity info at the project dashboard #7

RunsFor opened this issue Dec 17, 2015 · 3 comments

Comments

@RunsFor
Copy link

RunsFor commented Dec 17, 2015

Hi!

Thanx for your great plugin!
I am about to setup code quality monitoring for my ruby projects and decided to use your plugin.

Plugin seems to work fine. Runner is analyzing code coverage and complexity. I'm able to see that in the runner output. But one issue I am experiencing is that complexity data is not showing up at the project dashboard.

I tried to run metric_fu against my project and it successfully generated html file with all default metrics.

So I cant figure out what may possibly go wrong since runner produce no errors in its output. Could you help me and point what I might do wrong?

I'm using following versions of software:

⇒  metric_fu --version
4.12.0
⇒  sonar-runner --version
SonarQube Runner 2.4
Java 1.8.0_65 Oracle Corporation (64-bit)
Mac OS X 10.11.2 x86_64

SonarQube server - 4.5.6
SonarQube ruby plugin - 1.0.1

P.S. I also tried plugin of 1.1.0 version from pr4-manual-merge branch, but SonarQube server failed to run with it

Thanks!

@RunsFor RunsFor changed the title Cannot get Code Complexity info on the project dashboard Cannot get Code Complexity info at the project dashboard Dec 17, 2015
@RunsFor
Copy link
Author

RunsFor commented Dec 17, 2015

I tried to execute sonar-runner with different complexity metric Cane (changed in the sonarqube web interface settings) and it start to constantly failing during analyzing with the following errors:

16:35:46.167 ERROR - Can not analyze the file /Users/runfor/Projects/gazeta/app/decorators/embeds/brand_decorator.rb for complexity
java.io.IOException: Failure parsing YAML results
        at com.godaddy.sonar.ruby.metricfu.MetricfuComplexityYamlParserImpl.parseFunctions(MetricfuComplexityYamlParserImpl.java:65) ~[na:na]
        at com.godaddy.sonar.ruby.metricfu.MetricfuComplexitySensor.analyzeFile(MetricfuComplexitySensor.java:85) ~[na:na]
        at com.godaddy.sonar.ruby.metricfu.MetricfuComplexitySensor.analyse(MetricfuComplexitySensor.java:72) ~[na:na]
        at org.sonar.batch.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:79) [sonar-batch-maven-compat-4.5.6.jar:na]
        at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:70) [sonar-batch-maven-compat-4.5.6.jar:na]
        at org.sonar.batch.phases.PhaseExecutor.execute(PhaseExecutor.java:119) [sonar-batch-maven-compat-4.5.6.jar:na]
        at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:194) [sonar-batch-maven-compat-4.5.6.jar:na]
        at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:93) [sonar-batch-maven-compat-4.5.6.jar:na]
        at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:78) [sonar-batch-maven-compat-4.5.6.jar:na]
        at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:233) [sonar-batch-maven-compat-4.5.6.jar:na]
        at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:228) [sonar-batch-maven-compat-4.5.6.jar:na]
        at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:221) [sonar-batch-maven-compat-4.5.6.jar:na]
        at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:93) [sonar-batch-maven-compat-4.5.6.jar:na]
        at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:78) [sonar-batch-maven-compat-4.5.6.jar:na]
        at org.sonar.batch.scan.ScanTask.scan(ScanTask.java:64) [sonar-batch-maven-compat-4.5.6.jar:na]
        at org.sonar.batch.scan.ScanTask.execute(ScanTask.java:51) [sonar-batch-maven-compat-4.5.6.jar:na]
        at org.sonar.batch.bootstrap.TaskContainer.doAfterStart(TaskContainer.java:125) [sonar-batch-maven-compat-4.5.6.jar:na]
        at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:93) [sonar-batch-maven-compat-4.5.6.jar:na]
        at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:78) [sonar-batch-maven-compat-4.5.6.jar:na]
        at org.sonar.batch.bootstrap.BootstrapContainer.executeTask(BootstrapContainer.java:173) [sonar-batch-maven-compat-4.5.6.jar:na]
        at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:95) [sonar-batch-maven-compat-4.5.6.jar:na]
        at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:67) [sonar-batch-maven-compat-4.5.6.jar:na]
        at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java:48) [sonar-runner-batch1062907466758290008.jar:na]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_65]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_65]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_65]
        at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_65]
        at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:87) [sonar-runner-dist-2.4.jar:na]
        at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75) [sonar-runner-dist-2.4.jar:na]
        at java.security.AccessController.doPrivileged(Native Method) [na:1.8.0_65]
        at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69) [sonar-runner-dist-2.4.jar:na]
        at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50) [sonar-runner-dist-2.4.jar:na]
        at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102) [sonar-runner-dist-2.4.jar:na]
        at org.sonar.runner.api.Runner.execute(Runner.java:100) [sonar-runner-dist-2.4.jar:na]
        at org.sonar.runner.Main.executeTask(Main.java:70) [sonar-runner-dist-2.4.jar:na]
        at org.sonar.runner.Main.execute(Main.java:59) [sonar-runner-dist-2.4.jar:na]
        at org.sonar.runner.Main.main(Main.java:53) [sonar-runner-dist-2.4.jar:na]
Caused by: java.lang.NullPointerException: null
        at com.godaddy.sonar.ruby.metricfu.MetricfuComplexityYamlParserImpl.analyzeCane(MetricfuComplexityYamlParserImpl.java:125) ~[na:na]
        at com.godaddy.sonar.ruby.metricfu.MetricfuComplexityYamlParserImpl.parseFunctions(MetricfuComplexityYamlParserImpl.java:58) ~[na:na]
        ... 36 common frames omitted

@bsclifton
Copy link

When we accepted #5 (which has version 1.0.1), we had the following config (which worked):
SonarQube 4.5.5 LTS
SonarQube runner 2.4
metric_fu (4.12.0)
metric_fu-Saikuro (1.1.3)
java-1.7.0-openjdk-1.7.0.55

Your setup looks almost the same, just one .1 release newer of SonarQube and a newer version of Java.

Regarding Cane, have you installed the gem? We're using version 2.6.0

@eresse
Copy link

eresse commented Nov 8, 2016

Hello,

@RunsFor, I have been having the same problem and couldn't find a solution, so I forked the repo and fixed it : https://github.com/eresse/ruby-sonar-plugin

My version of the plugin works fine and reports coverage as well as complexity.

Cheers.

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