iOS-在声纳脚本“ run-sonar-swift”上获取错误“度量标准文件不应由传感器计算”

时间:2019-07-12 13:59:06

标签: ios swift sonarqube sonarqube-scan

我正在尝试实现声纳qube swift。我已经安装了可以在链接中找到的所有必备组件设置。

https://medium.com/@pranay.urkude/sonarqube-integration-with-ios-b76df8405014

但是当我运行./run-sonar-swift.sh -v命令时,出现了错误。 “度量文件不应该由传感器计算”如何修复。还请检查日志。

Last login: Fri Jul 12 19:15:45 on ttys001
Apples-MacBook-Air:~ Aman$ cd /Users/Aman/Desktop/Wanna 
Apples-MacBook-Air:Wanna Aman$ ./run-sonar-swift.sh -v
Running run-sonar-swift.sh...
Project count is [1]
Xcode project file is: Wanna.xcodeproj
Xcode workspace file is: Wanna.xcworkspace
Xcode application scheme is: Wanna
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 Wanna.xcworkspace -scheme Wanna -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-Wanna-Info.plist
▸ Copying Pods-Wanna-umbrella.h
▸ Compiling Pods-Wanna-dummy.m
▸ Compiling Pods_Wanna_vers.c
▸ Touching Pods_Wanna.framework (in target: Pods-Wanna)
▸ Running script '[CP] Check Pods Manifest.lock'
▸ Compiling ViewController.swift
▸ Compiling AppDelegate.swift
▸ Linking Wanna
▸ Compiling Main.storyboard
▸ Compiling LaunchScreen.storyboard
▸ Processing Info.plist
▸ Touching Wanna.app (in target: Wanna)
▸ Build Succeeded
actual = 9549, min = 3
Running surefire
+ xcodebuild clean build test -workspace Wanna.xcworkspace -scheme Wanna -configuration Debug -enableCodeCoverage YES -destination 'platform=iOS Simulator,name=iPhone 7,OS=12.2' -destination-timeout 60
2019-07-12 19:16:56.595 xcodebuild[2538:31016]  IDETestOperationsObserverDebug: Writing diagnostic log for test session to:
/Users/Aman/Library/Developer/Xcode/DerivedData/Wanna-flozsuddkzcjfadhlxefzthqazgq/Logs/Test/Run-Wanna-2019.07.12_19-16-51-+0530.xcresult/3_Test/Diagnostics/WannaTests-ED662E3A-2087-4929-9F05-681BECAC8C60/WannaTests-998828F4-DDDA-4DAD-80B6-724106B768C6/Session-WannaTests-2019-07-12_191656-XU3bOi.log
2019-07-12 19:16:56.595 xcodebuild[2538:30967] [MT] IDETestOperationsObserverDebug: (573B1DD4-FF08-4C48-BD22-8F1AB2653CD7) Beginning test session WannaTests-573B1DD4-FF08-4C48-BD22-8F1AB2653CD7 at 2019-07-12 19:16:56.595 with Xcode 10E1001 on target <DVTiPhoneSimulator: 0x7fbd687cabf0> {
        SimDevice: iPhone 7 (763FCF55-E246-4DC4-9240-91D57CED4F0A, iOS 12.2, Shutdown)
} (12.2 (16E226))
2019-07-12 19:17:08.263 xcodebuild[2538:30967] [MT] IDETestOperationsObserverDebug: (573B1DD4-FF08-4C48-BD22-8F1AB2653CD7) Finished requesting crash reports. Continuing with testing.
2019-07-12 19:17:21.576 xcodebuild[2538:32310]  IDETestOperationsObserverDebug: Writing diagnostic log for test session to:
/Users/Aman/Library/Developer/Xcode/DerivedData/Wanna-flozsuddkzcjfadhlxefzthqazgq/Logs/Test/Run-Wanna-2019.07.12_19-16-51-+0530.xcresult/3_Test/Diagnostics/WannaUITests-778C9CEC-66B8-4951-9E02-A709C4DF0D6A/WannaUITests-34AE0BCE-DA91-4D03-AA51-E59298A07EC9/Session-WannaUITests-2019-07-12_191721-eWoJ3t.log
2019-07-12 19:17:21.577 xcodebuild[2538:30967] [MT] IDETestOperationsObserverDebug: (85A8F8A1-6DF5-4F89-A21C-4915A028BC5A) Beginning test session WannaUITests-85A8F8A1-6DF5-4F89-A21C-4915A028BC5A at 2019-07-12 19:17:21.577 with Xcode 10E1001 on target <DVTiPhoneSimulator: 0x7fbd687cabf0> {
        SimDevice: iPhone 7 (763FCF55-E246-4DC4-9240-91D57CED4F0A, iOS 12.2, Booted)
} (12.2 (16E226))
2019-07-12 19:17:21.595 xcodebuild[2538:30967] [MT] IDETestOperationsObserverDebug: (85A8F8A1-6DF5-4F89-A21C-4915A028BC5A) Finished requesting crash reports. Continuing with testing.
2019-07-12 19:17:31.293 xcodebuild[2538:30967] [MT] IDETestOperationsObserverDebug: 34.740 elapsed -- Testing started completed.
2019-07-12 19:17:31.293 xcodebuild[2538:30967] [MT] IDETestOperationsObserverDebug: 0.000 sec, +0.000 sec -- start
2019-07-12 19:17:31.294 xcodebuild[2538:30967] [MT] IDETestOperationsObserverDebug: 34.740 sec, +34.740 sec -- end
+ returnValue=0
+ set +x
.T.
     Executed 2 tests, with 0 failures (0 unexpected) in 0.412 (0.422) seconds
     Executed 1 test, with 0 failures (0 unexpected) in 5.183 (5.188) seconds
