Showing 189 of 674 total issues
Function bridge
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
func bridge() throws {
guard semaphore == true, knownBridges.count > 0 else {
if knownBridges.count == 0 {
print("No known bridges")
}
- 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
Function disconnect
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
func disconnect(from device: XYBluetoothDevice) {
print("STEP 1: Trying to DISCONNECT from \(device.id.shortId)...")
let disconnectQueue = DispatchQueue(label: "com.xyfindables.sdk.ConnectionManagerDisconnectQueueFor\(device.id)")
- 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
Function detected
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public override func detected(_ rssi: Int) {
guard self.isUpdatingFirmware == false else { return }
var events: [XYFinderEventNotification] = [.detected(device: self, powerLevel: Int(self.powerLevel), rssi: self.rssi, distance: 0)]
- 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
Function doBoundWitness
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
func doBoundWitness(withDevice: XyoBluetoothDevice, withCompletion: BoundWitnessCallback) throws {
self.delegate?.boundWitness(started: withDevice.id)
withDevice.connection {
Function doBoundWitness
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
func doBoundWitness(withDevice: XyoBluetoothDevice, withCompletion: BoundWitnessCallback) throws {
self.delegate?.boundWitness(started: withDevice.id)
withDevice.connection {
Function doBoundWitness
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public func doBoundWitness (transfer: XyoIterableStructure?, completion : @escaping (_: XyoError?)->()?) {
do {
if (cycles >= XyoZigZagBoundWitnessSession.maxNumberOfCycles) {
completion(XyoError.UNKNOWN_ERROR)
return
Function doBoundWitness
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public func doBoundWitness (transfer: XyoIterableStructure?, completion : @escaping (_: XyoError?)->()?) {
do {
if (cycles >= XyoZigZagBoundWitnessSession.maxNumberOfCycles) {
completion(XyoError.UNKNOWN_ERROR)
return
Function bridge
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
func bridge() throws {
guard semaphore == true, knownBridges.count > 0 else {
if knownBridges.count == 0 {
print("No known bridges")
}
Function bridge
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
func bridge() throws {
guard semaphore == true, knownBridges.count > 0 else {
if knownBridges.count == 0 {
print("No known bridges")
}
Function peripheral
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
func peripheral(_ peripheral: CBPeripheral, didUpdateValueFor characteristic: CBCharacteristic, error: Error?) {
operationsQueue.async {
guard self.status != .disconnected || self.status != .timedOut else { return }
guard error == nil else {
- 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
Function getHumanHeuristics
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public static func getHumanHeuristics(boundWitness: XyoBoundWitness) -> [String: String] {
do {
var returnArray: [String: String] = [:]
guard let numberOfParties = try boundWitness.getNumberOfParties() else {
return [:]
- 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
Function peripheral
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
func peripheral(_ peripheral: CBPeripheral, didUpdateValueFor characteristic: CBCharacteristic, error: Error?) {
operationsQueue.async {
guard self.status != .disconnected || self.status != .timedOut else { return }
guard error == nil else {
- 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
Function getHumanHeuristics
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public static func getHumanHeuristics(boundWitness: XyoBoundWitness) -> [String: String] {
do {
var returnArray: [String: String] = [:]
guard let numberOfParties = try boundWitness.getNumberOfParties() else {
return [:]
- 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
Function boundWitness
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public func boundWitness (handler : XyoNetworkHandler,
procedureCatalogue: XyoProcedureCatalog,
completion: @escaping (_: XyoBoundWitness?, _: XyoError?)->()) {
if (currentBoundWitnessSession != nil) {
Function boundWitness
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public func boundWitness (handler : XyoNetworkHandler,
procedureCatalogue: XyoProcedureCatalog,
completion: @escaping (_: XyoBoundWitness?, _: XyoError?)->()) {
if (currentBoundWitnessSession != nil) {
Function getValues
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
func getValues() {
guard let device = self.device else { return }
self.characteristicValues.removeAll()
var values = [XYBluetoothResult]()
self.gattSpinner.startAnimation(self)
Function testPromiseAllHeterogeneous4Reject
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
func testPromiseAllHeterogeneous4Reject() {
// Arrange.
let promise1 = Promise { fulfill, _ in
Test.delay(0.1) {
fulfill(42)
Function testPromiseRetryNoDeallocUntilResolved
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
func testPromiseRetryNoDeallocUntilResolved() {
// Arrange.
weak var weakExtendedPromise1: Promise<Int>?
weak var weakExtendedPromise2: Promise<Int>?
let customAttempts = 3
Function build
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public func build() throws -> XyoNode {
if (XyoSdk.nodes.count > 0) {
throw XyoNodeBuilderError(kind: .alreadyNodes)
}
if (self.storage == nil) {
- 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
Function doBoundWitness
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
func doBoundWitness(withDevice: XyoBluetoothDevice, withCompletion: BoundWitnessCallback) throws {
self.delegate?.boundWitness(started: withDevice.id)
withDevice.connection {
- 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"