Kinvey/swift-sdk

View on GitHub
Kinvey/Kinvey/Query.swift

Summary

Maintainability
F
1 wk
Test Coverage

File Query.swift has 948 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import Foundation
#if !os(watchOS)
    import MapKit
#endif

Severity: Major
Found in Kinvey/Kinvey/Query.swift - About 2 days to fix

    Function translate has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
    Open

        internal func translate(expression: NSExpression, otherSideExpression: NSExpression) -> NSExpression {
            switch expression.expressionType {
            case .keyPath:
                var keyPath = expression.keyPath
                var type: AnyClass? = self.persistableType as? AnyClass
    Severity: Minor
    Found in Kinvey/Kinvey/Query.swift - About 6 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 transform has 123 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private func transform(expression: Expression, optimize: Bool = true) -> [String : Any]? {
            switch expression {
            case .equality(let lhs, let rhs):
                return transform(lhs: lhs, operator: .equalTo, rhs: rhs, optimize: optimize)
            case .inequality(let lhs, let rhs):
    Severity: Major
    Found in Kinvey/Kinvey/Query.swift - About 4 hrs to fix

      Function transform has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
      Open

          private func transform(expression: Expression, optimize: Bool = true) -> [String : Any]? {
              switch expression {
              case .equality(let lhs, let rhs):
                  return transform(lhs: lhs, operator: .equalTo, rhs: rhs, optimize: optimize)
              case .inequality(let lhs, let rhs):
      Severity: Minor
      Found in Kinvey/Kinvey/Query.swift - About 3 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 translate has 74 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          internal func translate(expression: NSExpression, otherSideExpression: NSExpression) -> NSExpression {
              switch expression.expressionType {
              case .keyPath:
                  var keyPath = expression.keyPath
                  var type: AnyClass? = self.persistableType as? AnyClass
      Severity: Major
      Found in Kinvey/Kinvey/Query.swift - About 2 hrs to fix

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

            private func transform(expression: Expression) -> NSPredicate? {
                switch expression {
                case .equality(let lhs, let rhs):
                    return transform(lhs: lhs.expression!, rhs: rhs.expression!, type: .equalTo)
                case .inequality(let lhs, let rhs):
        Severity: Minor
        Found in Kinvey/Kinvey/Query.swift - About 1 hr to fix

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

              private func transform(expression: Expression) -> NSPredicate? {
                  switch expression {
                  case .equality(let lhs, let rhs):
                      return transform(lhs: lhs.expression!, rhs: rhs.expression!, type: .equalTo)
                  case .inequality(let lhs, let rhs):
          Severity: Minor
          Found in Kinvey/Kinvey/Query.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

          Avoid deeply nested control flow statements.
          Open

                                  if kinveyProperyMapping[className] == nil {
                                      currentMappingClass = className
                                      mappingOperationQueue.addOperation {
                                          if kinveyProperyMapping[className] == nil {
                                              kinveyProperyMapping[className] = PropertyMap()
          Severity: Major
          Found in Kinvey/Kinvey/Query.swift - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                    if let kinveyMappingClassType = kinveyProperyMapping[className],
                                        let (keyPath, _) = kinveyMappingClassType[item]
                                    {
                                        keyPaths.append(keyPath)
                                    } else {
            Severity: Major
            Found in Kinvey/Kinvey/Query.swift - About 45 mins to fix

              Function transform has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                      lhs: NSExpression,
                      rhs: NSExpression,
                      modifier: NSComparisonPredicate.Modifier = .direct,
                      type: NSComparisonPredicate.Operator,
                      options: NSComparisonPredicate.Options = []
              Severity: Minor
              Found in Kinvey/Kinvey/Query.swift - About 35 mins to fix

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

                    fileprivate func translate(predicate: NSPredicate) -> NSPredicate {
                        signpost(.begin, log: osLog, name: "Translate Query")
                        defer {
                            signpost(.end, log: osLog, name: "Translate Query")
                        }
                Severity: Minor
                Found in Kinvey/Kinvey/Query.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 [
                                "$polygon" : coordinatesArray
                            ]
                Severity: Major
                Found in Kinvey/Kinvey/Query.swift - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                              return expression
                  Severity: Major
                  Found in Kinvey/Kinvey/Query.swift - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                                return [
                                    keyPath : [
                                        MongoDBOperator.matches.rawValue : regexValue
                                    ]
                                ]
                    Severity: Major
                    Found in Kinvey/Kinvey/Query.swift - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                                  return [
                                      keyPath : [
                                          MongoDBOperator.in.rawValue : values
                                      ]
                                  ]
                      Severity: Major
                      Found in Kinvey/Kinvey/Query.swift - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                    return [
                                        keyPath : [
                                            MongoDBOperator.geoIn.rawValue : transform(expression: rhs, optimize: optimize)
                                        ]
                                    ]
                        Severity: Major
                        Found in Kinvey/Kinvey/Query.swift - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                      return [MongoDBOperator.not.rawValue : [transform(expression:rhs, optimize: optimize)]]
                          Severity: Major
                          Found in Kinvey/Kinvey/Query.swift - About 30 mins to fix

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

                            //
                            //  Query.swift
                            //  Kinvey
                            //
                            //  Created by Victor Barros on 2015-12-08.
                            Severity: Major
                            Found in Kinvey/Kinvey/Query.swift and 1 other location - About 4 hrs to fix
                            Kinvey/Kinvey/Query.swift on lines 1..1229

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

                            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 8 locations. Consider refactoring.
                            Open

                            public func == <Root, Value: GeoValueExpressionType>(lhs: KeyPath<Root, GeoPoint?>, rhs: Value) -> BooleanExpression {
                                return BooleanExpressionWrapper(.geoIn(lhs: lhs.expression, rhs: rhs.expression))
                            }
                            Severity: Major
                            Found in Kinvey/Kinvey/Query.swift and 7 other locations - About 1 hr to fix
                            Kinvey/Kinvey/Query.swift on lines 816..818
                            Kinvey/Kinvey/Query.swift on lines 834..836
                            Kinvey/Kinvey/Query.swift on lines 846..848
                            Kinvey/Kinvey/Query.swift on lines 856..858
                            Kinvey/Kinvey/Query.swift on lines 866..868
                            Kinvey/Kinvey/Query.swift on lines 876..878
                            Kinvey/Kinvey/Query.swift on lines 886..888

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

                            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 8 locations. Consider refactoring.
                            Open

                            public func < <Root, Value: ValueExpressionType>(lhs: KeyPath<Root, Value?>, rhs: Value) -> BooleanExpression {
                                return BooleanExpressionWrapper(.lessThan(lhs: lhs.expression, rhs: rhs.expression))
                            }
                            Severity: Major
                            Found in Kinvey/Kinvey/Query.swift and 7 other locations - About 1 hr to fix
                            Kinvey/Kinvey/Query.swift on lines 816..818
                            Kinvey/Kinvey/Query.swift on lines 824..826
                            Kinvey/Kinvey/Query.swift on lines 834..836
                            Kinvey/Kinvey/Query.swift on lines 846..848
                            Kinvey/Kinvey/Query.swift on lines 866..868
                            Kinvey/Kinvey/Query.swift on lines 876..878
                            Kinvey/Kinvey/Query.swift on lines 886..888

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

                            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 8 locations. Consider refactoring.
                            Open

                            public func <= <Root, Value: ValueExpressionType>(lhs: KeyPath<Root, Value?>, rhs: Value) -> BooleanExpression {
                                return BooleanExpressionWrapper(.lessThanEqual(lhs: lhs.expression, rhs: rhs.expression))
                            }
                            Severity: Major
                            Found in Kinvey/Kinvey/Query.swift and 7 other locations - About 1 hr to fix
                            Kinvey/Kinvey/Query.swift on lines 816..818
                            Kinvey/Kinvey/Query.swift on lines 824..826
                            Kinvey/Kinvey/Query.swift on lines 834..836
                            Kinvey/Kinvey/Query.swift on lines 846..848
                            Kinvey/Kinvey/Query.swift on lines 856..858
                            Kinvey/Kinvey/Query.swift on lines 876..878
                            Kinvey/Kinvey/Query.swift on lines 886..888

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

                            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 8 locations. Consider refactoring.
                            Open

                            public func > <Root, Value: ValueExpressionType>(lhs: KeyPath<Root, Value?>, rhs: Value) -> BooleanExpression {
                                return BooleanExpressionWrapper(.greaterThan(lhs: lhs.expression, rhs: rhs.expression))
                            }
                            Severity: Major
                            Found in Kinvey/Kinvey/Query.swift and 7 other locations - About 1 hr to fix
                            Kinvey/Kinvey/Query.swift on lines 816..818
                            Kinvey/Kinvey/Query.swift on lines 824..826
                            Kinvey/Kinvey/Query.swift on lines 834..836
                            Kinvey/Kinvey/Query.swift on lines 846..848
                            Kinvey/Kinvey/Query.swift on lines 856..858
                            Kinvey/Kinvey/Query.swift on lines 866..868
                            Kinvey/Kinvey/Query.swift on lines 886..888

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

                            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 8 locations. Consider refactoring.
                            Open

                            public func >= <Root, Value: ValueExpressionType>(lhs: KeyPath<Root, Value?>, rhs: Value) -> BooleanExpression {
                                return BooleanExpressionWrapper(.greaterThanEqual(lhs: lhs.expression, rhs: rhs.expression))
                            }
                            Severity: Major
                            Found in Kinvey/Kinvey/Query.swift and 7 other locations - About 1 hr to fix
                            Kinvey/Kinvey/Query.swift on lines 816..818
                            Kinvey/Kinvey/Query.swift on lines 824..826
                            Kinvey/Kinvey/Query.swift on lines 834..836
                            Kinvey/Kinvey/Query.swift on lines 846..848
                            Kinvey/Kinvey/Query.swift on lines 856..858
                            Kinvey/Kinvey/Query.swift on lines 866..868
                            Kinvey/Kinvey/Query.swift on lines 876..878

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

                            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 8 locations. Consider refactoring.
                            Open

                            public func != <Root, Value: ValueExpressionType>(lhs: KeyPath<Root, Value?>, rhs: Value) -> BooleanExpression {
                                return BooleanExpressionWrapper(.inequality(lhs: lhs.expression, rhs: rhs.expression))
                            }
                            Severity: Major
                            Found in Kinvey/Kinvey/Query.swift and 7 other locations - About 1 hr to fix
                            Kinvey/Kinvey/Query.swift on lines 816..818
                            Kinvey/Kinvey/Query.swift on lines 824..826
                            Kinvey/Kinvey/Query.swift on lines 846..848
                            Kinvey/Kinvey/Query.swift on lines 856..858
                            Kinvey/Kinvey/Query.swift on lines 866..868
                            Kinvey/Kinvey/Query.swift on lines 876..878
                            Kinvey/Kinvey/Query.swift on lines 886..888

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

                            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 8 locations. Consider refactoring.
                            Open

                            public func == <Root, Value: ValueExpressionType>(lhs: KeyPath<Root, Value?>, rhs: Value) -> BooleanExpression {
                                return BooleanExpressionWrapper(.equality(lhs: lhs.expression, rhs: rhs.expression))
                            }
                            Severity: Major
                            Found in Kinvey/Kinvey/Query.swift and 7 other locations - About 1 hr to fix
                            Kinvey/Kinvey/Query.swift on lines 824..826
                            Kinvey/Kinvey/Query.swift on lines 834..836
                            Kinvey/Kinvey/Query.swift on lines 846..848
                            Kinvey/Kinvey/Query.swift on lines 856..858
                            Kinvey/Kinvey/Query.swift on lines 866..868
                            Kinvey/Kinvey/Query.swift on lines 876..878
                            Kinvey/Kinvey/Query.swift on lines 886..888

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

                            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 8 locations. Consider refactoring.
                            Open

                            public func <> <Root, Value: ValueExpressionType>(lhs: KeyPath<Root, Value?>, rhs: Value) -> BooleanExpression {
                                return BooleanExpressionWrapper(.inequality(lhs: lhs.expression, rhs: rhs.expression))
                            }
                            Severity: Major
                            Found in Kinvey/Kinvey/Query.swift and 7 other locations - About 1 hr to fix
                            Kinvey/Kinvey/Query.swift on lines 816..818
                            Kinvey/Kinvey/Query.swift on lines 824..826
                            Kinvey/Kinvey/Query.swift on lines 834..836
                            Kinvey/Kinvey/Query.swift on lines 856..858
                            Kinvey/Kinvey/Query.swift on lines 866..868
                            Kinvey/Kinvey/Query.swift on lines 876..878
                            Kinvey/Kinvey/Query.swift on lines 886..888

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

                            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 func %= <Root>(lhs: KeyPath<Root, String?>, rhs: String) -> BooleanExpression {
                                return BooleanExpressionWrapper(.like(lhs: lhs.expression, wild1: false, rhs, wild2: true))
                            }
                            Severity: Major
                            Found in Kinvey/Kinvey/Query.swift and 2 other locations - About 1 hr to fix
                            Kinvey/Kinvey/Query.swift on lines 916..918
                            Kinvey/Kinvey/Query.swift on lines 928..930

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

                            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 func %=% <Root>(lhs: KeyPath<Root, String?>, rhs: String) -> BooleanExpression {
                                return BooleanExpressionWrapper(.like(lhs: lhs.expression, wild1: true, rhs, wild2: true))
                            }
                            Severity: Major
                            Found in Kinvey/Kinvey/Query.swift and 2 other locations - About 1 hr to fix
                            Kinvey/Kinvey/Query.swift on lines 928..930
                            Kinvey/Kinvey/Query.swift on lines 938..940

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

                            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 func =% <Root>(lhs: KeyPath<Root, String?>, rhs: String) -> BooleanExpression {
                                return BooleanExpressionWrapper(.like(lhs: lhs.expression, wild1: true, rhs, wild2: false))
                            }
                            Severity: Major
                            Found in Kinvey/Kinvey/Query.swift and 2 other locations - About 1 hr to fix
                            Kinvey/Kinvey/Query.swift on lines 916..918
                            Kinvey/Kinvey/Query.swift on lines 938..940

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

                            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 8 locations. Consider refactoring.
                            Open

                            public func == <Root, Value: ValueExpressionType>(lhs: KeyPath<Root, Value>, rhs: Value) -> BooleanExpression {
                                return BooleanExpressionWrapper(.equality(lhs: lhs.expression, rhs: rhs.expression))
                            }
                            Severity: Major
                            Found in Kinvey/Kinvey/Query.swift and 7 other locations - About 1 hr to fix
                            Kinvey/Kinvey/Query.swift on lines 820..822
                            Kinvey/Kinvey/Query.swift on lines 830..832
                            Kinvey/Kinvey/Query.swift on lines 842..844
                            Kinvey/Kinvey/Query.swift on lines 852..854
                            Kinvey/Kinvey/Query.swift on lines 862..864
                            Kinvey/Kinvey/Query.swift on lines 872..874
                            Kinvey/Kinvey/Query.swift on lines 882..884

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

                            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 8 locations. Consider refactoring.
                            Open

                            public func >= <Root, Value: ValueExpressionType>(lhs: KeyPath<Root, Value>, rhs: Value) -> BooleanExpression {
                                return BooleanExpressionWrapper(.greaterThanEqual(lhs: lhs.expression, rhs: rhs.expression))
                            }
                            Severity: Major
                            Found in Kinvey/Kinvey/Query.swift and 7 other locations - About 1 hr to fix
                            Kinvey/Kinvey/Query.swift on lines 812..814
                            Kinvey/Kinvey/Query.swift on lines 820..822
                            Kinvey/Kinvey/Query.swift on lines 830..832
                            Kinvey/Kinvey/Query.swift on lines 842..844
                            Kinvey/Kinvey/Query.swift on lines 852..854
                            Kinvey/Kinvey/Query.swift on lines 862..864
                            Kinvey/Kinvey/Query.swift on lines 872..874

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

                            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 8 locations. Consider refactoring.
                            Open

                            public func != <Root, Value: ValueExpressionType>(lhs: KeyPath<Root, Value>, rhs: Value) -> BooleanExpression {
                                return BooleanExpressionWrapper(.inequality(lhs: lhs.expression, rhs: rhs.expression))
                            }
                            Severity: Major
                            Found in Kinvey/Kinvey/Query.swift and 7 other locations - About 1 hr to fix
                            Kinvey/Kinvey/Query.swift on lines 812..814
                            Kinvey/Kinvey/Query.swift on lines 820..822
                            Kinvey/Kinvey/Query.swift on lines 842..844
                            Kinvey/Kinvey/Query.swift on lines 852..854
                            Kinvey/Kinvey/Query.swift on lines 862..864
                            Kinvey/Kinvey/Query.swift on lines 872..874
                            Kinvey/Kinvey/Query.swift on lines 882..884

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

                            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 8 locations. Consider refactoring.
                            Open

                            public func <> <Root, Value: ValueExpressionType>(lhs: KeyPath<Root, Value>, rhs: Value) -> BooleanExpression {
                                return BooleanExpressionWrapper(.inequality(lhs: lhs.expression, rhs: rhs.expression))
                            }
                            Severity: Major
                            Found in Kinvey/Kinvey/Query.swift and 7 other locations - About 1 hr to fix
                            Kinvey/Kinvey/Query.swift on lines 812..814
                            Kinvey/Kinvey/Query.swift on lines 820..822
                            Kinvey/Kinvey/Query.swift on lines 830..832
                            Kinvey/Kinvey/Query.swift on lines 852..854
                            Kinvey/Kinvey/Query.swift on lines 862..864
                            Kinvey/Kinvey/Query.swift on lines 872..874
                            Kinvey/Kinvey/Query.swift on lines 882..884

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

                            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 8 locations. Consider refactoring.
                            Open

                            public func <= <Root, Value: ValueExpressionType>(lhs: KeyPath<Root, Value>, rhs: Value) -> BooleanExpression {
                                return BooleanExpressionWrapper(.lessThanEqual(lhs: lhs.expression, rhs: rhs.expression))
                            }
                            Severity: Major
                            Found in Kinvey/Kinvey/Query.swift and 7 other locations - About 1 hr to fix
                            Kinvey/Kinvey/Query.swift on lines 812..814
                            Kinvey/Kinvey/Query.swift on lines 820..822
                            Kinvey/Kinvey/Query.swift on lines 830..832
                            Kinvey/Kinvey/Query.swift on lines 842..844
                            Kinvey/Kinvey/Query.swift on lines 852..854
                            Kinvey/Kinvey/Query.swift on lines 872..874
                            Kinvey/Kinvey/Query.swift on lines 882..884

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

                            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 8 locations. Consider refactoring.
                            Open

                            public func == <Root, Value: GeoValueExpressionType>(lhs: KeyPath<Root, GeoPoint>, rhs: Value) -> BooleanExpression {
                                return BooleanExpressionWrapper(.geoIn(lhs: lhs.expression, rhs: rhs.expression))
                            }
                            Severity: Major
                            Found in Kinvey/Kinvey/Query.swift and 7 other locations - About 1 hr to fix
                            Kinvey/Kinvey/Query.swift on lines 812..814
                            Kinvey/Kinvey/Query.swift on lines 830..832
                            Kinvey/Kinvey/Query.swift on lines 842..844
                            Kinvey/Kinvey/Query.swift on lines 852..854
                            Kinvey/Kinvey/Query.swift on lines 862..864
                            Kinvey/Kinvey/Query.swift on lines 872..874
                            Kinvey/Kinvey/Query.swift on lines 882..884

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

                            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 8 locations. Consider refactoring.
                            Open

                            public func < <Root, Value: ValueExpressionType>(lhs: KeyPath<Root, Value>, rhs: Value) -> BooleanExpression {
                                return BooleanExpressionWrapper(.lessThan(lhs: lhs.expression, rhs: rhs.expression))
                            }
                            Severity: Major
                            Found in Kinvey/Kinvey/Query.swift and 7 other locations - About 1 hr to fix
                            Kinvey/Kinvey/Query.swift on lines 812..814
                            Kinvey/Kinvey/Query.swift on lines 820..822
                            Kinvey/Kinvey/Query.swift on lines 830..832
                            Kinvey/Kinvey/Query.swift on lines 842..844
                            Kinvey/Kinvey/Query.swift on lines 862..864
                            Kinvey/Kinvey/Query.swift on lines 872..874
                            Kinvey/Kinvey/Query.swift on lines 882..884

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

                            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 8 locations. Consider refactoring.
                            Open

                            public func > <Root, Value: ValueExpressionType>(lhs: KeyPath<Root, Value>, rhs: Value) -> BooleanExpression {
                                return BooleanExpressionWrapper(.greaterThan(lhs: lhs.expression, rhs: rhs.expression))
                            }
                            Severity: Major
                            Found in Kinvey/Kinvey/Query.swift and 7 other locations - About 1 hr to fix
                            Kinvey/Kinvey/Query.swift on lines 812..814
                            Kinvey/Kinvey/Query.swift on lines 820..822
                            Kinvey/Kinvey/Query.swift on lines 830..832
                            Kinvey/Kinvey/Query.swift on lines 842..844
                            Kinvey/Kinvey/Query.swift on lines 852..854
                            Kinvey/Kinvey/Query.swift on lines 862..864
                            Kinvey/Kinvey/Query.swift on lines 882..884

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

                            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 func =% <Root>(lhs: KeyPath<Root, String>, rhs: String) -> BooleanExpression {
                                return BooleanExpressionWrapper(.like(lhs: lhs.expression, wild1: true, rhs, wild2: false))
                            }
                            Severity: Major
                            Found in Kinvey/Kinvey/Query.swift and 2 other locations - About 55 mins to fix
                            Kinvey/Kinvey/Query.swift on lines 912..914
                            Kinvey/Kinvey/Query.swift on lines 934..936

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

                            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 func %= <Root>(lhs: KeyPath<Root, String>, rhs: String) -> BooleanExpression {
                                return BooleanExpressionWrapper(.like(lhs: lhs.expression, wild1: false, rhs, wild2: true))
                            }
                            Severity: Major
                            Found in Kinvey/Kinvey/Query.swift and 2 other locations - About 55 mins to fix
                            Kinvey/Kinvey/Query.swift on lines 912..914
                            Kinvey/Kinvey/Query.swift on lines 924..926

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

                            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 func %=% <Root>(lhs: KeyPath<Root, String>, rhs: String) -> BooleanExpression {
                                return BooleanExpressionWrapper(.like(lhs: lhs.expression, wild1: true, rhs, wild2: true))
                            }
                            Severity: Major
                            Found in Kinvey/Kinvey/Query.swift and 2 other locations - About 55 mins to fix
                            Kinvey/Kinvey/Query.swift on lines 924..926
                            Kinvey/Kinvey/Query.swift on lines 934..936

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

                            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

                            extension Optional where Wrapped == NSPredicate {
                            
                                var predicateKind: PredicateKind? {
                                    switch self {
                                    case .some(let wrapped):
                            Severity: Minor
                            Found in Kinvey/Kinvey/Query.swift and 1 other location - About 50 mins to fix
                            Kinvey/Kinvey/Query.swift on lines 1205..1216

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

                            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

                            extension Optional where Wrapped == BooleanExpression {
                            
                                var predicateKind: PredicateKind? {
                                    switch self {
                                    case .some(let wrapped):
                            Severity: Minor
                            Found in Kinvey/Kinvey/Query.swift and 1 other location - About 50 mins to fix
                            Kinvey/Kinvey/Query.swift on lines 1218..1229

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

                            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

                                @discardableResult
                                public func descending<Root, Value>(_ keyPaths: KeyPath<Root, Value>...) -> Query {
                                    for keyPath in keyPaths {
                                        sort(keyPath, ascending: false)
                                    }
                            Severity: Minor
                            Found in Kinvey/Kinvey/Query.swift and 1 other location - About 50 mins to fix
                            Kinvey/Kinvey/Query.swift on lines 387..393

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

                            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

                                @discardableResult
                                public func ascending<Root, Value>(_ keyPaths: KeyPath<Root, Value>...) -> Query {
                                    for keyPath in keyPaths {
                                        sort(keyPath, ascending: true)
                                    }
                            Severity: Minor
                            Found in Kinvey/Kinvey/Query.swift and 1 other location - About 50 mins to fix
                            Kinvey/Kinvey/Query.swift on lines 396..402

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

                            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 func !=% <Root>(lhs: KeyPath<Root, String?>, rhs: String) -> BooleanExpression {
                                return !(lhs =% rhs)
                            }
                            Severity: Major
                            Found in Kinvey/Kinvey/Query.swift and 2 other locations - About 45 mins to fix
                            Kinvey/Kinvey/Query.swift on lines 950..952
                            Kinvey/Kinvey/Query.swift on lines 970..972

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

                            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 func %!=% <Root>(lhs: KeyPath<Root, String?>, rhs: String) -> BooleanExpression {
                                return !(lhs %=% rhs)
                            }
                            Severity: Major
                            Found in Kinvey/Kinvey/Query.swift and 2 other locations - About 45 mins to fix
                            Kinvey/Kinvey/Query.swift on lines 960..962
                            Kinvey/Kinvey/Query.swift on lines 970..972

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

                            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 func %!= <Root>(lhs: KeyPath<Root, String?>, rhs: String) -> BooleanExpression {
                                return !(lhs %= rhs)
                            }
                            Severity: Major
                            Found in Kinvey/Kinvey/Query.swift and 2 other locations - About 45 mins to fix
                            Kinvey/Kinvey/Query.swift on lines 950..952
                            Kinvey/Kinvey/Query.swift on lines 960..962

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

                            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 func !=% <Root>(lhs: KeyPath<Root, String>, rhs: String) -> BooleanExpression {
                                return !(lhs =% rhs)
                            }
                            Severity: Major
                            Found in Kinvey/Kinvey/Query.swift and 2 other locations - About 40 mins to fix
                            Kinvey/Kinvey/Query.swift on lines 946..948
                            Kinvey/Kinvey/Query.swift on lines 966..968

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

                            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 func %!=% <Root>(lhs: KeyPath<Root, String>, rhs: String) -> BooleanExpression {
                                return !(lhs %=% rhs)
                            }
                            Severity: Major
                            Found in Kinvey/Kinvey/Query.swift and 2 other locations - About 40 mins to fix
                            Kinvey/Kinvey/Query.swift on lines 956..958
                            Kinvey/Kinvey/Query.swift on lines 966..968

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

                            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 func %!= <Root>(lhs: KeyPath<Root, String>, rhs: String) -> BooleanExpression {
                                return !(lhs %= rhs)
                            }
                            Severity: Major
                            Found in Kinvey/Kinvey/Query.swift and 2 other locations - About 40 mins to fix
                            Kinvey/Kinvey/Query.swift on lines 946..948
                            Kinvey/Kinvey/Query.swift on lines 956..958

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

                            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 func || (lhs: BooleanExpression, rhs: BooleanExpression) -> BooleanExpression {
                                return BooleanExpressionWrapper(.or(lhs: lhs.expression, rhs: rhs.expression))
                            }
                            Severity: Minor
                            Found in Kinvey/Kinvey/Query.swift and 1 other location - About 40 mins to fix
                            Kinvey/Kinvey/Query.swift on lines 892..894

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

                            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 func && (lhs: BooleanExpression, rhs: BooleanExpression) -> BooleanExpression {
                                return BooleanExpressionWrapper(.and(lhs: lhs.expression, rhs: rhs.expression))
                            }
                            Severity: Minor
                            Found in Kinvey/Kinvey/Query.swift and 1 other location - About 40 mins to fix
                            Kinvey/Kinvey/Query.swift on lines 898..900

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

                            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

                                @discardableResult
                                public func descending(_ properties: String...) -> Query {
                                    for property in properties {
                                        addSort(property, ascending: false)
                                    }
                            Severity: Minor
                            Found in Kinvey/Kinvey/Query.swift and 1 other location - About 35 mins to fix
                            Kinvey/Kinvey/Query.swift on lines 358..364

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

                            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

                                @discardableResult
                                public func ascending(_ properties: String...) -> Query {
                                    for property in properties {
                                        addSort(property, ascending: true)
                                    }
                            Severity: Minor
                            Found in Kinvey/Kinvey/Query.swift and 1 other location - About 35 mins to fix
                            Kinvey/Kinvey/Query.swift on lines 367..373

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

                            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 let skip = skip {
                                        let queryItem = URLQueryItem(name: "skip", value: String(skip))
                                        queryParams.append(queryItem)
                                    }
                            Severity: Minor
                            Found in Kinvey/Kinvey/Query.swift and 2 other locations - About 30 mins to fix
                            Kinvey/Kinvey/Endpoint.swift on lines 216..219
                            Kinvey/Kinvey/Query.swift on lines 230..233

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

                            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 let limit = limit {
                                        let queryItem = URLQueryItem(name: "limit", value: String(limit))
                                        queryParams.append(queryItem)
                                    }
                            Severity: Minor
                            Found in Kinvey/Kinvey/Query.swift and 2 other locations - About 30 mins to fix
                            Kinvey/Kinvey/Endpoint.swift on lines 216..219
                            Kinvey/Kinvey/Query.swift on lines 225..228

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

                            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