cowbell/cordova-plugin-geofence

View on GitHub

Showing 78 of 112 total issues

Avoid too many return statements within this function.
Open

            return nil
Severity: Major
Found in src/ios/SwiftData.swift - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

                        return nil
    Severity: Major
    Found in src/ios/SwiftData.swift - About 30 mins to fix

      Function executeQuery has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          public static func executeQuery(sqlStr: String) -> (result: [SDRow], error: Int?) {
      
              //create result and error variables
              var result = [SDRow] ()
              var error: Int? = nil
      Severity: Minor
      Found in src/ios/SwiftData.swift - About 25 mins to fix

      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 closeCustomConnection has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

              func closeCustomConnection() -> Int? {
      
                  //check if in trasaction
                  if inTransaction {
                      print("SwiftData Error -> During: Closing Database with Flags")
      Severity: Minor
      Found in src/ios/SwiftData.swift - About 25 mins to fix

      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 close has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

              func close() {
      
                  //check if in transaction
                  if inTransaction || openWithFlags || savepointsOpen > 0 {
                      return
      Severity: Minor
      Found in src/ios/SwiftData.swift - About 25 mins to fix

      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 executeQuery has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          public static func executeQuery(sqlStr: String, withArgs: [AnyObject]) -> (result: [SDRow], error: Int?) {
      
              //create result and error variables
              var result = [SDRow] ()
              var error: Int? = nil
      Severity: Minor
      Found in src/ios/SwiftData.swift - About 25 mins to fix

      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 existingTables has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          public static func existingTables() -> (result: [String], error: Int?) {
      
              //create result and error variables
              var result = [String] ()
              var error: Int? = nil
      Severity: Minor
      Found in src/ios/SwiftData.swift - About 25 mins to fix

      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 onRequestPermissionResult has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          public void onRequestPermissionResult(int requestCode, String[] permissions,
                                                int[] grantResults) throws JSONException {
              PluginResult result;
      
              if (executedAction != null) {
      Severity: Minor
      Found in src/android/GeofencePlugin.java - About 25 mins to fix

      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 executeChange has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          public static func executeChange(sqlStr: String) -> Int? {
      
              //create error variable
              var error: Int? = nil
      
      
      Severity: Minor
      Found in src/ios/SwiftData.swift - About 25 mins to fix

      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 removeIndex has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          public static func removeIndex(indexName: String) -> Int? {
      
              //create the error variable
              var error: Int? = nil
      
      
      Severity: Minor
      Found in src/ios/SwiftData.swift - About 25 mins to fix

      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 open has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

              func open() -> Int? {
      
                  //check if in a transaction
                  if inTransaction || openWithFlags || savepointsOpen > 0 {
                      return nil
      Severity: Minor
      Found in src/ios/SwiftData.swift - About 25 mins to fix

      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 lastInsertedRowID has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          public static func lastInsertedRowID() -> (rowID: Int, error: Int?) {
      
              //create result and error variables
              var result = 0
              var error: Int? = nil
      Severity: Minor
      Found in src/ios/SwiftData.swift - About 25 mins to fix

      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 existingIndexes has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          public static func existingIndexes() -> (result: [String], error: Int?) {
      
              //create the result and error variables
              var result = [String] ()
              var error: Int? = nil
      Severity: Minor
      Found in src/ios/SwiftData.swift - About 25 mins to fix

      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 didReceiveLocalNotification has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          func didReceiveLocalNotification (notification: NSNotification) {
              log("didReceiveLocalNotification")
              if UIApplication.sharedApplication().applicationState != UIApplicationState.Active {
                  var data = "undefined"
                  if let uiNotification = notification.object as? UILocalNotification {
      Severity: Minor
      Found in src/ios/GeofencePlugin.swift - About 25 mins to fix

      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 6 (exceeds 5 allowed). Consider refactoring.
      Open

          public static func createIndex(name name: String, onColumns: [String], inTable: String, isUnique: Bool = false) -> Int? {
      
              //create the error variable
              var error: Int? = nil
      
      
      Severity: Minor
      Found in src/ios/SwiftData.swift - About 25 mins to fix

      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 executeChange has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          public static func executeChange(sqlStr: String, withArgs: [AnyObject]) -> Int? {
      
              //create success variable
              var error: Int? = nil
      
      
      Severity: Minor
      Found in src/ios/SwiftData.swift - About 25 mins to fix

      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 numberOfRowsModified has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          public static func numberOfRowsModified() -> (rowID: Int, error: Int?) {
      
              //create result and error variables
              var result = 0
              var error: Int? = nil
      Severity: Minor
      Found in src/ios/SwiftData.swift - About 25 mins to fix

      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 existingIndexesForTable has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          public static func existingIndexesForTable(table: String) -> (result: [String], error: Int?) {
      
              //create the result and error variables
              var result = [String] ()
              var error: Int? = nil
      Severity: Minor
      Found in src/ios/SwiftData.swift - About 25 mins to fix

      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

      Severity
      Category
      Status
      Source
      Language