\nComputing coverage report\n
Command line exclusion flags for slather is:
slather coverage --binary-basename Wanna --input-format profdata --cobertura-xml --output-directory sonar-reports --workspace Wanna.xcworkspace --scheme Wanna Wanna.xcodeproj
+ slather coverage --binary-basename Wanna --input-format profdata --cobertura-xml --output-directory sonar-reports --workspace Wanna.xcworkspace --scheme Wanna Wanna.xcodeproj
Slathering...
Slathered
+ returnValue=0
+ set +x
Running SwiftLint...dyld: Library not loaded: @rpath/libswiftCore.dylib
  Referenced from: /usr/local/bin/swiftlint
  Reason: image not found
./run-sonar-swift.sh: line 384:  2792 Abort trap: 6           $SWIFTLINT_CMD lint --path "$word" > sonar-reports/"$appScheme"-swiftlint.txt
Running Tailor...Running OCLint...
Path included in oclint analysis is: --include .*/Wanna/Wanna/*
+ oclint-json-compilation-database -v --include ../Wanna/Wanna/AppDelegate.swift ../Wanna/Wanna/Assets.xcassets ../Wanna/Wanna/Base.lproj ../Wanna/Wanna/Info.plist ../Wanna/Wanna/ViewController.swift -- -rc LONG_LINE=250 -max-priority-1 10000 -max-priority-2 10000 -max-priority-3 10000 -report-type pmd -o sonar-reports/Wanna-oclint.xml
------------------------------ OCLint ------------------------------
/usr/local/bin/oclint -p /Users/Aman/Desktop/Wanna ../Wanna/Wanna/Assets.xcassets ../Wanna/Wanna/Base.lproj ../Wanna/Wanna/Info.plist ../Wanna/Wanna/ViewController.swift -rc LONG_LINE=250 -max-priority-1 10000 -max-priority-2 10000 -max-priority-3 10000 -report-type pmd -o sonar-reports/Wanna-oclint.xml
Skipping /Users/Aman/Desktop/Wanna/../Wanna/Wanna/Assets.xcassets. Compile command not found.
Skipping /Users/Aman/Desktop/Wanna/../Wanna/Wanna/Base.lproj. Compile command not found.
Skipping /Users/Aman/Desktop/Wanna/../Wanna/Wanna/Info.plist. Compile command not found.
Skipping /Users/Aman/Desktop/Wanna/../Wanna/Wanna/ViewController.swift. Compile command not found.
+ returnValue=0
+ set +x
Running FauxPas...Determining build settings for 3 targets and 2 build configurations
The Xcode project format is "Xcode 9.3". Faux Pas supports Xcode projects that are Xcode 8.0 or 6.3 or 3.2 or 3.1 -compatible. Some features may not work correctly.
Checking project: Wanna
          target: Wanna
   configuration: Release
         ruleset: 86 Rules tagged [Recommended]: UndetachedDelegate, InvalidStringsFile, StringsFileEncoding, UIKitKVO, UnnecessaryNullCheck, RetinaImagesResolution, AssertionSideEffects, SuspiciousResources, NullCoalescingOp, LoadMethodWithoutAutoreleasePool, UnknownResourceCodeReference, StringsdictWithoutStrings, InitializeSuperInvocation, UnsupportedWeakReference, CompilerWarnings, HardcodedUIString, HardcodedSelfClass, MacroBasedIncludeGuard, RestrictedDirectMethodCall, RecommendedVCSIgnores, RetainingImmutableProperty, MissingAPIUsageDescription, CompleteNotificationCenterDetachment, XIBRuntimeAttributeMismatch, ThreadUnsafeInstanceCaching, MissingTranslation, RestrictedMethodOverride, MissingDeviceTypeResource, OldVerboseObjCSyntax, ViewLayoutInXIB, IsEqualAndHash, FileRefOutsideVCS, LiteralStringKeyPath, BasicProjectSettings, DuplicateTranslation, StrongDelegate, ConstructorReturnType, SetterInvocationInInitOrDealloc, ArgumentModification, FastEnumElementOutside, UnusedErrorValue, CopyingMutableProperty, ImplicitBundleId, UnnecessaryNibMethod, AssociatedObjectOnValueType, OrderedPointerToZeroComparison, PrefixHeaderIncludeSuggestion, ReleaseBuildCompilerArgs, XcconfigOverwrites, BuildSettingSelfReference, BuildSettingPlacement, FixedFormatDateFormatter, TerminatingApp, AbsPathInBuildSetting, PrivateCategory, FileRefWithAbsPath, MissingImageResolutionVariant, TranslationPunctuation, WeakReferenceToTopLevelXIBObject, UnprefixedClass, InitializeMethodCategoryOverride, SuspiciousDateTimeFormat, ReleaseBuildConfig, AssigningDelegate, UnknownResourceXIBReference, GlobalAndLocalizedResource, UnknownResourceModifier, Swizzling, ZeroAssignmentToPointer, DiscardedOpaqueNotificationObserver, DylibInstallName, TranslationFormatMismatch, SuspiciousMissingResources, ErrorConditionCheck, RedundantInclude, ReservedPrefix, NSLogUsed, UnprefixedCategoryMethod, UnidiomaticAccessorNaming, UncommentedLocalizedString, DuplicateResource, ViewControllerInitWithNibName, CategoryMethodConflict, BlockAPIRetainCycle, FileRefIgnoredInVCS, MissingNotificationCenterDetachment
Trial Version: Delaying operation for 15 more seconds…
Trial Version: Delaying operation for 14 more seconds…
Trial Version: Delaying operation for 13 more seconds…
Trial Version: Delaying operation for 12 more seconds…
Trial Version: Delaying operation for 11 more seconds…
Trial Version: Delaying operation for 10 more seconds…
Trial Version: Delaying operation for 9 more seconds…
Trial Version: Delaying operation for 8 more seconds…
Trial Version: Delaying operation for 7 more seconds…
Trial Version: Delaying operation for 6 more seconds…
Trial Version: Delaying operation for 5 more seconds…
Trial Version: Delaying operation for 4 more seconds…
Trial Version: Delaying operation for 3 more seconds…
Trial Version: Delaying operation for 2 more seconds…
Trial Version: Delaying operation for 1 more seconds…
Initialization: Determining VCS state...
Initialization: Resolving build settings...
Rule InvalidStringsFile will not be applied: “Applies to localized projects.”
Rule StringsFileEncoding will not be applied: “Applies to projects under Git version control.”
Rule LoadMethodWithoutAutoreleasePool will not be applied: “Applies to projects targeting an OS prior to iOS 6 or Mac OS 10.8.”
Rule StringsdictWithoutStrings will not be applied: “Applies to localized projects.”
Rule UnsupportedWeakReference will not be applied: “Applies to OS X targets.”
Rule HardcodedUIString will not be applied: “Applies to localized projects.”
Rule RecommendedVCSIgnores will not be applied: “Applies to projects under Git version control.”
Rule MissingTranslation will not be applied: “Applies to localized projects.”
Rule FileRefOutsideVCS will not be applied: “Applies to projects using one of these version control systems: Git, Mercurial, Bazaar, Subversion, Fossil.”
Rule DuplicateTranslation will not be applied: “Applies to localized projects.”
Rule PrefixHeaderIncludeSuggestion will not be applied: “Applies to projects that use a prefix header, and have at least 10 source code files.”
Rule TranslationPunctuation will not be applied: “Applies to localized projects.”
Rule DylibInstallName will not be applied: “Applies to OS X targets.”
Rule TranslationFormatMismatch will not be applied: “Applies to localized projects.”
Rule RedundantInclude will not be applied: “Applies to projects using a prefix header.”
Rule UncommentedLocalizedString will not be applied: “Applies to localized projects.”
Rule FileRefIgnoredInVCS will not be applied: “Applies to projects under Git version control.”
Rule MissingNotificationCenterDetachment will not be applied: “Applies to projects targeting an OS prior to iOS 9 or Mac OS 10.11.”
Initialization: Performing full build: required because project contains Swift code
Initialization: Building the project
Initialization: Processing build steps
ERROR: Initialization: Could not determine build steps for specified target 'Wanna'
Preparation failed → clearing build log caches
Checked total 0 code statements in 00:00:25.249 (the preparation took 00:00:10.168 (40.3%)).
Total 0 diagnostics.
(Evaluation trial limitation: only 5 random diagnostics will be returned when using machine-readable output.)
Some errors were encountered. If these are a problem, please consider the following remedies:
• Just try again — the project caches have now been cleared
• If source files are generated during builds, or if interpreting this project's source code otherwise depends on full builds to occur, enable the 'Build project before checking' option.
• In general, ensure that the xcodebuild arguments Faux Pas uses are correct: enable the 'verbose' option and try performing the checks to see what arguments are being used, and then determine if they need to be adjusted
Running Lizard...Running SonarQube using SonarQube Runner
+ sonar-scanner --define sonar.projectVersion=1.0
INFO: Scanner configuration file: /usr/local/Cellar/sonar-scanner/3.3.0.1492/libexec/conf/sonar-scanner.properties
INFO: Project root configuration file: /Users/Aman/Desktop/Wanna/sonar-project.properties
INFO: SonarQube Scanner 3.3.0.1492
INFO: Java 12.0.1 Oracle Corporation (64-bit)
INFO: Mac OS X 10.14.3 x86_64
INFO: User cache: /Users/Aman/.sonar/cache
INFO: SonarQube server 7.8.0
INFO: Default locale: "en_GB", source code encoding: "UTF-8"
INFO: Load global settings
INFO: Load global settings (done) | time=533ms
INFO: Server id: BF41A1F2-AWuNWdSUCpjAtTAZFaov
INFO: User cache: /Users/Aman/.sonar/cache
INFO: Load/download plugins
INFO: Load plugins index
INFO: Load plugins index (done) | time=476ms
INFO: Load/download plugins (done) | time=778ms
INFO: Loaded core extensions: developer-scanner
INFO: Process project properties
INFO: Execute project builders
INFO: Execute project builders (done) | time=8ms
INFO: Project key: com.Wanna.demo
INFO: Base dir: /Users/Aman/Desktop/Wanna
INFO: Working dir: /Users/Aman/Desktop/Wanna/.scannerwork
INFO: Load project settings for component key: 'com.Wanna.demo'
INFO: Load project branches
INFO: Load project branches (done) | time=406ms
INFO: Load project pull requests
INFO: Load project pull requests (done) | time=405ms
INFO: Load branch configuration
INFO: Load branch configuration (done) | time=2ms
INFO: Load quality profiles
INFO: Load quality profiles (done) | time=960ms
INFO: Load active rules
INFO: Load active rules (done) | time=13239ms
WARN: SCM provider autodetection failed. Please use "sonar.scm.provider" to define SCM of your project, or disable the SCM Sensor in the project settings.
INFO: Indexing files...
INFO: Project configuration:
INFO:   Excluded sources: Pods/*, *.swift
INFO:   Included tests: *.swift
INFO: 7 files indexed
INFO: 0 files ignored because of inclusion/exclusion patterns
INFO: Quality profile for swift: Swift
INFO: ------------- Run sensors on module Wanna_iOS
INFO: Load metrics repository
INFO: Load metrics repository (done) | time=473ms
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by net.sf.cglib.core.ReflectUtils$1 (file:/Users/Aman/.sonar/cache/a89f1943fc75b65becd9fb4ecab8d913/sonar-tsql-plugin.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of net.sf.cglib.core.ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
INFO: Sensor JavaXmlSensor [java]
INFO: Sensor JavaXmlSensor [java] (done) | time=3ms
INFO: Sensor HTML [web]
INFO: Sensor HTML [web] (done) | time=25ms
INFO: Sensor SonarSwift [swift]
INFO: 2 source files to be analyzed
INFO: Load project repositories
INFO: Load project repositories (done) | time=449ms
INFO: 2/2 source files have been analyzed
INFO: Sensor SonarSwift [swift] (done) | time=2670ms
INFO: Sensor JaCoCo XML Report Importer [jacoco]
INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=6ms
INFO: Sensor SwiftLint [backelitesonarswiftplugin]
INFO: Processing SwiftLint report sonar-reports/Wanna-swiftlint.txt
INFO: Sensor SwiftLint [backelitesonarswiftplugin] (done) | time=28ms
INFO: Sensor Tailor [backelitesonarswiftplugin]
INFO: Processing Tailor report sonar-reports/Wanna-tailor.txt
INFO: Sensor Tailor [backelitesonarswiftplugin] (done) | time=24ms
INFO: Sensor Swift Squid [backelitesonarswiftplugin]
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 28.450s
INFO: Final Memory: 23M/84M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarQube Scanner execution
ERROR: Metric 'files' should not be computed by a Sensor
ERROR: 
ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.
+ returnValue=1
+ set +x
ERROR - Command 'sonar-scanner --define sonar.projectVersion=1.0' failed with error code: 1
Apples-MacBook-Air:Wanna Aman$ 

预先感谢

0 个答案:

没有答案