sonar-swift icon indicating copy to clipboard operation
sonar-swift copied to clipboard

Getting issue in sonar qube implementation

Open northoutaman opened this issue 5 years ago • 12 comments

Apples-MacBook-Air:~ Aman$ cd /Users/Aman/Desktop/SonarDemoApp Apples-MacBook-Air:SonarDemoApp Aman$ ./run-sonar-swift.sh -v Running run-sonar-swift.sh... Project count is [1] Xcode project file is: SonarDemoApp.xcodeproj Xcode workspace file is: SonarDemoApp.xcworkspace Xcode application scheme is: SonarDemoApp Number version from plist is: 1.0 Destination simulator is: platform=iOS Simulator,name=iPhone 7,OS=12.2 Excluded paths from coverage are: Creating directory sonar-reports/ Extracting Xcode project information

  • xcodebuild clean build -workspace SonarDemoApp.xcworkspace -scheme SonarDemoApp -destination 'platform=iOS Simulator,name=iPhone 7,OS=12.2' -destination-timeout 360 COMPILER_INDEX_STORE_ENABLE=NO

  • returnValue=0

  • set +x ▸ Clean Succeeded ▸ Processing Pods-SonarDemoApp-Info.plist ▸ Copying Pods-SonarDemoApp-umbrella.h ▸ Compiling Pods-SonarDemoApp-dummy.m ▸ Compiling Pods_SonarDemoApp_vers.c ▸ Touching Pods_SonarDemoApp.framework (in target: Pods-SonarDemoApp) ▸ Running script '[CP] Check Pods Manifest.lock' ▸ Linking SonarDemoApp ▸ Compiling LaunchScreen.storyboard ▸ Compiling Main.storyboard ▸ Processing Info.plist ▸ Touching SonarDemoApp.app (in target: SonarDemoApp) ▸ Build Succeeded actual = 10081, min = 3 Running surefire

  • xcodebuild clean build test -workspace SonarDemoApp.xcworkspace -scheme SonarDemoApp -configuration Debug -enableCodeCoverage YES -destination 'platform=iOS Simulator,name=iPhone 7,OS=12.2' -destination-timeout 60 2019-06-26 14:40:49.809 xcodebuild[14733:559644] IDETestOperationsObserverDebug: Writing diagnostic log for test session to: /Users/Aman/Library/Developer/Xcode/DerivedData/SonarDemoApp-cyiubsmyinnejyfajvxskoprqjxf/Logs/Test/Run-SonarDemoApp-2019.06.26_14-40-46-+0530.xcresult/3_Test/Diagnostics/SonarDemoAppTests-454BF29F-53BE-4441-BF5D-05608EA531F2/SonarDemoAppTests-03B7A061-E76D-42B4-9364-469D62A905EB/Session-SonarDemoAppTests-2019-06-26_144049-I4wpXz.log 2019-06-26 14:40:49.809 xcodebuild[14733:559519] [MT] IDETestOperationsObserverDebug: (DB557336-EADB-4A57-84F3-B8C2C3541CA8) Beginning test session SonarDemoAppTests-DB557336-EADB-4A57-84F3-B8C2C3541CA8 at 2019-06-26 14:40:49.809 with Xcode 10E1001 on target <DVTiPhoneSimulator: 0x7f9ad0081af0> { SimDevice: iPhone 7 (763FCF55-E246-4DC4-9240-91D57CED4F0A, iOS 12.2, Booted) } (12.2 (16E226)) 2019-06-26 14:40:49.825 xcodebuild[14733:559519] [MT] IDETestOperationsObserverDebug: (DB557336-EADB-4A57-84F3-B8C2C3541CA8) Finished requesting crash reports. Continuing with testing. 2019-06-26 14:40:52.393 xcodebuild[14733:559540] IDETestOperationsObserverDebug: Writing diagnostic log for test session to: /Users/Aman/Library/Developer/Xcode/DerivedData/SonarDemoApp-cyiubsmyinnejyfajvxskoprqjxf/Logs/Test/Run-SonarDemoApp-2019.06.26_14-40-46-+0530.xcresult/3_Test/Diagnostics/SonarDemoAppUITests-E9AC1BD8-AC39-481C-9824-E1091172ABCA/SonarDemoAppUITests-156F3B36-4F43-4BF6-B63A-50AEB0FD0E9D/Session-SonarDemoAppUITests-2019-06-26_144052-uAsYsh.log 2019-06-26 14:40:52.393 xcodebuild[14733:559519] [MT] IDETestOperationsObserverDebug: (64523808-D2DF-4CA8-A7A1-D73230609C32) Beginning test session SonarDemoAppUITests-64523808-D2DF-4CA8-A7A1-D73230609C32 at 2019-06-26 14:40:52.394 with Xcode 10E1001 on target <DVTiPhoneSimulator: 0x7f9ad0081af0> { SimDevice: iPhone 7 (763FCF55-E246-4DC4-9240-91D57CED4F0A, iOS 12.2, Booted) } (12.2 (16E226)) 2019-06-26 14:40:52.408 xcodebuild[14733:559519] [MT] IDETestOperationsObserverDebug: (64523808-D2DF-4CA8-A7A1-D73230609C32) Finished requesting crash reports. Continuing with testing. 2019-06-26 14:41:02.448 xcodebuild[14733:559519] [MT] IDETestOperationsObserverDebug: 12.669 elapsed -- Testing started completed. 2019-06-26 14:41:02.448 xcodebuild[14733:559519] [MT] IDETestOperationsObserverDebug: 0.000 sec, +0.000 sec -- start 2019-06-26 14:41:02.448 xcodebuild[14733:559519] [MT] IDETestOperationsObserverDebug: 12.669 sec, +12.669 sec -- end

  • returnValue=0

  • set +x .T.

    Executed 2 tests, with 0 failures (0 unexpected) in 0.303 (0.306) seconds .

    Executed 1 test, with 0 failures (0 unexpected) in 5.818 (5.824) seconds \nComputing coverage report\n Command line exclusion flags for slather is: slather coverage --binary-basename SonarDemoApp --input-format profdata --cobertura-xml --output-directory sonar-reports --workspace SonarDemoApp.xcworkspace --scheme SonarDemoApp SonarDemoApp.xcodeproj

  • slather coverage --binary-basename SonarDemoApp --input-format profdata --cobertura-xml --output-directory sonar-reports --workspace SonarDemoApp.xcworkspace --scheme SonarDemoApp SonarDemoApp.xcodeproj Slathering... Slathered

  • returnValue=0

  • set +x Running SwiftLint...Linting Swift files at paths . Linting 'SonarDemoAppTests.swift' (1/4) Linting 'SonarDemoAppUITests.swift' (2/4) Linting 'ViewController.swift' (3/4) Linting 'AppDelegate.swift' (4/4) Done linting! Found 15 violations, 2 serious in 4 files. Running Tailor...Running OCLint... Path included in oclint analysis is: --include ./SonarDemoApp/./

  • oclint-json-compilation-database -v --include ../SonarDemoApp/./Podfile ../SonarDemoApp/./Podfile.lock ../SonarDemoApp/./Pods ../SonarDemoApp/./SonarDemoApp ../SonarDemoApp/./SonarDemoApp.xcodeproj ../SonarDemoApp/./SonarDemoApp.xcworkspace ../SonarDemoApp/./SonarDemoAppTests ../SonarDemoApp/./SonarDemoAppUITests ../SonarDemoApp/./build ../SonarDemoApp/./compile_commands.json ../SonarDemoApp/./run-sonar-swift.sh ../SonarDemoApp/./sonar-project.properties ../SonarDemoApp/./sonar-reports ../SonarDemoApp/./tmpFileRunSonarSh ../SonarDemoApp/./xcodebuild.log ./SonarDemoApp/./AppDelegate.swift ./SonarDemoApp/./Assets.xcassets ./SonarDemoApp/./Base.lproj ./SonarDemoApp/./Info.plist ./SonarDemoApp/./ViewController.swift -- -rc LONG_LINE=250 -max-priority-1 10000 -max-priority-2 10000 -max-priority-3 10000 -report-type pmd -o sonar-reports/SonarDemoApp-oclint.xml ------------------------------ OCLint ------------------------------ /usr/local/bin/oclint -p /Users/Aman/Desktop/SonarDemoApp ../SonarDemoApp/./Podfile.lock ../SonarDemoApp/./Pods ../SonarDemoApp/./SonarDemoApp ../SonarDemoApp/./SonarDemoApp.xcodeproj ../SonarDemoApp/./SonarDemoApp.xcworkspace ../SonarDemoApp/./SonarDemoAppTests ../SonarDemoApp/./SonarDemoAppUITests ../SonarDemoApp/./build ../SonarDemoApp/./compile_commands.json ../SonarDemoApp/./run-sonar-swift.sh ../SonarDemoApp/./sonar-project.properties ../SonarDemoApp/./sonar-reports ../SonarDemoApp/./tmpFileRunSonarSh ../SonarDemoApp/./xcodebuild.log ./SonarDemoApp/./AppDelegate.swift ./SonarDemoApp/./Assets.xcassets ./SonarDemoApp/./Base.lproj ./SonarDemoApp/./Info.plist ./SonarDemoApp/./ViewController.swift -rc LONG_LINE=250 -max-priority-1 10000 -max-priority-2 10000 -max-priority-3 10000 -report-type pmd -o sonar-reports/SonarDemoApp-oclint.xml


