Idean / sonar-swift

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

ERROR: Exception -> ./ProjectName/Class.swift -> Complexity / Function Metric #75

Closed wangjiejacques closed 5 years ago

wangjiejacques commented 7 years ago

I found the message of the exception is 'function_complexity' should not be computed by a Sensor.

orj commented 7 years ago

Trying to import Lizard data getting the same error as this:

ERROR:  Exception -> ANZFoundation/Formatting/ANZDateFormatter.m -> Complexity / Function
java.lang.UnsupportedOperationException: Metric 'function_complexity' should not be computed by a Sensor
    at org.sonar.scanner.sensor.DefaultSensorStorage.saveMeasure(DefaultSensorStorage.java:248)
    at org.sonar.scanner.index.DefaultIndex.addMeasure(DefaultIndex.java:155)
    at org.sonar.scanner.deprecated.DeprecatedSensorContext.saveMeasure(DeprecatedSensorContext.java:126)
    at org.sonar.plugins.objectivec.complexity.LizardMeasurePersistor.saveMeasures(LizardMeasurePersistor.java:80)
    at org.sonar.plugins.objectivec.complexity.LizardSensor.analyse(LizardSensor.java:80)
    at org.sonar.scanner.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:57)
    at org.sonar.scanner.phases.SensorsExecutor.execute(SensorsExecutor.java:49)
    at org.sonar.scanner.phases.AbstractPhaseExecutor.execute(AbstractPhaseExecutor.java:78)
    at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:175)
    at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:143)
    at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:128)
    at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:262)
    at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:257)
    at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:247)
    at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:143)
    at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:128)
    at org.sonar.scanner.task.ScanTask.execute(ScanTask.java:47)
    at org.sonar.scanner.task.TaskContainer.doAfterStart(TaskContainer.java:86)
    at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:143)
    at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:128)
    at org.sonar.scanner.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:118)
    at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:117)
    at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:63)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    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:233)
    at org.sonarsource.scanner.api.EmbeddedScanner.runAnalysis(EmbeddedScanner.java:151)
    at org.sonarsource.scanner.cli.Main.runAnalysis(Main.java:123)
    at org.sonarsource.scanner.cli.Main.execute(Main.java:77)
    at org.sonarsource.scanner.cli.Main.main(Main.java:61)
pbernery commented 7 years ago

Which version of SonarQube are you using?

maurobender commented 7 years ago

I can report this happening to me too. I'm using:

It only says that there was an exception but with no backtrace:

...
15:41:38.126 DEBUG: Save measure Complexity / File for file .../BATaxi/Modules/BAIDLogin/Entities/DocumentType.swift
15:41:38.126 ERROR:  Exception -> BATaxi/Modules/BAIDLogin/Entities/DocumentType.swift -> Complexity / File
15:41:38.126 DEBUG: Save measure File Distribution / Complexity for file .../BATaxi/Modules/BAIDLogin/Entities/DocumentType.swift
15:41:38.126 DEBUG: Save measure Complexity / Function for file .../BATaxi/Modules/BAIDLogin/Entities/DocumentType.swift
15:41:38.126 ERROR:  Exception -> BATaxi/Modules/BAIDLogin/Entities/DocumentType.swift -> Complexity / Function
...
luowei428 commented 7 years ago

Did you guys find a solution? I also have this problem

amr-zagloul commented 6 years ago

Any updates?, I have the same problem

BogdanTC commented 6 years ago

has this been solved? i ran into the same issue

mosesliao commented 6 years ago

any updates? I have this problem too

antohisorin commented 6 years ago

I have the same problem

ozzotto commented 6 years ago

I am having the same issue. Is this a Lizard issue or perhaps can we modify somehow the Lizard report?

jay29982 commented 6 years ago

Any update guys? I have same issue

singh88 commented 6 years ago

Any update on this issue? @zippy1978 @pbernery

iMark21 commented 6 years ago

Hi, any update?

edopelawi commented 6 years ago

Bumping this out!

navjotbedi commented 6 years ago

Same issue, waiting for the fix!

AhmedAskar commented 6 years ago

Same issue, waiting for the fix!

crajesh238 commented 6 years ago

Any update?

gaelfoppolo commented 5 years ago

Can you provide a project sample to reproduce the issue?

gaelfoppolo commented 5 years ago

Closing this issue. Please open a new one if you're experiencing this.