Showing 78 of 112 total issues
Function executeWithConnection
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static func executeWithConnection(flags: SD.Flags, closure: ()->Void) -> Int? {
//create error variable
var error: Int? = 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 createIndex
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
func createIndex(name: String, columns: [String], table: String, unique: Bool) -> Int? {
if columns.count < 1 {
print("SwiftData Error -> During: Creating Index")
print(" -> Code: 401 - At least one column name must be provided")
- 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
Method startTone
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public void startTone(String name) {
int tone = 0;
int duration = 1000;
if (name.equals("beep")) {
- 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 locationManager
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
func locationManager(manager: CLLocationManager, monitoringDidFailForRegion region: CLRegion?, withError error: NSError) {
log("Monitoring region \(region!.identifier) failed. Reson: \(error.description)")
if let clRegion = region as? CLCircularRegion {
if let command = self.addOrUpdateCallbacks[clRegion] {
var errors = [[String:String]]()
- 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
Avoid too many return
statements within this function. Open
return nil
Avoid too many return
statements within this function. Open
return Double(sqlite3_column_double(statement, index))
Avoid too many return
statements within this function. Open
return dateFormatter.dateFromString(string)
Avoid too many return
statements within this function. Open
return "X'\(newStr)'"
Avoid too many return
statements within this function. Open
return nil
Avoid too many return
statements within this function. Open
return "'\(escapeStringValue(imageID))'"
Avoid too many return
statements within this method. Open
return Uri.EMPTY;
Avoid too many return
statements within this function. Open
return "NULL"
Avoid too many return
statements within this function. Open
return nil
Avoid too many return
statements within this function. Open
return sqlite3_column_int(statement, index) != 0
Avoid too many return
statements within this function. Open
return "NULL"
Avoid too many return
statements within this function. Open
return "\(escapeValue(dateFormatter.stringFromDate(obj as! NSDate)))"
Avoid too many return
statements within this function. Open
return nil
Avoid too many return
statements within this function. Open
return "NULL"
Avoid too many return
statements within this function. Open
return Int(status)
Avoid too many return
statements within this function. Open
return nil