Skipping /Users/Aman/Desktop/SonarDemoApp/../SonarDemoApp/./Podfile.lock. Compile command not found. Skipping /Users/Aman/Desktop/SonarDemoApp/../SonarDemoApp/./Pods. Compile command not found. Skipping /Users/Aman/Desktop/SonarDemoApp/../SonarDemoApp/./SonarDemoApp. Compile command not found. Skipping /Users/Aman/Desktop/SonarDemoApp/../SonarDemoApp/./SonarDemoApp.xcodeproj. Compile command not found. Skipping /Users/Aman/Desktop/SonarDemoApp/../SonarDemoApp/./SonarDemoApp.xcworkspace. Compile command not found. Skipping /Users/Aman/Desktop/SonarDemoApp/../SonarDemoApp/./SonarDemoAppTests. Compile command not found. Skipping /Users/Aman/Desktop/SonarDemoApp/../SonarDemoApp/./SonarDemoAppUITests. Compile command not found. Skipping /Users/Aman/Desktop/SonarDemoApp/../SonarDemoApp/./build. Compile command not found. Skipping /Users/Aman/Desktop/SonarDemoApp/../SonarDemoApp/./compile_commands.json. Compile command not found. Skipping /Users/Aman/Desktop/SonarDemoApp/../SonarDemoApp/./run-sonar-swift.sh. Compile command not found. Skipping /Users/Aman/Desktop/SonarDemoApp/../SonarDemoApp/./sonar-project.properties. Compile command not found. Skipping /Users/Aman/Desktop/SonarDemoApp/../SonarDemoApp/./sonar-reports. Compile command not found. Skipping /Users/Aman/Desktop/SonarDemoApp/../SonarDemoApp/./tmpFileRunSonarSh. Compile command not found. Skipping /Users/Aman/Desktop/SonarDemoApp/../SonarDemoApp/./xcodebuild.log. Compile command not found. Skipping /Users/Aman/Desktop/SonarDemoApp/SonarDemoApp/./AppDelegate.swift. Compile command not found. Skipping /Users/Aman/Desktop/SonarDemoApp/SonarDemoApp/./Assets.xcassets. Compile command not found. Skipping /Users/Aman/Desktop/SonarDemoApp/SonarDemoApp/./Base.lproj. Compile command not found. Skipping /Users/Aman/Desktop/SonarDemoApp/SonarDemoApp/./Info.plist. Compile command not found. Skipping /Users/Aman/Desktop/SonarDemoApp/SonarDemoApp/./ViewController.swift. Compile command not found.

  • returnValue=0
  • set +x Skipping FauxPas Running Lizard...Running SonarQube using SonarQube Runner
  • sonar-scanner --define sonar.projectVersion=1.0 ./run-sonar-swift.sh: line 101: sonar-scanner: command not found
  • returnValue=127
  • set +x ERROR - Command 'sonar-scanner --define sonar.projectVersion=1.0' failed with error code: 127

