IBM-Swift/Kitura

View on GitHub
Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift

Summary

Maintainability
F
2 wks
Test Coverage

File CodableRouter+TypeSafeMiddleware.swift has 978 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import Foundation
import LoggerAPI
import KituraNet
import KituraContracts

Severity: Major
Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift - About 2 days to fix

    Function get has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

        public func get<T1: TypeSafeMiddleware, T2: TypeSafeMiddleware, T3: TypeSafeMiddleware, Q: QueryParams, O: Codable>(
            _ route: String,
            handler: @escaping (T1, T2, T3, Q?, @escaping CodableArrayResultClosure<O>) -> Void
            ) {
            registerGetRoute(route: route, queryParams: Q.self, optionalQParam: true, outputType: O.self)
    Severity: Minor
    Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift - About 1 hr to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function delete has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

        public func delete<T: TypeSafeMiddleware, Q: QueryParams>(
            _ route: String,
            handler: @escaping (T, Q?, @escaping ResultClosure) -> Void
            ) {
            registerDeleteRoute(route: route, queryParams: Q.self, optionalQParam: true)
    Severity: Minor
    Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift - About 1 hr to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function delete has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

        public func delete<T1: TypeSafeMiddleware, T2: TypeSafeMiddleware, Q: QueryParams>(
            _ route: String,
            handler: @escaping (T1, T2, Q?, @escaping ResultClosure) -> Void
            ) {
            registerDeleteRoute(route: route, queryParams: Q.self, optionalQParam: true)
    Severity: Minor
    Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift - About 1 hr to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function get has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

        public func get<T: TypeSafeMiddleware, Q: QueryParams, O: Codable>(
            _ route: String,
            handler: @escaping (T, Q?, @escaping CodableArrayResultClosure<O>) -> Void
            ) {
            registerGetRoute(route: route, queryParams: Q.self, optionalQParam: true, outputType: O.self)
    Severity: Minor
    Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift - About 1 hr to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function get has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

        public func get<T1: TypeSafeMiddleware, T2: TypeSafeMiddleware, Q: QueryParams, O: Codable>(
            _ route: String,
            handler: @escaping (T1, T2, Q?, @escaping CodableArrayResultClosure<O>) -> Void
            ) {
            registerGetRoute(route: route, queryParams: Q.self, optionalQParam: true, outputType: O.self)
    Severity: Minor
    Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift - About 1 hr to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function delete has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

        public func delete<T1: TypeSafeMiddleware, T2: TypeSafeMiddleware, T3: TypeSafeMiddleware, Q: QueryParams>(
            _ route: String,
            handler: @escaping (T1, T2, T3, Q?, @escaping ResultClosure) -> Void
            ) {
            registerDeleteRoute(route: route, queryParams: Q.self, optionalQParam: true)
    Severity: Minor
    Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift - About 1 hr to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function handleMiddleware has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        private func handleMiddleware<T1: TypeSafeMiddleware, T2: TypeSafeMiddleware, T3: TypeSafeMiddleware>(
            _ middlewareOneType: T1.Type,
            _ middlewareTwoType: T2.Type,
            _ middlewareThreeType: T3.Type,
            request: RouterRequest,
    Severity: Minor
    Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift - About 55 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function delete has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        public func delete<T1: TypeSafeMiddleware, T2: TypeSafeMiddleware, Id: Identifier>(
            _ route: String,
            handler: @escaping (T1, T2, Id, @escaping ResultClosure) -> Void
        ) {
            if !pathSyntaxIsValid(route, identifierExpected: true) {
    Severity: Minor
    Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift - About 45 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function handleMiddleware has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            _ middlewareOneType: T1.Type,
            _ middlewareTwoType: T2.Type,
            _ middlewareThreeType: T3.Type,
            request: RouterRequest,
            response: RouterResponse,
    Severity: Minor
    Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift - About 45 mins to fix

      Function delete has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public func delete<T1: TypeSafeMiddleware, T2: TypeSafeMiddleware, T3: TypeSafeMiddleware, Id: Identifier>(
              _ route: String,
              handler: @escaping (T1, T2, T3, Id, @escaping ResultClosure) -> Void
          ) {
              if !pathSyntaxIsValid(route, identifierExpected: true) {
      Severity: Minor
      Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift - About 45 mins to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Function get has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public func get<T1: TypeSafeMiddleware, T2: TypeSafeMiddleware, Id: Identifier, O: Codable>(
              _ route: String,
              handler: @escaping (T1, T2, Id, @escaping CodableResultClosure<O>) -> Void
          ) {
              if !pathSyntaxIsValid(route, identifierExpected: true) {
      Severity: Minor
      Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift - About 45 mins to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Function patch has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public func patch<T1: TypeSafeMiddleware, T2: TypeSafeMiddleware, T3: TypeSafeMiddleware, Id: Identifier, I: Codable, O: Codable>(
              _ route: String,
              handler: @escaping (T1, T2, T3, Id, I, @escaping CodableResultClosure<O>) -> Void
          ) {
              if !pathSyntaxIsValid(route, identifierExpected: true) {
      Severity: Minor
      Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift - About 45 mins to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Function put has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public func put<T1: TypeSafeMiddleware, T2: TypeSafeMiddleware, T3: TypeSafeMiddleware, Id: Identifier, I: Codable, O: Codable>(
              _ route: String,
              handler: @escaping (T1, T2, T3, Id, I, @escaping CodableResultClosure<O>) -> Void
          ) {
              if !pathSyntaxIsValid(route, identifierExpected: true) {
      Severity: Minor
      Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift - About 45 mins to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Function put has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public func put<T1: TypeSafeMiddleware, T2: TypeSafeMiddleware, Id: Identifier, I: Codable, O: Codable>(
              _ route: String,
              handler: @escaping (T1, T2, Id, I, @escaping CodableResultClosure<O>) -> Void
          ) {
              if !pathSyntaxIsValid(route, identifierExpected: true) {
      Severity: Minor
      Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift - About 45 mins to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Function patch has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public func patch<T: TypeSafeMiddleware, Id: Identifier, I: Codable, O: Codable>(
              _ route: String,
              handler: @escaping (T, Id, I, @escaping CodableResultClosure<O>) -> Void
          ) {
              if !pathSyntaxIsValid(route, identifierExpected: true) {
      Severity: Minor
      Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift - About 45 mins to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Function get has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public func get<T1: TypeSafeMiddleware, T2: TypeSafeMiddleware, T3: TypeSafeMiddleware, Id: Identifier, O: Codable>(
              _ route: String,
              handler: @escaping (T1, T2, T3, Id, @escaping CodableResultClosure<O>) -> Void
          ) {
              if !pathSyntaxIsValid(route, identifierExpected: true) {
      Severity: Minor
      Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift - About 45 mins to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Function put has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public func put<T: TypeSafeMiddleware, Id: Identifier, I: Codable, O: Codable>(
              _ route: String,
              handler: @escaping (T, Id, I, @escaping CodableResultClosure<O>) -> Void
          ) {
              if !pathSyntaxIsValid(route, identifierExpected: true) {
      Severity: Minor
      Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift - About 45 mins to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Function get has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public func get<T: TypeSafeMiddleware, Id: Identifier, O: Codable>(
              _ route: String,
              handler: @escaping (T, Id, @escaping CodableResultClosure<O>) -> Void
          ) {
              if !pathSyntaxIsValid(route, identifierExpected: true) {
      Severity: Minor
      Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift - About 45 mins to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Function delete has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public func delete<T: TypeSafeMiddleware, Id: Identifier>(
              _ route: String,
              handler: @escaping (T, Id, @escaping ResultClosure) -> Void
          ) {
              if !pathSyntaxIsValid(route, identifierExpected: true) {
      Severity: Minor
      Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift - About 45 mins to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Function patch has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public func patch<T1: TypeSafeMiddleware, T2: TypeSafeMiddleware, Id: Identifier, I: Codable, O: Codable>(
              _ route: String,
              handler: @escaping (T1, T2, Id, I, @escaping CodableResultClosure<O>) -> Void
          ) {
              if !pathSyntaxIsValid(route, identifierExpected: true) {
      Severity: Minor
      Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift - About 45 mins to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

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

              _ middlewareOneType: T1.Type,
              _ middlewareTwoType: T2.Type,
              request: RouterRequest,
              response: RouterResponse,
              completion: @escaping (T1?, T2?) -> Void
      Severity: Minor
      Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift - About 35 mins to fix

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

            public func get<T1: TypeSafeMiddleware, T2: TypeSafeMiddleware, Q: QueryParams, O: Codable>(
                _ route: String,
                handler: @escaping (T1, T2, Q, @escaping CodableArrayResultClosure<O>) -> Void
            ) {
                registerGetRoute(route: route, queryParams: Q.self, optionalQParam: false, outputType: O.self, outputIsArray: true)
        Severity: Minor
        Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift - About 35 mins to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

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

            public func post<T1: TypeSafeMiddleware, T2: TypeSafeMiddleware, T3: TypeSafeMiddleware, I: Codable, O: Codable>(
                _ route: String,
                handler: @escaping (T1, T2, T3, I, @escaping CodableResultClosure<O>) -> Void
            ) {
                registerPostRoute(route: route, inputType: I.self, outputType: O.self)
        Severity: Minor
        Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift - About 35 mins to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

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

            public func get<T: TypeSafeMiddleware, Q: QueryParams, O: Codable>(
                _ route: String,
                handler: @escaping (T, Q, @escaping CodableResultClosure<O>) -> Void
            ) {
                registerGetRoute(route: route, queryParams: Q.self, optionalQParam: false, outputType: O.self)
        Severity: Minor
        Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift - About 35 mins to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

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

            public func delete<T1: TypeSafeMiddleware, T2: TypeSafeMiddleware, Q: QueryParams>(
                _ route: String,
                handler: @escaping (T1, T2, Q, @escaping ResultClosure) -> Void
            ) {
                registerDeleteRoute(route: route, queryParams: Q.self, optionalQParam: false)
        Severity: Minor
        Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift - About 35 mins to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

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

            public func post<T1: TypeSafeMiddleware, T2: TypeSafeMiddleware, I: Codable, O: Codable>(
                _ route: String,
                handler: @escaping (T1, T2, I, @escaping CodableResultClosure<O>) -> Void
            ) {
                registerPostRoute(route: route, inputType: I.self, outputType: O.self)
        Severity: Minor
        Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift - About 35 mins to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

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

            public func get<T1: TypeSafeMiddleware, T2: TypeSafeMiddleware, T3: TypeSafeMiddleware, Q: QueryParams, O: Codable>(
                _ route: String,
                handler: @escaping (T1, T2, T3, Q, @escaping CodableResultClosure<O>) -> Void
            ) {
                registerGetRoute(route: route, queryParams: Q.self, optionalQParam: false, outputType: O.self)
        Severity: Minor
        Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift - About 35 mins to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

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

            public func post<T: TypeSafeMiddleware, I: Codable, Id: Identifier, O: Codable>(
                _ route: String,
                handler: @escaping (T, I, @escaping IdentifierCodableResultClosure<Id, O>) -> Void
            ) {
                registerPostRoute(route: route, id: Id.self, inputType: I.self, outputType: O.self)
        Severity: Minor
        Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift - About 35 mins to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

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

            public func post<T1: TypeSafeMiddleware, T2: TypeSafeMiddleware, I: Codable, Id: Identifier, O: Codable>(
                _ route: String,
                handler: @escaping (T1, T2, I, @escaping IdentifierCodableResultClosure<Id, O>) -> Void
            ) {
                registerPostRoute(route: route, id: Id.self, inputType: I.self, outputType: O.self)
        Severity: Minor
        Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift - About 35 mins to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

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

            public func delete<T1: TypeSafeMiddleware, T2: TypeSafeMiddleware, T3: TypeSafeMiddleware, Q: QueryParams>(
                _ route: String,
                handler: @escaping (T1, T2, T3, Q, @escaping ResultClosure) -> Void
            ) {
                registerDeleteRoute(route: route, queryParams: Q.self, optionalQParam: false)
        Severity: Minor
        Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift - About 35 mins to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

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

            public func get<T: TypeSafeMiddleware, Q: QueryParams, O: Codable>(
                _ route: String,
                handler: @escaping (T, Q, @escaping CodableArrayResultClosure<O>) -> Void
            ) {
                registerGetRoute(route: route, queryParams: Q.self, optionalQParam: false, outputType: O.self, outputIsArray: true)
        Severity: Minor
        Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift - About 35 mins to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

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

            public func get<T1: TypeSafeMiddleware, T2: TypeSafeMiddleware, T3: TypeSafeMiddleware, Q: QueryParams, O: Codable>(
                _ route: String,
                handler: @escaping (T1, T2, T3, Q, @escaping CodableArrayResultClosure<O>) -> Void
            ) {
                registerGetRoute(route: route, queryParams: Q.self, optionalQParam: false, outputType: O.self, outputIsArray: true)
        Severity: Minor
        Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift - About 35 mins to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

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

            public func get<T1: TypeSafeMiddleware, T2: TypeSafeMiddleware, Q: QueryParams, O: Codable>(
                _ route: String,
                handler: @escaping (T1, T2, Q, @escaping CodableResultClosure<O>) -> Void
            ) {
                registerGetRoute(route: route, queryParams: Q.self, optionalQParam: false, outputType: O.self)
        Severity: Minor
        Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift - About 35 mins to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

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

            public func post<T: TypeSafeMiddleware, I: Codable, O: Codable>(
                _ route: String,
                handler: @escaping (T, I, @escaping CodableResultClosure<O>) -> Void
            ) {
                registerPostRoute(route: route, inputType: I.self, outputType: O.self)
        Severity: Minor
        Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift - About 35 mins to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

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

            public func delete<T: TypeSafeMiddleware, Q: QueryParams>(
                _ route: String,
                handler: @escaping (T, Q, @escaping ResultClosure) -> Void
            ) {
                registerDeleteRoute(route: route, queryParams: Q.self, optionalQParam: false)
        Severity: Minor
        Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift - About 35 mins to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

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

            public func post<T1: TypeSafeMiddleware, T2: TypeSafeMiddleware, T3: TypeSafeMiddleware, I: Codable, Id: Identifier, O: Codable>(
                _ route: String,
                handler: @escaping (T1, T2, T3, I, @escaping IdentifierCodableResultClosure<Id, O>) -> Void
            ) {
                registerPostRoute(route: route, id: Id.self, inputType: I.self, outputType: O.self)
        Severity: Minor
        Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.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

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

            public func patch<T1: TypeSafeMiddleware, T2: TypeSafeMiddleware, T3: TypeSafeMiddleware, Id: Identifier, I: Codable, O: Codable>(
                _ route: String,
                handler: @escaping (T1, T2, T3, Id, I, @escaping CodableResultClosure<O>) -> Void
            ) {
                if !pathSyntaxIsValid(route, identifierExpected: true) {
        Severity: Major
        Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift and 1 other location - About 5 hrs to fix
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 1815..1838

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

        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 put<T1: TypeSafeMiddleware, T2: TypeSafeMiddleware, T3: TypeSafeMiddleware, Id: Identifier, I: Codable, O: Codable>(
                _ route: String,
                handler: @escaping (T1, T2, T3, Id, I, @escaping CodableResultClosure<O>) -> Void
            ) {
                if !pathSyntaxIsValid(route, identifierExpected: true) {
        Severity: Major
        Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift and 1 other location - About 5 hrs to fix
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 1960..1983

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

        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 put<T1: TypeSafeMiddleware, T2: TypeSafeMiddleware, Id: Identifier, I: Codable, O: Codable>(
                _ route: String,
                handler: @escaping (T1, T2, Id, I, @escaping CodableResultClosure<O>) -> Void
            ) {
                if !pathSyntaxIsValid(route, identifierExpected: true) {
        Severity: Major
        Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift and 1 other location - About 4 hrs to fix
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 1914..1936

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

            public func patch<T1: TypeSafeMiddleware, T2: TypeSafeMiddleware, Id: Identifier, I: Codable, O: Codable>(
                _ route: String,
                handler: @escaping (T1, T2, Id, I, @escaping CodableResultClosure<O>) -> Void
            ) {
                if !pathSyntaxIsValid(route, identifierExpected: true) {
        Severity: Major
        Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift and 1 other location - About 4 hrs to fix
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 1774..1796

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

            public func put<T: TypeSafeMiddleware, Id: Identifier, I: Codable, O: Codable>(
                _ route: String,
                handler: @escaping (T, Id, I, @escaping CodableResultClosure<O>) -> Void
            ) {
                if !pathSyntaxIsValid(route, identifierExpected: true) {
        Severity: Major
        Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift and 1 other location - About 4 hrs to fix
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 1867..1890

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

        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 patch<T: TypeSafeMiddleware, Id: Identifier, I: Codable, O: Codable>(
                _ route: String,
                handler: @escaping (T, Id, I, @escaping CodableResultClosure<O>) -> Void
            ) {
                if !pathSyntaxIsValid(route, identifierExpected: true) {
        Severity: Major
        Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift and 1 other location - About 4 hrs to fix
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 1733..1755

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

        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

                get(route) { request, response, next in
                    Log.verbose("Received GET (plural) type-safe request with middleware and Query Parameters")
                    Log.verbose("Query Parameters: \(request.queryParameters)")
                    self.handleMiddleware(T1.self, T2.self, T3.self, request: request, response: response) { typeSafeMiddleware1, typeSafeMiddleware2, typeSafeMiddleware3 in
                        guard let typeSafeMiddleware1 = typeSafeMiddleware1, let typeSafeMiddleware2 = typeSafeMiddleware2, let typeSafeMiddleware3 = typeSafeMiddleware3 else {
        Severity: Major
        Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift and 1 other location - About 3 hrs to fix
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 1442..1462

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

        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

                delete(route) { request, response, next in
                    Log.verbose("Received DELETE type-safe request with middleware and Query Parameters")
                    Log.verbose("Query Parameters: \(request.queryParameters)")
                    self.handleMiddleware(T1.self, T2.self, T3.self, request: request, response: response) { typeSafeMiddleware1, typeSafeMiddleware2, typeSafeMiddleware3 in
                        guard let typeSafeMiddleware1 = typeSafeMiddleware1, let typeSafeMiddleware2 = typeSafeMiddleware2, let typeSafeMiddleware3 = typeSafeMiddleware3 else {
        Severity: Major
        Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift and 1 other location - About 3 hrs to fix
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 915..935

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

        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

                delete(route) { request, response, next in
                    Log.verbose("Received DELETE type-safe request with middleware and Query Parameters")
                    Log.verbose("Query Parameters: \(request.queryParameters)")
                    self.handleMiddleware(T1.self, T2.self, request: request, response: response) { typeSafeMiddleware1, typeSafeMiddleware2 in
                        guard let typeSafeMiddleware1 = typeSafeMiddleware1, let typeSafeMiddleware2 = typeSafeMiddleware2 else {
        Severity: Major
        Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift and 1 other location - About 2 hrs to fix
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 817..837

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 186.

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

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

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

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

        Refactorings

        Further Reading

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

                get(route) { request, response, next in
                    Log.verbose("Received GET (plural) type-safe request with middleware and Query Parameters")
                    Log.verbose("Query Parameters: \(request.queryParameters)")
                    self.handleMiddleware(T1.self, T2.self, request: request, response: response) { typeSafeMiddleware1, typeSafeMiddleware2 in
                        guard let typeSafeMiddleware1 = typeSafeMiddleware1, let typeSafeMiddleware2 = typeSafeMiddleware2 else {
        Severity: Major
        Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift and 1 other location - About 2 hrs to fix
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 1345..1365

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 186.

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

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

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

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

        Refactorings

        Further Reading

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

                get(route) { request, response, next in
                    Log.verbose("Received GET (plural) type-safe request with middleware and Query Parameters")
                    Log.verbose("Query Parameters: \(request.queryParameters)")
                    self.handleMiddleware(T.self, request: request, response: response) { typeSafeMiddleware in
                        guard let typeSafeMiddleware = typeSafeMiddleware else {
        Severity: Major
        Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift and 1 other location - About 2 hrs to fix
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 1248..1268

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 173.

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

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

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

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

        Refactorings

        Further Reading

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

                delete(route) { request, response, next in
                    Log.verbose("Received DELETE type-safe request with middleware and Query Parameters")
                    Log.verbose("Query Parameters: \(request.queryParameters)")
                    self.handleMiddleware(T.self, request: request, response: response) { typeSafeMiddleware in
                        guard let typeSafeMiddleware = typeSafeMiddleware else {
        Severity: Major
        Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift and 1 other location - About 2 hrs to fix
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 719..739

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 173.

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

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

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

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

        Refactorings

        Further Reading

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

                get(route) { request, response, next in
                    Log.verbose("Received GET (plural) type-safe request with middleware and Query Parameters")
                    Log.verbose("Query Parameters: \(request.queryParameters)")
                    self.handleMiddleware(T1.self, T2.self, T3.self, request: request, response: response) { typeSafeMiddleware1, typeSafeMiddleware2, typeSafeMiddleware3 in
                        guard let typeSafeMiddleware1 = typeSafeMiddleware1, let typeSafeMiddleware2 = typeSafeMiddleware2, let typeSafeMiddleware3 = typeSafeMiddleware3 else {
        Severity: Major
        Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift and 2 other locations - About 2 hrs to fix
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 614..631
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 1393..1409

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

        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

                delete(route) { request, response, next in
                    Log.verbose("Received DELETE type-safe request with middleware and Query Parameters")
                    Log.verbose("Query Parameters: \(request.queryParameters)")
                    self.handleMiddleware(T1.self, T2.self, T3.self, request: request, response: response) { typeSafeMiddleware1, typeSafeMiddleware2, typeSafeMiddleware3 in
                        guard let typeSafeMiddleware1 = typeSafeMiddleware1, let typeSafeMiddleware2 = typeSafeMiddleware2, let typeSafeMiddleware3 = typeSafeMiddleware3 else {
        Severity: Major
        Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift and 2 other locations - About 2 hrs to fix
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 614..631
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 867..883

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

        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

                get(route) { request, response, next in
                    Log.verbose("Received GET (singular) type-safe request with middleware and Query Parameters")
                    Log.verbose("Query Parameters: \(request.queryParameters)")
                    // Define result handler
                    self.handleMiddleware(T1.self, T2.self, T3.self, request: request, response: response) { typeSafeMiddleware1, typeSafeMiddleware2, typeSafeMiddleware3 in
        Severity: Major
        Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift and 2 other locations - About 2 hrs to fix
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 867..883
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 1393..1409

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

        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

                get(route) { request, response, next in
                    Log.verbose("Received GET (singular) type-safe request with middleware and Query Parameters")
                    Log.verbose("Query Parameters: \(request.queryParameters)")
                    // Define result handler
                    self.handleMiddleware(T1.self, T2.self, request: request, response: response) { typeSafeMiddleware1, typeSafeMiddleware2 in
        Severity: Major
        Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift and 2 other locations - About 2 hrs to fix
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 769..785
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 1296..1312

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

        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

                delete(route) { request, response, next in
                    Log.verbose("Received DELETE type-safe request with middleware and Query Parameters")
                    Log.verbose("Query Parameters: \(request.queryParameters)")
                    self.handleMiddleware(T1.self, T2.self, request: request, response: response) { typeSafeMiddleware1, typeSafeMiddleware2 in
                        guard let typeSafeMiddleware1 = typeSafeMiddleware1, let typeSafeMiddleware2 = typeSafeMiddleware2 else {
        Severity: Major
        Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift and 2 other locations - About 2 hrs to fix
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 566..584
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 769..785

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

        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

                get(route) { request, response, next in
                    Log.verbose("Received GET (plural) type-safe request with middleware and Query Parameters")
                    Log.verbose("Query Parameters: \(request.queryParameters)")
                    self.handleMiddleware(T1.self, T2.self, request: request, response: response) { typeSafeMiddleware1, typeSafeMiddleware2 in
                        guard let typeSafeMiddleware1 = typeSafeMiddleware1, let typeSafeMiddleware2 = typeSafeMiddleware2 else {
        Severity: Major
        Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift and 2 other locations - About 2 hrs to fix
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 566..584
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 1296..1312

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

        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

                get(route) { request, response, next in
                    Log.verbose("Received GET (singular) type-safe request with middleware and Query Parameters")
                    Log.verbose("Query Parameters: \(request.queryParameters)")
                    // Define result handler
                    self.handleMiddleware(T.self, request: request, response: response) { typeSafeMiddleware in
        Severity: Major
        Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift and 2 other locations - About 2 hrs to fix
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 666..682
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 1194..1210

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

        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

                delete(appendId(path: route)) { request, response, next in
                    Log.verbose("Received DELETE (singular with middleware) type-safe request")
                    self.handleMiddleware(T1.self, T2.self, T3.self, request: request, response: response) { typeSafeMiddleware1, typeSafeMiddleware2, typeSafeMiddleware3 in
                        guard let typeSafeMiddleware1 = typeSafeMiddleware1, let typeSafeMiddleware2 = typeSafeMiddleware2, let typeSafeMiddleware3 = typeSafeMiddleware3 else {
                            return next()
        Severity: Major
        Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift and 1 other location - About 2 hrs to fix
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 362..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 145.

        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

                delete(route) { request, response, next in
                    Log.verbose("Received DELETE type-safe request with middleware and Query Parameters")
                    Log.verbose("Query Parameters: \(request.queryParameters)")
                    self.handleMiddleware(T.self, request: request, response: response) { typeSafeMiddleware in
                        guard let typeSafeMiddleware = typeSafeMiddleware else {
        Severity: Major
        Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift and 2 other locations - About 2 hrs to fix
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 518..536
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 666..682

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

        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

                get(appendId(path: route)) { request, response, next in
                    Log.verbose("Received GET (singular with identifier and middleware) type-safe request")
                    self.handleMiddleware(T1.self, T2.self, T3.self, request: request, response: response) { typeSafeMiddleware1, typeSafeMiddleware2, typeSafeMiddleware3 in
                        guard let typeSafeMiddleware1 = typeSafeMiddleware1, let typeSafeMiddleware2 = typeSafeMiddleware2, let typeSafeMiddleware3 = typeSafeMiddleware3 else {
                            return next()
        Severity: Major
        Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift and 1 other location - About 2 hrs to fix
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 1150..1161

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

        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

                get(route) { request, response, next in
                    Log.verbose("Received GET (plural) type-safe request with middleware and Query Parameters")
                    Log.verbose("Query Parameters: \(request.queryParameters)")
                    self.handleMiddleware(T.self, request: request, response: response) { typeSafeMiddleware in
                        guard let typeSafeMiddleware = typeSafeMiddleware else {
        Severity: Major
        Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift and 2 other locations - About 2 hrs to fix
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 518..536
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 1194..1210

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

        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

                delete(appendId(path: route)) { request, response, next in
                    Log.verbose("Received DELETE (singular with middleware) type-safe request")
                    self.handleMiddleware(T1.self, T2.self, request: request, response: response) { typeSafeMiddleware1, typeSafeMiddleware2 in
                        guard let typeSafeMiddleware1 = typeSafeMiddleware1, let typeSafeMiddleware2 = typeSafeMiddleware2 else {
                            return next()
        Severity: Major
        Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift and 1 other location - About 2 hrs to fix
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 321..332

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

        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

                get(appendId(path: route)) { request, response, next in
                    Log.verbose("Received GET (singular with identifier and middleware) type-safe request")
                    self.handleMiddleware(T1.self, T2.self, request: request, response: response) { typeSafeMiddleware1, typeSafeMiddleware2 in
                        guard let typeSafeMiddleware1 = typeSafeMiddleware1, let typeSafeMiddleware2 = typeSafeMiddleware2 else {
                            return next()
        Severity: Major
        Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift and 1 other location - About 2 hrs to fix
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 1111..1122

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

        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

                get(appendId(path: route)) { request, response, next in
                    Log.verbose("Received GET (singular with identifier and middleware) type-safe request")
                    self.handleMiddleware(T.self, request: request, response: response) { typeSafeMiddleware in
                        guard let typeSafeMiddleware = typeSafeMiddleware else {
                            return next()
        Severity: Major
        Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift and 1 other location - About 1 hr to fix
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 1072..1083

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

        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

                delete(appendId(path: route)) { request, response, next in
                    Log.verbose("Received DELETE (singular with middleware) type-safe request")
                    self.handleMiddleware(T.self, request: request, response: response) { typeSafeMiddleware in
                        guard let typeSafeMiddleware = typeSafeMiddleware else {
                            return next()
        Severity: Major
        Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift and 1 other location - About 1 hr to fix
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 280..291

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

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

                delete(route) { request, response, next in
                    Log.verbose("Received DELETE (plural with middleware) type-safe request")
                    self.handleMiddleware(T1.self, T2.self, T3.self, request: request, response: response) { typeSafeMiddleware1, typeSafeMiddleware2, typeSafeMiddleware3 in
                        guard let typeSafeMiddleware1 = typeSafeMiddleware1, let typeSafeMiddleware2 = typeSafeMiddleware2, let typeSafeMiddleware3 = typeSafeMiddleware3 else {
                            return next()
        Severity: Major
        Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift and 3 other locations - About 1 hr to fix
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 127..135
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 237..245
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 475..483

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

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

                get(route) { request, response, next in
                    Log.verbose("Received GET(Single) typed middleware request")
                    self.handleMiddleware(T1.self, T2.self, T3.self, request: request, response: response) { typeSafeMiddleware1, typeSafeMiddleware2, typeSafeMiddleware3 in
                        guard let typeSafeMiddleware1 = typeSafeMiddleware1, let typeSafeMiddleware2 = typeSafeMiddleware2, let typeSafeMiddleware3 = typeSafeMiddleware3 else {
                            return next()
        Severity: Major
        Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift and 3 other locations - About 1 hr to fix
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 237..245
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 475..483
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 1031..1039

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

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

                get(route) { request, response, next in
                    Log.verbose("Received GET(Array) typed middleware request")
                    self.handleMiddleware(T1.self, T2.self, T3.self, request: request, response: response) { typeSafeMiddleware1, typeSafeMiddleware2, typeSafeMiddleware3 in
                        guard let typeSafeMiddleware1 = typeSafeMiddleware1, let typeSafeMiddleware2 = typeSafeMiddleware2, let typeSafeMiddleware3 = typeSafeMiddleware3 else {
                            return next()
        Severity: Major
        Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift and 3 other locations - About 1 hr to fix
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 127..135
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 475..483
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 1031..1039

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

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

                get(route) { request, response, next in
                    Log.verbose("Received GET(Array) with identifier typed middleware request")
                    self.handleMiddleware(T1.self, T2.self, T3.self, request: request, response: response) { typeSafeMiddleware1, typeSafeMiddleware2, typeSafeMiddleware3 in
                        guard let typeSafeMiddleware1 = typeSafeMiddleware1, let typeSafeMiddleware2 = typeSafeMiddleware2, let typeSafeMiddleware3 = typeSafeMiddleware3 else {
                            return next()
        Severity: Major
        Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift and 3 other locations - About 1 hr to fix
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 127..135
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 237..245
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 1031..1039

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

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

                get(route) { request, response, next in
                    Log.verbose("Received GET(Array) typed middleware request")
                    self.handleMiddleware(T1.self, T2.self, request: request, response: response) { typeSafeMiddleware1, typeSafeMiddleware2 in
                        guard let typeSafeMiddleware1 = typeSafeMiddleware1, let typeSafeMiddleware2 = typeSafeMiddleware2 else {
                            return next()
        Severity: Major
        Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift and 3 other locations - About 1 hr to fix
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 92..100
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 440..448
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 998..1006

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 92.

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

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

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

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

        Refactorings

        Further Reading

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

                get(route) { request, response, next in
                    Log.verbose("Received GET(Array) with identifier typed middleware request")
                    self.handleMiddleware(T1.self, T2.self, request: request, response: response) { typeSafeMiddleware1, typeSafeMiddleware2 in
                        guard let typeSafeMiddleware1 = typeSafeMiddleware1, let typeSafeMiddleware2 = typeSafeMiddleware2 else {
                            return next()
        Severity: Major
        Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift and 3 other locations - About 1 hr to fix
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 92..100
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 202..210
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 998..1006

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 92.

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

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

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

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

        Refactorings

        Further Reading

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

                delete(route) { request, response, next in
                    Log.verbose("Received DELETE (plural with middleware) type-safe request")
                    self.handleMiddleware(T1.self, T2.self, request: request, response: response) { typeSafeMiddleware1, typeSafeMiddleware2 in
                        guard let typeSafeMiddleware1 = typeSafeMiddleware1, let typeSafeMiddleware2 = typeSafeMiddleware2 else {
                            return next()
        Severity: Major
        Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift and 3 other locations - About 1 hr to fix
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 92..100
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 202..210
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 440..448

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 92.

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

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

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

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

        Refactorings

        Further Reading

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

                get(route) { request, response, next in
                    Log.verbose("Received GET(Single) typed middleware request")
                    self.handleMiddleware(T1.self, T2.self, request: request, response: response) { typeSafeMiddleware1, typeSafeMiddleware2 in
                        guard let typeSafeMiddleware1 = typeSafeMiddleware1, let typeSafeMiddleware2 = typeSafeMiddleware2 else {
                            return next()
        Severity: Major
        Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift and 3 other locations - About 1 hr to fix
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 202..210
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 440..448
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 998..1006

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 92.

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

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

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

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

        Refactorings

        Further Reading

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

                get(route) { request, response, next in
                    Log.verbose("Received GET(Array) with identifier typed middleware request")
                    self.handleMiddleware(T.self, request: request, response: response) { typeSafeMiddleware in
                        guard let typeSafeMiddleware = typeSafeMiddleware else {
                            return next()
        Severity: Major
        Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift and 3 other locations - About 1 hr to fix
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 57..65
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 167..175
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 965..973

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

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

                get(route) { request, response, next in
                    Log.verbose("Received GET(Single) typed middleware request")
                    self.handleMiddleware(T.self, request: request, response: response) { typeSafeMiddleware in
                        guard let typeSafeMiddleware = typeSafeMiddleware else {
                            return next()
        Severity: Major
        Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift and 3 other locations - About 1 hr to fix
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 167..175
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 405..413
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 965..973

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

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

                delete(route) { request, response, next in
                    Log.verbose("Received DELETE (plural with middleware) type-safe request")
                    self.handleMiddleware(T.self, request: request, response: response) { typeSafeMiddleware in
                        guard let typeSafeMiddleware = typeSafeMiddleware else {
                            return next()
        Severity: Major
        Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift and 3 other locations - About 1 hr to fix
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 57..65
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 167..175
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 405..413

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

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

                get(route) { request, response, next in
                    Log.verbose("Received GET(Array) typed middleware request")
                    self.handleMiddleware(T.self, request: request, response: response) { typeSafeMiddleware in
                        guard let typeSafeMiddleware = typeSafeMiddleware else {
                            return next()
        Severity: Major
        Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift and 3 other locations - About 1 hr to fix
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 57..65
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 405..413
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 965..973

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

        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 get<T1: TypeSafeMiddleware, T2: TypeSafeMiddleware, T3: TypeSafeMiddleware, Id: Identifier, O: Codable>(
                _ route: String,
                handler: @escaping (T1, T2, T3, @escaping IdentifierCodableArrayResultClosure<Id, O>) -> Void
            ) {
                registerGetRoute(route: route, id: Id.self, outputType: O.self, outputIsArray: true)
        Severity: Minor
        Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift and 1 other location - About 45 mins to fix
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 1654..1671

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

        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 post<T1: TypeSafeMiddleware, T2: TypeSafeMiddleware, I: Codable, Id: Identifier, O: Codable>(
                _ route: String,
                handler: @escaping (T1, T2, I, @escaping IdentifierCodableResultClosure<Id, O>) -> Void
            ) {
                registerPostRoute(route: route, id: Id.self, inputType: I.self, outputType: O.self)
        Severity: Minor
        Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift and 1 other location - About 45 mins to fix
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 470..484

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

        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 delete<T1: TypeSafeMiddleware, T2: TypeSafeMiddleware, T3: TypeSafeMiddleware, Id: Identifier>(
                _ route: String,
                handler: @escaping (T1, T2, T3, Id, @escaping ResultClosure) -> Void
            ) {
                if !pathSyntaxIsValid(route, identifierExpected: true) {
        Severity: Minor
        Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift and 1 other location - About 40 mins to fix
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 1388..1410

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

        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 delete<T1: TypeSafeMiddleware, T2: TypeSafeMiddleware, T3: TypeSafeMiddleware, Q: QueryParams>(
                _ route: String,
                handler: @escaping (T1, T2, T3, Q, @escaping ResultClosure) -> Void
            ) {
                registerDeleteRoute(route: route, queryParams: Q.self, optionalQParam: false)
        Severity: Minor
        Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift and 1 other location - About 40 mins to fix
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 1142..1162

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

        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 post<T: TypeSafeMiddleware, I: Codable, Id: Identifier, O: Codable>(
                _ route: String,
                handler: @escaping (T, I, @escaping IdentifierCodableResultClosure<Id, O>) -> Void
            ) {
                registerPostRoute(route: route, id: Id.self, inputType: I.self, outputType: O.self)
        Severity: Minor
        Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift and 1 other location - About 40 mins to fix
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 435..449

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

        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 get<T1: TypeSafeMiddleware, T2: TypeSafeMiddleware, Id: Identifier, O: Codable>(
                _ route: String,
                handler: @escaping (T1, T2, @escaping IdentifierCodableArrayResultClosure<Id, O>) -> Void
            ) {
                registerGetRoute(route: route, id: Id.self, outputType: O.self, outputIsArray: true)
        Severity: Minor
        Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift and 1 other location - About 40 mins to fix
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 1616..1633

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

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

            public func get<T: TypeSafeMiddleware, Id: Identifier, O: Codable>(
                _ route: String,
                handler: @escaping (T, Id, @escaping CodableResultClosure<O>) -> Void
            ) {
                if !pathSyntaxIsValid(route, identifierExpected: true) {
        Severity: Major
        Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift and 5 other locations - About 35 mins to fix
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 87..101
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 197..211
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 513..537
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 661..683
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 1491..1509

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 45.

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

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

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

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

        Refactorings

        Further Reading

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

            public func post<T: TypeSafeMiddleware, I: Codable, O: Codable>(
                _ route: String,
                handler: @escaping (T, I, @escaping CodableResultClosure<O>) -> Void
            ) {
                registerPostRoute(route: route, inputType: I.self, outputType: O.self)
        Severity: Major
        Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift and 5 other locations - About 35 mins to fix
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 87..101
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 197..211
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 272..292
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 513..537
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 661..683

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 45.

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

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

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

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

        Refactorings

        Further Reading

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

            public func get<T: TypeSafeMiddleware, Q: QueryParams, O: Codable>(
                _ route: String,
                handler: @escaping (T, Q, @escaping CodableArrayResultClosure<O>) -> Void
            ) {
                registerGetRoute(route: route, queryParams: Q.self, optionalQParam: false, outputType: O.self, outputIsArray: true)
        Severity: Major
        Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift and 5 other locations - About 35 mins to fix
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 87..101
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 197..211
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 272..292
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 513..537
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 1491..1509

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 45.

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

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

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

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

        Refactorings

        Further Reading

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

            public func get<T1: TypeSafeMiddleware, T2: TypeSafeMiddleware, O: Codable>(
                _ route: String,
                handler: @escaping (T1, T2, @escaping CodableResultClosure<O>) -> Void
            ) {
                registerGetRoute(route: route, outputType: O.self)
        Severity: Major
        Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift and 5 other locations - About 35 mins to fix
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 197..211
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 272..292
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 513..537
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 661..683
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 1491..1509

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 45.

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

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

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

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

        Refactorings

        Further Reading

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

            public func get<T1: TypeSafeMiddleware, T2: TypeSafeMiddleware, O: Codable>(
                _ route: String,
                handler: @escaping (T1, T2, @escaping CodableArrayResultClosure<O>) -> Void
            ) {
                registerGetRoute(route: route, outputType: O.self, outputIsArray: true)
        Severity: Major
        Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift and 5 other locations - About 35 mins to fix
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 87..101
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 272..292
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 513..537
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 661..683
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 1491..1509

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 45.

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

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

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

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

        Refactorings

        Further Reading

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

            public func get<T: TypeSafeMiddleware, Q: QueryParams, O: Codable>(
                _ route: String,
                handler: @escaping (T, Q, @escaping CodableResultClosure<O>) -> Void
            ) {
                registerGetRoute(route: route, queryParams: Q.self, optionalQParam: false, outputType: O.self)
        Severity: Major
        Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift and 5 other locations - About 35 mins to fix
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 87..101
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 197..211
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 272..292
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 661..683
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 1491..1509

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 45.

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

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

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

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

        Refactorings

        Further Reading

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

            public func delete<T1: TypeSafeMiddleware, T2: TypeSafeMiddleware, Q: QueryParams>(
                _ route: String,
                handler: @escaping (T1, T2, Q, @escaping ResultClosure) -> Void
            ) {
                registerDeleteRoute(route: route, queryParams: Q.self, optionalQParam: false)
        Severity: Minor
        Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift and 2 other locations - About 35 mins to fix
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 1026..1040
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 1103..1123

        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

            public func delete<T1: TypeSafeMiddleware, T2: TypeSafeMiddleware, T3: TypeSafeMiddleware>(
                _ route: String,
                handler: @escaping (T1, T2, T3, @escaping ResultClosure) -> Void
            ) {
                registerDeleteRoute(route: route)
        Severity: Minor
        Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift and 2 other locations - About 35 mins to fix
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 1103..1123
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 1291..1313

        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

            public func delete<T1: TypeSafeMiddleware, T2: TypeSafeMiddleware, Id: Identifier>(
                _ route: String,
                handler: @escaping (T1, T2, Id, @escaping ResultClosure) -> Void
            ) {
                if !pathSyntaxIsValid(route, identifierExpected: true) {
        Severity: Minor
        Found in Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift and 2 other locations - About 35 mins to fix
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 1026..1040
        Sources/Kitura/CodableRouter+TypeSafeMiddleware.swift on lines 1291..1313

        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

        There are no issues that match your filters.

        Category
        Status