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

圈复杂度lizard.report无法正常解析。 #34

Open
MiEco-wukaibo opened this issue Mar 1, 2024 · 0 comments
Open

圈复杂度lizard.report无法正常解析。 #34

MiEco-wukaibo opened this issue Mar 1, 2024 · 0 comments

Comments

@MiEco-wukaibo
Copy link

环境:

1、sonarqube-9.8.0.63668 【社区版】
2、sonar-scanner-5.0.1.3006-macosx
3、sonar-swift-plugin-1.8.0
4、java -version
java version "17.0.10" 2024-01-16 LTS
Java(TM) SE Runtime Environment (build 17.0.10+11-LTS-240)
Java HotSpot(TM) 64-Bit Server VM (build 17.0.10+11-LTS-240, mixed mode, sharing)
5、Mac mini、Apple M1

执行命令:

pythonInstallPath="/Users/mieco/Library/Python/3.9"
lizardPth=$pythonInstallPath/lib/python/site-packages/lizard.py
echo lizardPth=$lizardPth

python3 $lizardPth --xml > ./lizard-report.xml

在命令后添加 -Dsonar.swift.lizard.report=lizard-report.xml

sonar-scanner
-Dsonar.projectKey=MicoApps-Sonar-test
-Dsonar.sources=.
-Dsonar.host.url=http://10.189.132.65:9000
-Dsonar.branch.name=${branchName}
-Dsonar.swift.swiftlint.report=swiftlint.txt
-Dsonar.swift.infer.report=infer-out/report.json
-Dsonar.swift.oclint.report=oclint_report.xml
-Dsonar.swift.lizard.report=lizard-report.xml

Issue Description

NFO: Sensor Swift Squid [swift] (done) | time=1768ms
INFO: Sensor Objective-C Squid [swift]
INFO: Sensor Objective-C Squid [swift] (done) | time=2982ms
INFO: Sensor Cobertura [swift]
INFO: Sensor Cobertura [swift] (done) | time=6ms
INFO: Sensor Lizard [swift]
INFO: Processing complexity report: /Users/xxx/xxx/lizard-report.xml
WARN: file not included in sonar ./xxx/Frameworks/AlipaySDK.bundle/bridge.js
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 3:16.935s
INFO: Final Memory: 20M/108M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarScanner execution
java.lang.UnsupportedOperationException: Can not add the same measure twice on xxx/imageListen.js: DefaultMeasure[component=MISoundBox/imageListen.js,metric=Metric[uuid=,key=complexity,description=Cyclomatic complexity,type=INT,direction=-1,domain=Complexity,name=Cyclomatic Complexity,qualitative=false,userManaged=false,enabled=true,worstValue=,bestValue=,optimizedBestValue=false,hidden=false,deleteHistoricalData=false,decimalScale=],value=3,fromCore=false,storage=org.sonar.scanner.sensor.DefaultSensorStorage@4d071e4b,saved=false]
at org.sonar.scanner.sensor.DefaultSensorStorage.saveMeasure(DefaultSensorStorage.java:175)
at org.sonar.scanner.sensor.DefaultSensorStorage.store(DefaultSensorStorage.java:135)
at org.sonar.api.batch.sensor.measure.internal.DefaultMeasure.doSave(DefaultMeasure.java:96)
at org.sonar.api.batch.sensor.internal.DefaultStorable.save(DefaultStorable.java:45)
at com.backelite.sonarqube.swift.complexity.LizardReportParser.addComplexityFileMeasures(LizardReportParser.java:185)
at com.backelite.sonarqube.swift.complexity.LizardReportParser.parseMeasure(LizardReportParser.java:122)
at com.backelite.sonarqube.swift.complexity.LizardReportParser.parseFile(LizardReportParser.java:90)
at com.backelite.sonarqube.swift.complexity.LizardReportParser.parseReport(LizardReportParser.java:70)
at com.backelite.sonarqube.swift.complexity.LizardSensor.execute(LizardSensor.java:67)
at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:64)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:88)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$1(ModuleSensorsExecutor.java:61)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy(ModuleSensorsExecutor.java:79)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:61)
at org.sonar.scanner.scan.SpringModuleScanContainer.doAfterStart(SpringModuleScanContainer.java:82)
at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:188)
at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:167)
at org.sonar.scanner.scan.SpringProjectScanContainer.scan(SpringProjectScanContainer.java:401)
at org.sonar.scanner.scan.SpringProjectScanContainer.scanRecursively(SpringProjectScanContainer.java:397)
at org.sonar.scanner.scan.SpringProjectScanContainer.doAfterStart(SpringProjectScanContainer.java:366)
at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:188)
at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:167)
at org.sonar.scanner.bootstrap.SpringGlobalContainer.doAfterStart(SpringGlobalContainer.java:135)
at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:188)
at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:167)
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(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
at jdk.proxy1/jdk.proxy1.$Proxy0.execute(Unknown Source)
at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:189)
at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138)
at org.sonarsource.scanner.cli.Main.execute(Main.java:126)
at org.sonarsource.scanner.cli.Main.execute(Main.java:81)
at org.sonarsource.scanner.cli.Main.main(Main.java:62)
ERROR:
ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.

 [REPLACE THIS WITH YOUR INFORMATION] 
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

1 participant