UITests iOS/SnapshotHelper.swift
Function snapshot
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
open class func snapshot(_ name: String, timeWaitingForIdle timeout: TimeInterval = 20) {
if timeout > 0 {
waitForLoadingIndicatorToDisappear(within: timeout)
}
Function snapshot
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
open class func snapshot(_ name: String, timeWaitingForIdle timeout: TimeInterval = 20) {
if timeout > 0 {
waitForLoadingIndicatorToDisappear(within: timeout)
}
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Line should be 120 characters or less: currently 158 characters Open
Open
let networkLoadingIndicatorDisappeared = XCTNSPredicateExpectation(predicate: NSPredicate(format: "exists == false"), object: networkLoadingIndicator)
- Exclude checks
Line should be 120 characters or less: currently 122 characters Open
Open
let hasNewLoadingIndicatorSize = frame.size.width.isBetween(46, and: 47) && frame.size.height.isBetween(2, and: 3)
- Exclude checks
Line should be 120 characters or less: currently 133 characters Open
Open
let matches = regex.matches(in: launchArguments, options: [], range: NSRange(location: 0, length: launchArguments.count))
- Exclude checks
Line should be 120 characters or less: currently 126 characters Open
Open
/// - timeout: Amount of seconds to wait until the network loading indicator disappears. Pass `0` if you don't want to wait.
- Exclude checks
Line should be 120 characters or less: currently 139 characters Open
Open
NSLog("snapshot: \(name)") // more information about this, check out https://docs.fastlane.tools/actions/snapshot/#how-does-it-work
- Exclude checks
Line should be 120 characters or less: currently 143 characters Open
Open
guard var simulator = ProcessInfo().environment["SIMULATOR_DEVICE_NAME"], let screenshotsDir = screenshotsDirectory else { return }
- Exclude checks
Line should be 120 characters or less: currently 144 characters Open
Open
// The simulator name contains "Clone X of " inside the screenshot file when running parallelized UI Tests on concurrent devices
- Exclude checks
Line should be 120 characters or less: currently 135 characters Open
Open
let image = XCUIDevice.shared.orientation.isLandscape ? fixLandscapeOrientation(image: screenshot.image) : screenshot.image
- Exclude checks