cowbell/cordova-plugin-geofence

View on GitHub
src/ios/SwiftData.swift

Summary

Maintainability
F
2 wks
Test Coverage

File SwiftData.swift has 1191 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import Foundation
import UIKit


// MARK: - SwiftData
Severity: Major
Found in src/ios/SwiftData.swift - About 3 days to fix

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

            func executeQuery(sqlStr: String, withArgs: [AnyObject]? = nil) -> (result: [SDRow], error: Int?) {
    
                var resultSet = [SDRow]()
    
                var sql = sqlStr
    Severity: Minor
    Found in src/ios/SwiftData.swift - About 5 hrs 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 escapeValue has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
    Open

        func escapeValue(obj: AnyObject?) -> String {
    
            if let obj: AnyObject = obj {
    
                if obj is String {
    Severity: Minor
    Found in src/ios/SwiftData.swift - About 4 hrs 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 errorMessageFromCode has 96 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private static func errorMessageFromCode(errorCode: Int) -> String {
    
            switch errorCode {
    
            //no error
    Severity: Major
    Found in src/ios/SwiftData.swift - About 3 hrs to fix

      Function executeQuery has 70 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              func executeQuery(sqlStr: String, withArgs: [AnyObject]? = nil) -> (result: [SDRow], error: Int?) {
      
                  var resultSet = [SDRow]()
      
                  var sql = sqlStr
      Severity: Major
      Found in src/ios/SwiftData.swift - About 2 hrs to fix

        Function bind has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
        Open

            func bind(objects: [AnyObject], toSQL sql: String) -> (string: String, error: Int?) {
        
                var newSql = ""
                var bindIndex = 0
                var i = false
        Severity: Minor
        Found in src/ios/SwiftData.swift - About 2 hrs 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 savepoint has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
        Open

            public static func savepoint(savepointClosure: ()->Bool) -> Int? {
        
                //create the error variable
                var error: Int? = nil
        
        
        Severity: Minor
        Found in src/ios/SwiftData.swift - About 2 hrs 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

        SwiftData has 23 methods (exceeds 20 allowed). Consider refactoring.
        Open

        public struct SwiftData {
        
        
            // MARK: - Public SwiftData Functions
        
        
        Severity: Minor
        Found in src/ios/SwiftData.swift - About 2 hrs to fix

          Function transaction has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
          Open

              public static func transaction(transactionClosure: ()->Bool) -> Int? {
          
                  //create the error variable
                  var error: Int? = nil
          
          
          Severity: Minor
          Found in src/ios/SwiftData.swift - About 2 hrs 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 executeMultipleChanges has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
          Open

              public static func executeMultipleChanges(sqlArr: [String]) -> Int? {
          
                  //create error variable
                  var error: Int? = nil
          
          
          Severity: Minor
          Found in src/ios/SwiftData.swift - About 1 hr 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 escapeValue has 41 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              func escapeValue(obj: AnyObject?) -> String {
          
                  if let obj: AnyObject = obj {
          
                      if obj is String {
          Severity: Minor
          Found in src/ios/SwiftData.swift - About 1 hr to fix

            Function bind has 40 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                func bind(objects: [AnyObject], toSQL sql: String) -> (string: String, error: Int?) {
            
                    var newSql = ""
                    var bindIndex = 0
                    var i = false
            Severity: Minor
            Found in src/ios/SwiftData.swift - About 1 hr to fix

              Function getColumnValue has 39 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      func getColumnValue(statement: COpaquePointer, index: Int32, type: String) -> AnyObject? {
              
                          switch type {
                          case "INT", "INTEGER", "TINYINT", "SMALLINT", "MEDIUMINT", "BIGINT", "UNSIGNED BIG INT", "INT2", "INT8":
                              if sqlite3_column_type(statement, index) == SQLITE_NULL {
              Severity: Minor
              Found in src/ios/SwiftData.swift - About 1 hr to fix

                Function savepoint has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public static func savepoint(savepointClosure: ()->Bool) -> Int? {
                
                        //create the error variable
                        var error: Int? = nil
                
                
                Severity: Minor
                Found in src/ios/SwiftData.swift - About 1 hr to fix

                  Function openWithFlags has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          func openWithFlags(flags: Int32) -> Int? {
                  
                              //check if in transaction
                              if inTransaction {
                                  print("SwiftData Error -> During: Opening Database with Flags")
                  Severity: Minor
                  Found in src/ios/SwiftData.swift - About 1 hr to fix

                    Function executeChange has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            func executeChange(sqlStr: String, withArgs: [AnyObject]? = nil) -> Int? {
                    
                                var sql = sqlStr
                                if let args = withArgs {
                                    let result = bind(args, toSQL: sql)
                    Severity: Minor
                    Found in src/ios/SwiftData.swift - About 1 hr to fix

                      Function executeChange has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                      Open

                              func executeChange(sqlStr: String, withArgs: [AnyObject]? = nil) -> Int? {
                      
                                  var sql = sqlStr
                                  if let args = withArgs {
                                      let result = bind(args, toSQL: sql)
                      Severity: Minor
                      Found in src/ios/SwiftData.swift - About 1 hr 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 getColumnValue has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                      Open

                              func getColumnValue(statement: COpaquePointer, index: Int32, type: String) -> AnyObject? {
                      
                                  switch type {
                                  case "INT", "INTEGER", "TINYINT", "SMALLINT", "MEDIUMINT", "BIGINT", "UNSIGNED BIG INT", "INT2", "INT8":
                                      if sqlite3_column_type(statement, index) == SQLITE_NULL {
                      Severity: Minor
                      Found in src/ios/SwiftData.swift - About 1 hr 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 transaction has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public static func transaction(transactionClosure: ()->Bool) -> Int? {
                      
                              //create the error variable
                              var error: Int? = nil
                      
                      
                      Severity: Minor
                      Found in src/ios/SwiftData.swift - About 1 hr to fix

                        Function closeCustomConnection has 28 lines of code (exceeds 25 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 1 hr to fix

                          Function executeMultipleChanges has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public static func executeMultipleChanges(sqlArr: [String]) -> Int? {
                          
                                  //create error variable
                                  var error: Int? = nil
                          
                          
                          Severity: Minor
                          Found in src/ios/SwiftData.swift - About 1 hr to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                        switch sqlite3_column_type(pStmt, i) {
                                                        case 1:
                                                            columnType = "INTEGER"
                                                        case 2:
                                                            columnType = "FLOAT"
                            Severity: Major
                            Found in src/ios/SwiftData.swift - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                          if let columnValue: AnyObject = getColumnValue(pStmt, index: i, type: columnType) {
                                                              row[columnName] = SDColumn(obj: columnValue)
                                                          }
                              Severity: Major
                              Found in src/ios/SwiftData.swift - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                            if let columnValue: AnyObject = getColumnValue(pStmt, index: i, type: columnType) {
                                                                row[columnName] = SDColumn(obj: columnValue)
                                                            }
                                Severity: Major
                                Found in src/ios/SwiftData.swift - About 45 mins to fix

                                  Function openWithFlags has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                          func openWithFlags(flags: Int32) -> Int? {
                                  
                                              //check if in transaction
                                              if inTransaction {
                                                  print("SwiftData Error -> During: Opening Database with Flags")
                                  Severity: Minor
                                  Found in src/ios/SwiftData.swift - About 35 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 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
                                  
                                  
                                  Severity: Minor
                                  Found in src/ios/SwiftData.swift - About 35 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 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")
                                  Severity: Minor
                                  Found in src/ios/SwiftData.swift - About 35 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

                                  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 Double(sqlite3_column_double(statement, index))
                                    Severity: Major
                                    Found in src/ios/SwiftData.swift - About 30 mins to fix

                                      Avoid too many return statements within this function.
                                      Open

                                                          return dateFormatter.dateFromString(string)
                                      Severity: Major
                                      Found in src/ios/SwiftData.swift - About 30 mins to fix

                                        Avoid too many return statements within this function.
                                        Open

                                                        return "X'\(newStr)'"
                                        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

                                            Avoid too many return statements within this function.
                                            Open

                                                                return "'\(escapeStringValue(imageID))'"
                                            Severity: Major
                                            Found in src/ios/SwiftData.swift - About 30 mins to fix

                                              Avoid too many return statements within this function.
                                              Open

                                                          return "NULL"
                                              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

                                                  Avoid too many return statements within this function.
                                                  Open

                                                                  return sqlite3_column_int(statement, index) != 0
                                                  Severity: Major
                                                  Found in src/ios/SwiftData.swift - About 30 mins to fix

                                                    Avoid too many return statements within this function.
                                                    Open

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

                                                      Avoid too many return statements within this function.
                                                      Open

                                                                      return "\(escapeValue(dateFormatter.stringFromDate(obj as! NSDate)))"
                                                      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

                                                          Avoid too many return statements within this function.
                                                          Open

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

                                                            Avoid too many return statements within this function.
                                                            Open

                                                                            return Int(status)
                                                            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

                                                                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

                                                                    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 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

                                                                    Similar blocks of code found in 2 locations. 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: Major
                                                                    Found in src/ios/SwiftData.swift and 1 other location - About 3 hrs to fix
                                                                    src/ios/SwiftData.swift on lines 219..252

                                                                    Duplicated Code

                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                    Tuning

                                                                    This issue has a mass of 198.

                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                    Refactorings

                                                                    Further Reading

                                                                    Similar blocks of code found in 2 locations. 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: Major
                                                                    Found in src/ios/SwiftData.swift and 1 other location - About 3 hrs to fix
                                                                    src/ios/SwiftData.swift on lines 804..837

                                                                    Duplicated Code

                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                    Tuning

                                                                    This issue has a mass of 198.

                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                    Refactorings

                                                                    Further Reading

                                                                    Similar blocks of code found in 2 locations. 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: Major
                                                                    Found in src/ios/SwiftData.swift and 1 other location - About 2 hrs to fix
                                                                    src/ios/SwiftData.swift on lines 497..530

                                                                    Duplicated Code

                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                    Tuning

                                                                    This issue has a mass of 186.

                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                    Refactorings

                                                                    Further Reading

                                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                                    Open

                                                                        public static func existingTables() -> (result: [String], error: Int?) {
                                                                    
                                                                            //create result and error variables
                                                                            var result = [String] ()
                                                                            var error: Int? = nil
                                                                    Severity: Major
                                                                    Found in src/ios/SwiftData.swift and 1 other location - About 2 hrs to fix
                                                                    src/ios/SwiftData.swift on lines 757..790

                                                                    Duplicated Code

                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                    Tuning

                                                                    This issue has a mass of 186.

                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                    Refactorings

                                                                    Further Reading

                                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                                    Open

                                                                        public static func lastInsertedRowID() -> (rowID: Int, error: Int?) {
                                                                    
                                                                            //create result and error variables
                                                                            var result = 0
                                                                            var error: Int? = nil
                                                                    Severity: Major
                                                                    Found in src/ios/SwiftData.swift and 1 other location - About 2 hrs to fix
                                                                    src/ios/SwiftData.swift on lines 615..648

                                                                    Duplicated Code

                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                    Tuning

                                                                    This issue has a mass of 173.

                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                    Refactorings

                                                                    Further Reading

                                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                                    Open

                                                                        public static func numberOfRowsModified() -> (rowID: Int, error: Int?) {
                                                                    
                                                                            //create result and error variables
                                                                            var result = 0
                                                                            var error: Int? = nil
                                                                    Severity: Major
                                                                    Found in src/ios/SwiftData.swift and 1 other location - About 2 hrs to fix
                                                                    src/ios/SwiftData.swift on lines 569..602

                                                                    Duplicated Code

                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                    Tuning

                                                                    This issue has a mass of 173.

                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                    Refactorings

                                                                    Further Reading

                                                                    Similar blocks of code found in 3 locations. Consider refactoring.
                                                                    Open

                                                                        public static func executeChange(sqlStr: String) -> Int? {
                                                                    
                                                                            //create error variable
                                                                            var error: Int? = nil
                                                                    
                                                                    
                                                                    Severity: Major
                                                                    Found in src/ios/SwiftData.swift and 2 other locations - About 2 hrs to fix
                                                                    src/ios/SwiftData.swift on lines 453..485
                                                                    src/ios/SwiftData.swift on lines 713..745

                                                                    Duplicated Code

                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                    Tuning

                                                                    This issue has a mass of 160.

                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                    Refactorings

                                                                    Further Reading

                                                                    Similar blocks of code found in 3 locations. Consider refactoring.
                                                                    Open

                                                                        public static func deleteTable(table: String) -> Int? {
                                                                    
                                                                            //create the error variable
                                                                            var error: Int? = nil
                                                                    
                                                                    
                                                                    Severity: Major
                                                                    Found in src/ios/SwiftData.swift and 2 other locations - About 2 hrs to fix
                                                                    src/ios/SwiftData.swift on lines 53..85
                                                                    src/ios/SwiftData.swift on lines 713..745

                                                                    Duplicated Code

                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                    Tuning

                                                                    This issue has a mass of 160.

                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                    Refactorings

                                                                    Further Reading

                                                                    Similar blocks of code found in 3 locations. Consider refactoring.
                                                                    Open

                                                                        public static func removeIndex(indexName: String) -> Int? {
                                                                    
                                                                            //create the error variable
                                                                            var error: Int? = nil
                                                                    
                                                                    
                                                                    Severity: Major
                                                                    Found in src/ios/SwiftData.swift and 2 other locations - About 2 hrs to fix
                                                                    src/ios/SwiftData.swift on lines 53..85
                                                                    src/ios/SwiftData.swift on lines 453..485

                                                                    Duplicated Code

                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                    Tuning

                                                                    This issue has a mass of 160.

                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                    Refactorings

                                                                    Further Reading

                                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                                    Open

                                                                        public static func executeChange(sqlStr: String, withArgs: [AnyObject]) -> Int? {
                                                                    
                                                                            //create success variable
                                                                            var error: Int? = nil
                                                                    
                                                                    
                                                                    Severity: Major
                                                                    Found in src/ios/SwiftData.swift and 1 other location - About 2 hrs to fix
                                                                    src/ios/SwiftData.swift on lines 408..440

                                                                    Duplicated Code

                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                    Tuning

                                                                    This issue has a mass of 143.

                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                    Refactorings

                                                                    Further Reading

                                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                                    Open

                                                                        public static func createTable(table: String, withColumnNamesAndTypes values: [String: SwiftData.DataType]) -> Int? {
                                                                    
                                                                            //create the error variable
                                                                            var error: Int? = nil
                                                                    
                                                                    
                                                                    Severity: Major
                                                                    Found in src/ios/SwiftData.swift and 1 other location - About 2 hrs to fix
                                                                    src/ios/SwiftData.swift on lines 110..142

                                                                    Duplicated Code

                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                    Tuning

                                                                    This issue has a mass of 143.

                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                    Refactorings

                                                                    Further Reading

                                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                                    Open

                                                                        func existingIndexesForTable(table: String) -> (result: [String], error: Int?) {
                                                                    
                                                                            let sqlStr = "SELECT name FROM sqlite_master WHERE type = 'index' AND tbl_name = '\(table)'"
                                                                    
                                                                            var indexArr = [String]()
                                                                    Severity: Major
                                                                    Found in src/ios/SwiftData.swift and 1 other location - About 2 hrs to fix
                                                                    src/ios/SwiftData.swift on lines 1864..1882

                                                                    Duplicated Code

                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                    Tuning

                                                                    This issue has a mass of 134.

                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                    Refactorings

                                                                    Further Reading

                                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                                    Open

                                                                        func existingTables() -> (result: [String], error: Int?) {
                                                                            let sqlStr = "SELECT name FROM sqlite_master WHERE type = 'table'"
                                                                            var tableArr = [String]()
                                                                            let results = executeQuery(sqlStr)
                                                                            if let err = results.error {
                                                                    Severity: Major
                                                                    Found in src/ios/SwiftData.swift and 1 other location - About 2 hrs to fix
                                                                    src/ios/SwiftData.swift on lines 1945..1964

                                                                    Duplicated Code

                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                    Tuning

                                                                    This issue has a mass of 134.

                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                    Refactorings

                                                                    Further Reading

                                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                                    Open

                                                                                    } else {
                                                                                        print("SwiftData Error -> During: SQL Step")
                                                                                        print("                -> Code: \(status) - " + SDError.errorMessageFromCode(Int(status)))
                                                                                        if let errMsg = String.fromCString(sqlite3_errmsg(SQLiteDB.sharedInstance.sqliteDB)) {
                                                                                            print("                -> Details: \(errMsg)")
                                                                    Severity: Major
                                                                    Found in src/ios/SwiftData.swift and 1 other location - About 1 hr to fix
                                                                    src/ios/SwiftData.swift on lines 1411..1419

                                                                    Duplicated Code

                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                    Tuning

                                                                    This issue has a mass of 92.

                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                    Refactorings

                                                                    Further Reading

                                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                                    Open

                                                                                if status != SQLITE_OK {
                                                                                    print("SwiftData Error -> During: SQL Prepare")
                                                                                    print("                -> Code: \(status) - " + SDError.errorMessageFromCode(Int(status)))
                                                                                    if let errMsg = String.fromCString(sqlite3_errmsg(SQLiteDB.sharedInstance.sqliteDB)) {
                                                                                        print("                -> Details: \(errMsg)")
                                                                    Severity: Major
                                                                    Found in src/ios/SwiftData.swift and 1 other location - About 1 hr to fix
                                                                    src/ios/SwiftData.swift on lines 1459..1467

                                                                    Duplicated Code

                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                    Tuning

                                                                    This issue has a mass of 92.

                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                    Refactorings

                                                                    Further Reading

                                                                    Similar blocks of code found in 3 locations. Consider refactoring.
                                                                    Open

                                                                                if status != SQLITE_OK {
                                                                                    print("SwiftData Error -> During: Opening Database")
                                                                                    print("                -> Code: \(status) - " + SDError.errorMessageFromCode(Int(status)))
                                                                                    if let errMsg = String.fromCString(sqlite3_errmsg(SQLiteDB.sharedInstance.sqliteDB)) {
                                                                                        print("                -> Details: \(errMsg)")
                                                                    Severity: Major
                                                                    Found in src/ios/SwiftData.swift and 2 other locations - About 1 hr to fix
                                                                    src/ios/SwiftData.swift on lines 1120..1127
                                                                    src/ios/SwiftData.swift on lines 1193..1200

                                                                    Duplicated Code

                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                    Tuning

                                                                    This issue has a mass of 88.

                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                    Refactorings

                                                                    Further Reading

                                                                    Similar blocks of code found in 3 locations. Consider refactoring.
                                                                    Open

                                                                                if status != SQLITE_OK {
                                                                                    print("SwiftData Error -> During: Opening Database with Flags")
                                                                                    print("                -> Code: \(status) - " + SDError.errorMessageFromCode(Int(status)))
                                                                                    if let errMsg = String.fromCString(sqlite3_errmsg(SQLiteDB.sharedInstance.sqliteDB)) {
                                                                                        print("                -> Details: \(errMsg)")
                                                                    Severity: Major
                                                                    Found in src/ios/SwiftData.swift and 2 other locations - About 1 hr to fix
                                                                    src/ios/SwiftData.swift on lines 1073..1080
                                                                    src/ios/SwiftData.swift on lines 1193..1200

                                                                    Duplicated Code

                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                    Tuning

                                                                    This issue has a mass of 88.

                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                    Refactorings

                                                                    Further Reading

                                                                    Similar blocks of code found in 3 locations. Consider refactoring.
                                                                    Open

                                                                                if status != SQLITE_OK {
                                                                                    print("SwiftData Error -> During: Closing Database with Flags")
                                                                                    print("                -> Code: \(status) - " + SDError.errorMessageFromCode(Int(status)))
                                                                                    if let errMsg = String.fromCString(sqlite3_errmsg(SQLiteDB.sharedInstance.sqliteDB)) {
                                                                                        print("                -> Details: \(errMsg)")
                                                                    Severity: Major
                                                                    Found in src/ios/SwiftData.swift and 2 other locations - About 1 hr to fix
                                                                    src/ios/SwiftData.swift on lines 1073..1080
                                                                    src/ios/SwiftData.swift on lines 1120..1127

                                                                    Duplicated Code

                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                    Tuning

                                                                    This issue has a mass of 88.

                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                    Refactorings

                                                                    Further Reading

                                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                                    Open

                                                                                if status != SQLITE_DONE && status != SQLITE_OK {
                                                                                    print("SwiftData Error -> During: SQL Step")
                                                                                    print("                -> Code: \(status) - " + SDError.errorMessageFromCode(Int(status)))
                                                                                    if let errMsg = String.fromCString(sqlite3_errmsg(SQLiteDB.sharedInstance.sqliteDB)) {
                                                                                        print("                -> Details: \(errMsg)")
                                                                    Severity: Major
                                                                    Found in src/ios/SwiftData.swift and 1 other location - About 1 hr to fix
                                                                    src/ios/SwiftData.swift on lines 1368..1376

                                                                    Duplicated Code

                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                    Tuning

                                                                    This issue has a mass of 86.

                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                    Refactorings

                                                                    Further Reading

                                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                                    Open

                                                                                if status != SQLITE_OK {
                                                                                    print("SwiftData Error -> During: SQL Prepare")
                                                                                    print("                -> Code: \(status) - " + SDError.errorMessageFromCode(Int(status)))
                                                                                    if let errMsg = String.fromCString(sqlite3_errmsg(SQLiteDB.sharedInstance.sqliteDB)) {
                                                                                        print("                -> Details: \(errMsg)")
                                                                    Severity: Major
                                                                    Found in src/ios/SwiftData.swift and 1 other location - About 1 hr to fix
                                                                    src/ios/SwiftData.swift on lines 1379..1387

                                                                    Duplicated Code

                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                    Tuning

                                                                    This issue has a mass of 86.

                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                    Refactorings

                                                                    Further Reading

                                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                                    Open

                                                                        func escapeStringIdentifier(str: String) -> String {
                                                                            var escapedStr = ""
                                                                            for char in str.characters {
                                                                                if char == "\"" {
                                                                                    escapedStr += "\""
                                                                    Severity: Minor
                                                                    Found in src/ios/SwiftData.swift and 1 other location - About 55 mins to fix
                                                                    src/ios/SwiftData.swift on lines 1726..1736

                                                                    Duplicated Code

                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                    Tuning

                                                                    This issue has a mass of 66.

                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                    Refactorings

                                                                    Further Reading

                                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                                    Open

                                                                        func escapeStringValue(str: String) -> String {
                                                                            var escapedStr = ""
                                                                            for char in str.characters {
                                                                                if char == "'" {
                                                                                    escapedStr += "'"
                                                                    Severity: Minor
                                                                    Found in src/ios/SwiftData.swift and 1 other location - About 55 mins to fix
                                                                    src/ios/SwiftData.swift on lines 1739..1749

                                                                    Duplicated Code

                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                    Tuning

                                                                    This issue has a mass of 66.

                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                    Refactorings

                                                                    Further Reading

                                                                    Identical blocks of code found in 2 locations. Consider refactoring.
                                                                    Open

                                                                                                if let columnValue: AnyObject = getColumnValue(pStmt, index: i, type: columnType) {
                                                                                                    row[columnName] = SDColumn(obj: columnValue)
                                                                                                }
                                                                    Severity: Minor
                                                                    Found in src/ios/SwiftData.swift and 1 other location - About 35 mins to fix
                                                                    src/ios/SwiftData.swift on lines 1432..1434

                                                                    Duplicated Code

                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                    Tuning

                                                                    This issue has a mass of 45.

                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                    Refactorings

                                                                    Further Reading

                                                                    Identical blocks of code found in 2 locations. Consider refactoring.
                                                                    Open

                                                                                                if let columnValue: AnyObject = getColumnValue(pStmt, index: i, type: columnType) {
                                                                                                    row[columnName] = SDColumn(obj: columnValue)
                                                                                                }
                                                                    Severity: Minor
                                                                    Found in src/ios/SwiftData.swift and 1 other location - About 35 mins to fix
                                                                    src/ios/SwiftData.swift on lines 1451..1453

                                                                    Duplicated Code

                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                    Tuning

                                                                    This issue has a mass of 45.

                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                    Refactorings

                                                                    Further Reading

                                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                                    Open

                                                                    //
                                                                    // SwiftData.swift
                                                                    //
                                                                    // Copyright (c) 2014 Ryan Fowler
                                                                    //
                                                                    Severity: Minor
                                                                    Found in src/ios/SwiftData.swift and 1 other location - About 35 mins to fix
                                                                    src/ios/SwiftData.swift on lines 1..2152

                                                                    Duplicated Code

                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                    Tuning

                                                                    This issue has a mass of 43.

                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                    Refactorings

                                                                    Further Reading

                                                                    There are no issues that match your filters.

                                                                    Category
                                                                    Status