Thanks in advance

northoutaman avatar Jun 26 '19 09:06 northoutaman

sonar-scanner: command not found

Have you installed sonar-scanner?

brew install sonar-scanner

davidy4ng avatar Jul 25 '19 08:07 davidy4ng

Yes already installed

northoutaman avatar Jul 25 '19 08:07 northoutaman

What is your JDK version?

gaelfoppolo avatar Aug 09 '19 11:08 gaelfoppolo

Can you run $ sonar-scanner --version ?

davidy4ng avatar Aug 20 '19 13:08 davidy4ng

on run $ sonar-scanner --version getting below result.

Apples-MacBook-Air:Wanna Aman$ sonar-scanner --version INFO: Scanner configuration file: /usr/local/Cellar/sonar-scanner/4.0.0.1744/libexec/conf/sonar-scanner.properties INFO: Project root configuration file: /Users/Aman/Desktop/Wanna/sonar-project.properties INFO: SonarQube Scanner 4.0.0.1744 INFO: Java 12.0.1 Oracle Corporation (64-bit) INFO: Mac OS X 10.14.3 x86_64

northoutaman avatar Aug 20 '19 13:08 northoutaman

What is your JDK and JRE version?

Run java -version. Go to System Preferences, open Java Control Panel. You will find the version in General > About.

gaelfoppolo avatar Aug 24 '19 12:08 gaelfoppolo

Apples-MacBook-Air:~ Aman$ java -version openjdk version "12.0.1" 2019-04-16 OpenJDK Runtime Environment (build 12.0.1+12) OpenJDK 64-Bit Server VM (build 12.0.1+12, mixed mode, sharing)

northoutaman avatar Aug 26 '19 05:08 northoutaman

I think your Java version is incompatible with sonar-scanner. Could you try downgrade to Java 8 (JDK & JRE) and test again?

gaelfoppolo avatar Aug 26 '19 08:08 gaelfoppolo

@northoutaman did you resolve this issue?

I am also facing the same issue.

thejaa avatar Aug 10 '20 14:08 thejaa

run-sonar-swift.sh: line 101: slather: command not found

  • returnValue=127

I am getting this error

Kishore-iOS-dev avatar Mar 19 '21 13:03 Kishore-iOS-dev

run-sonar-swift.sh: line 101: slather: command not found

  • returnValue=127

I am getting this error

I am also getting same issue. @Kishore-iOS-dev did you get the answer.

Sonar scanner is installed accurately as I checked twice.

Alokcbre avatar Jul 28 '21 09:07 Alokcbre

run-sonar-swift.sh: line 101: slather: command not found

  • returnValue=127

I am getting this error

please run the command - sudo gem install slather

azharuddinhk avatar Sep 09 '21 01:09 azharuddinhk