IBM-Swift/Kitura

View on GitHub
Tests/KituraTests/TestTypeSafeMiddleware.swift

Summary

Maintainability
F
1 wk
Test Coverage

File TestTypeSafeMiddleware.swift has 914 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import XCTest
import Foundation
import KituraContracts

@testable import Kitura
Severity: Major
Found in Tests/KituraTests/TestTypeSafeMiddleware.swift - About 2 days to fix

    TestTypeSafeMiddleware has 34 methods (exceeds 20 allowed). Consider refactoring.
    Open

    final class TestTypeSafeMiddleware: KituraTest, KituraTestSuite {
        static var allTests: [(String, (TestTypeSafeMiddleware) -> () throws -> Void)] {
            return [
                ("testSingleMiddlewareGetSingleton", testSingleMiddlewareGetSingleton),
                ("testMultipleMiddlewareGetSingleton", testMultipleMiddlewareGetSingleton),
    Severity: Minor
    Found in Tests/KituraTests/TestTypeSafeMiddleware.swift - About 4 hrs to fix

      Function testCustomCoderGet has 60 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          func testCustomCoderGet() {
              struct SimpleQuery: QueryParams {
                  let string: String
              }
              let jsonEncoder: () -> BodyEncoder = {
      Severity: Major
      Found in Tests/KituraTests/TestTypeSafeMiddleware.swift - About 2 hrs to fix

        Function testCustomCoder has 56 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            func testCustomCoder() {
                struct SimpleQuery: QueryParams {
                    let string: String
                }
                let jsonEncoder: () -> BodyEncoder = {
        Severity: Major
        Found in Tests/KituraTests/TestTypeSafeMiddleware.swift - About 2 hrs to fix

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

              func testMultipleMiddlewareDeleteOptionalParameters() {
                  var userArray1 = [User(id: 1, name: "Andy"), User(id: 2, name: "Dave"), User(id: 3, name: "Ian")]
                  var userArray2 = [User(id: 1, name: "Andy"), User(id: 2, name: "Dave"), User(id: 3, name: "Ian")]
                  
                  router.delete("/userMultiMiddleware") { (middleware: UserMiddleware, middleware2: UserMiddleware2, middleware3: UserMiddleware3, query: MyQuery?, respondWith: (RequestError?) -> Void) in
          Severity: Minor
          Found in Tests/KituraTests/TestTypeSafeMiddleware.swift - About 1 hr to fix

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

                func testMultipleMiddlewarePatch() {
                    let user = User(id: 1, name: "NewUser")
            
                    router.patch("/userMultiMiddleware") { (middleware: UserMiddleware, middleware2: UserMiddleware2, middleware3: UserMiddleware3, id: Int, user: User, respondWith: (User?, RequestError?) -> Void) in
                        print("PATCH on /userMultiMiddleware for user \(user) - received headers \(middleware.header), \(middleware2.header), \(middleware3.header)")
            Severity: Major
            Found in Tests/KituraTests/TestTypeSafeMiddleware.swift and 1 other location - About 4 hrs to fix
            Tests/KituraTests/TestTypeSafeMiddleware.swift on lines 913..944

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

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

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

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

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

            Refactorings

            Further Reading

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

                func testMultipleMiddlewarePut() {
                    let user = User(id: 1, name: "NewUser")
            
                    router.put("/userMultiMiddleware") { (middleware: UserMiddleware, middleware2: UserMiddleware2, middleware3: UserMiddleware3, id: Int, user: User, respondWith: (User?, RequestError?) -> Void) in
                        print("PUT on /userMultiMiddleware for user \(user) - received headers \(middleware.header), \(middleware2.header), \(middleware3.header)")
            Severity: Major
            Found in Tests/KituraTests/TestTypeSafeMiddleware.swift and 1 other location - About 4 hrs to fix
            Tests/KituraTests/TestTypeSafeMiddleware.swift on lines 968..999

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

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

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

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

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

            Refactorings

            Further Reading

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

                func testMultipleMiddlewareGetSingletonParameters() {
                    // Expected user: User(id: 1, name: "Andy")
                    guard let user = userStore[1] else {
                        XCTFail("no value found for userStore[1]")
                        return
            Severity: Major
            Found in Tests/KituraTests/TestTypeSafeMiddleware.swift and 1 other location - About 4 hrs to fix
            Tests/KituraTests/TestTypeSafeMiddleware.swift on lines 256..290

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

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

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

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

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

            Refactorings

            Further Reading

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

                func testMultipleMiddlewareGetIdentifier() {
                    // Expected user: User(id: 1, name: "Andy")
                    guard let user = userStore[1] else {
                        XCTFail("no value found for userStore[1]")
                        return
            Severity: Major
            Found in Tests/KituraTests/TestTypeSafeMiddleware.swift and 1 other location - About 4 hrs to fix
            Tests/KituraTests/TestTypeSafeMiddleware.swift on lines 375..409

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

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

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

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

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

            Refactorings

            Further Reading

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

                func testSingleMiddlewarePut() {
                    let user = User(id: 1, name: "NewUser")
            
                    router.put("/userMiddleware") { (middleware: UserMiddleware, id: Int, user: User, respondWith: (User?, RequestError?) -> Void) in
                        print("PUT on /userMiddleware for user \(user) - received header \(middleware.header)")
            Severity: Major
            Found in Tests/KituraTests/TestTypeSafeMiddleware.swift and 1 other location - About 3 hrs to fix
            Tests/KituraTests/TestTypeSafeMiddleware.swift on lines 946..966

            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

                func testSingleMiddlewarePatch() {
                    let user = User(id: 1, name: "NewUser")
            
                    router.patch("/userMiddleware") { (middleware: UserMiddleware, id: Int, user: User, respondWith: (User?, RequestError?) -> Void) in
                        print("PATCH on /userMiddleware for user \(user) - received header \(middleware.header)")
            Severity: Major
            Found in Tests/KituraTests/TestTypeSafeMiddleware.swift and 1 other location - About 3 hrs to fix
            Tests/KituraTests/TestTypeSafeMiddleware.swift on lines 891..911

            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

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

                struct User: Codable, Equatable {
                    let id: Int
                    let name: String
            
                    init(id: Int, name: String) {
            Severity: Major
            Found in Tests/KituraTests/TestTypeSafeMiddleware.swift and 1 other location - About 1 hr to fix
            Tests/KituraTests/TestCodableRouter.swift on lines 73..85

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

            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

                    buildServerTest(router, timeout: 30)
                        // Test that handler is invoked successfully when all middlewares are satisfied
                        .request("delete", path: "/userMultiMiddleware?id=1", headers: goodHeaders)
                        .hasStatus(.noContent)
                        .hasNoData()
            Severity: Major
            Found in Tests/KituraTests/TestTypeSafeMiddleware.swift and 1 other location - About 1 hr to fix
            Tests/KituraTests/TestTypeSafeMiddleware.swift on lines 626..643

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

            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

                    buildServerTest(router, timeout: 30)
                        // Test that handler is invoked successfully when all middlewares are satisfied
                        .request("delete", path: "/userMultiMiddleware/1", headers: goodHeaders)
                        .hasStatus(.noContent)
                        .hasNoData()
            Severity: Major
            Found in Tests/KituraTests/TestTypeSafeMiddleware.swift and 1 other location - About 1 hr to fix
            Tests/KituraTests/TestTypeSafeMiddleware.swift on lines 717..734

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

            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

            extension TestMiddleware {
                static func handle(request: RouterRequest, response: RouterResponse, completion: @escaping (Self?, RequestError?) -> Void) {
                    guard let expectedHeader = request.headers["TestHeader"] else {
                        return completion(nil, .badRequest)
                    }
            Severity: Major
            Found in Tests/KituraTests/TestTypeSafeMiddleware.swift and 2 other locations - About 1 hr to fix
            Tests/KituraTests/TestTypeSafeMiddleware.swift on lines 1185..1193
            Tests/KituraTests/TestTypeSafeMiddleware.swift on lines 1200..1208

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

            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

            extension TestMiddleware3 {
                static func handle(request: RouterRequest, response: RouterResponse, completion: @escaping (Self?, RequestError?) -> Void) {
                    guard let expectedHeader = request.headers["TestHeader3"] else {
                        return completion(nil, .badRequest)
                    }
            Severity: Major
            Found in Tests/KituraTests/TestTypeSafeMiddleware.swift and 2 other locations - About 1 hr to fix
            Tests/KituraTests/TestTypeSafeMiddleware.swift on lines 1170..1178
            Tests/KituraTests/TestTypeSafeMiddleware.swift on lines 1185..1193

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

            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

            extension TestMiddleware2 {
                static func handle(request: RouterRequest, response: RouterResponse, completion: @escaping (Self?, RequestError?) -> Void) {
                    guard let expectedHeader = request.headers["TestHeader2"] else {
                        return completion(nil, .notAcceptable)
                    }
            Severity: Major
            Found in Tests/KituraTests/TestTypeSafeMiddleware.swift and 2 other locations - About 1 hr to fix
            Tests/KituraTests/TestTypeSafeMiddleware.swift on lines 1170..1178
            Tests/KituraTests/TestTypeSafeMiddleware.swift on lines 1200..1208

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

            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

                    customRouter.put("/customCoder2") { (middleware: UserMiddleware, middleware2: UserMiddleware, id: Int, inDate: CodableDate, respondWith: (CodableDate?, RequestError?) -> Void) in
                        print("PUT on /customCoder/\(id)")
                        XCTAssertEqual(inDate, codableDate)
                        respondWith(codableDate, nil)
                    }
            Severity: Major
            Found in Tests/KituraTests/TestTypeSafeMiddleware.swift and 1 other location - About 1 hr to fix
            Tests/KituraTests/TestTypeSafeMiddleware.swift on lines 1110..1114

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

            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

                    customRouter.patch("/customCoder2") { (middleware: UserMiddleware, middleware2: UserMiddleware, id: Int, inDate: CodableDate, respondWith: (CodableDate?, RequestError?) -> Void) in
                        print("PATCH on /customCoder/\(id)")
                        XCTAssertEqual(inDate, codableDate)
                        respondWith(codableDate, nil)
                    }
            Severity: Major
            Found in Tests/KituraTests/TestTypeSafeMiddleware.swift and 1 other location - About 1 hr to fix
            Tests/KituraTests/TestTypeSafeMiddleware.swift on lines 1105..1109

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

            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

                    buildServerTest(router, timeout: 30)
                        .request("delete", path: "/userMiddleware?id=1", headers: ["TestHeader": "Hello"])
                        .hasStatus(.noContent)
                        .hasNoData()
                        .has { _ in XCTAssertNil(self.userStore[1]) }
            Severity: Major
            Found in Tests/KituraTests/TestTypeSafeMiddleware.swift and 1 other location - About 1 hr to fix
            Tests/KituraTests/TestTypeSafeMiddleware.swift on lines 598..608

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 92.

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

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

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

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

            Refactorings

            Further Reading

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

                    buildServerTest(router, timeout: 30)
                        .request("delete", path: "/userMiddleware/1", headers: ["TestHeader": "Hello"])
                        .hasStatus(.noContent)
                        .hasNoData()
                        .has { _ in XCTAssertNil(self.userStore[1]) }
            Severity: Major
            Found in Tests/KituraTests/TestTypeSafeMiddleware.swift and 1 other location - About 1 hr to fix
            Tests/KituraTests/TestTypeSafeMiddleware.swift on lines 657..667

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 92.

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

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

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

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

            Refactorings

            Further Reading

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

                    buildServerTest(router, timeout: 30)
                        .request("get", path: "/userMultiMiddleware?id=2", headers: goodHeaders)
                        .hasStatus(.OK)
                        .hasContentType(withPrefix: "application/json")
                        .hasData(expectedArray)
            Severity: Major
            Found in Tests/KituraTests/TestTypeSafeMiddleware.swift and 1 other location - About 1 hr to fix
            Tests/KituraTests/TestCodableRouter.swift on lines 831..842

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

            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

                    buildServerTest(router, timeout: 30)
                        .request("get", path: "/userMiddleware?id=2", headers: ["TestHeader": "Hello"])
                        .hasStatus(.OK)
                        .hasContentType(withPrefix: "application/json")
                        .hasData(expectedArray)
            Severity: Major
            Found in Tests/KituraTests/TestTypeSafeMiddleware.swift and 5 other locations - About 1 hr to fix
            Tests/KituraTests/TestTypeSafeMiddleware.swift on lines 132..142
            Tests/KituraTests/TestTypeSafeMiddleware.swift on lines 185..195
            Tests/KituraTests/TestTypeSafeMiddleware.swift on lines 243..253
            Tests/KituraTests/TestTypeSafeMiddleware.swift on lines 302..312
            Tests/KituraTests/TestTypeSafeMiddleware.swift on lines 362..372

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

            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

                    buildServerTest(router, timeout: 30)
                        .request("get", path: "/userMiddleware", headers: ["TestHeader": "Hello"])
                        .hasStatus(.OK)
                        .hasContentType(withPrefix: "application/json")
                        .hasData(userArray)
            Severity: Major
            Found in Tests/KituraTests/TestTypeSafeMiddleware.swift and 5 other locations - About 1 hr to fix
            Tests/KituraTests/TestTypeSafeMiddleware.swift on lines 132..142
            Tests/KituraTests/TestTypeSafeMiddleware.swift on lines 243..253
            Tests/KituraTests/TestTypeSafeMiddleware.swift on lines 302..312
            Tests/KituraTests/TestTypeSafeMiddleware.swift on lines 362..372
            Tests/KituraTests/TestTypeSafeMiddleware.swift on lines 421..431

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

            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

                    buildServerTest(router, timeout: 30)
                        .request("get", path: "/userMiddleware", headers: ["TestHeader": "Hello"])
                        .hasStatus(.OK)
                        .hasContentType(withPrefix: "application/json")
                        .hasData(user)
            Severity: Major
            Found in Tests/KituraTests/TestTypeSafeMiddleware.swift and 5 other locations - About 1 hr to fix
            Tests/KituraTests/TestTypeSafeMiddleware.swift on lines 185..195
            Tests/KituraTests/TestTypeSafeMiddleware.swift on lines 243..253
            Tests/KituraTests/TestTypeSafeMiddleware.swift on lines 302..312
            Tests/KituraTests/TestTypeSafeMiddleware.swift on lines 362..372
            Tests/KituraTests/TestTypeSafeMiddleware.swift on lines 421..431

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

            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

                    buildServerTest(router, timeout: 30)
                        .request("get", path: "/userMiddleware/1", headers: ["TestHeader": "Hello"])
                        .hasStatus(.OK)
                        .hasContentType(withPrefix: "application/json")
                        .hasData(user)
            Severity: Major
            Found in Tests/KituraTests/TestTypeSafeMiddleware.swift and 5 other locations - About 1 hr to fix
            Tests/KituraTests/TestTypeSafeMiddleware.swift on lines 132..142
            Tests/KituraTests/TestTypeSafeMiddleware.swift on lines 185..195
            Tests/KituraTests/TestTypeSafeMiddleware.swift on lines 302..312
            Tests/KituraTests/TestTypeSafeMiddleware.swift on lines 362..372
            Tests/KituraTests/TestTypeSafeMiddleware.swift on lines 421..431

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

            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

                    buildServerTest(router, timeout: 30)
                        .request("get", path: "/userMiddleware?id=1", headers: ["TestHeader": "Hello"])
                        .hasStatus(.OK)
                        .hasContentType(withPrefix: "application/json")
                        .hasData(user)
            Severity: Major
            Found in Tests/KituraTests/TestTypeSafeMiddleware.swift and 5 other locations - About 1 hr to fix
            Tests/KituraTests/TestTypeSafeMiddleware.swift on lines 132..142
            Tests/KituraTests/TestTypeSafeMiddleware.swift on lines 185..195
            Tests/KituraTests/TestTypeSafeMiddleware.swift on lines 243..253
            Tests/KituraTests/TestTypeSafeMiddleware.swift on lines 302..312
            Tests/KituraTests/TestTypeSafeMiddleware.swift on lines 421..431

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

            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

                    buildServerTest(router, timeout: 30)
                        .request("get", path: "/userMiddleware", headers: ["TestHeader": "Hello"])
                        .hasStatus(.OK)
                        .hasContentType(withPrefix: "application/json")
                        .hasData(expectedIntData)
            Severity: Major
            Found in Tests/KituraTests/TestTypeSafeMiddleware.swift and 5 other locations - About 1 hr to fix
            Tests/KituraTests/TestTypeSafeMiddleware.swift on lines 132..142
            Tests/KituraTests/TestTypeSafeMiddleware.swift on lines 185..195
            Tests/KituraTests/TestTypeSafeMiddleware.swift on lines 243..253
            Tests/KituraTests/TestTypeSafeMiddleware.swift on lines 362..372
            Tests/KituraTests/TestTypeSafeMiddleware.swift on lines 421..431

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

            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

                    let intTuple: [(Int, User)] = [(1, User(id: 1, name: "Andy")), (2, User(id: 2, name: "Dave")), (3, User(id: 3, name: "Ian"))]
            Severity: Major
            Found in Tests/KituraTests/TestTypeSafeMiddleware.swift and 3 other locations - About 1 hr to fix
            Tests/KituraTests/TestCodableRouter.swift on lines 297..297
            Tests/KituraTests/TestCodableRouter.swift on lines 301..301
            Tests/KituraTests/TestTypeSafeMiddleware.swift on lines 293..293

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

            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

                    let intTuple: [(Int, User)] = [(1, User(id: 1, name: "Andy")), (2, User(id: 2, name: "Dave")), (3, User(id: 3, name: "Ian"))]
            Severity: Major
            Found in Tests/KituraTests/TestTypeSafeMiddleware.swift and 3 other locations - About 1 hr to fix
            Tests/KituraTests/TestCodableRouter.swift on lines 297..297
            Tests/KituraTests/TestCodableRouter.swift on lines 301..301
            Tests/KituraTests/TestTypeSafeMiddleware.swift on lines 316..316

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

            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

                struct CodableDate: Codable, Equatable {
                    let date: Date
                    
                    init(date: Date) {
                        self.date = date
            Severity: Major
            Found in Tests/KituraTests/TestTypeSafeMiddleware.swift and 2 other locations - About 1 hr to fix
            Tests/KituraTests/TestCodableRouter.swift on lines 61..71
            Tests/KituraTests/TestCustomCoders.swift on lines 33..41

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

            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

                    router.get("/userMultiMiddleware") { (middleware: UserMiddleware, middleware2: UserMiddleware2, middleware3: UserMiddleware3, respondWith: (User?, RequestError?) -> Void) in
                        print("GET on /userMultiMiddleware - received headers \(middleware.header), \(middleware2.header), \(middleware3.header)")
                        respondWith(user, nil)
                    }
            Severity: Major
            Found in Tests/KituraTests/TestTypeSafeMiddleware.swift and 1 other location - About 1 hr to fix
            Tests/KituraTests/TestTypeSafeMiddleware.swift on lines 1034..1037

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

            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

                    customRouter.get("/customCoderQuery2") { (middleware: UserMiddleware, middleware2: UserMiddleware, query: SimpleQuery, respondWith: (CodableDate?, RequestError?) -> Void) in
                    print("GET on /customCoderQuery")
                    respondWith(codableDate, nil)
                    }
            Severity: Major
            Found in Tests/KituraTests/TestTypeSafeMiddleware.swift and 1 other location - About 1 hr to fix
            Tests/KituraTests/TestTypeSafeMiddleware.swift on lines 148..151

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

            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

                    router.get("/logging") { (middleware: LoggingMiddleware, query: MyQuery, respondWith: (User?, RequestError?) -> Void) in
                        XCTFail("Query parameters were decoded")
                        respondWith(nil, .internalServerError)
                    }
            Severity: Major
            Found in Tests/KituraTests/TestTypeSafeMiddleware.swift and 2 other locations - About 1 hr to fix
            Tests/KituraTests/TestCodableRouter.swift on lines 464..467
            Tests/KituraTests/TestCodableRouter.swift on lines 497..500

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 70.

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

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

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

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

            Refactorings

            Further Reading

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

                    router.get("/userMiddleware") { (middleware: UserMiddleware, query: MyQuery?, respondWith: ([User]?, RequestError?) -> Void) in
                        print("GET array with optional parameters on /userMiddleware - received header \(middleware.header)")
                        if let query = query {
                            let matchedUsers = userArray.filter { $0.id == query.id }
                            respondWith(matchedUsers, nil)
            Severity: Minor
            Found in Tests/KituraTests/TestTypeSafeMiddleware.swift and 1 other location - About 55 mins to fix
            Tests/KituraTests/TestTypeSafeMiddleware.swift on lines 504..512

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

            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

                    router.get("/userMultiMiddleware") { (middleware: UserMiddleware, middleware2: UserMiddleware2, middleware3: UserMiddleware3, query: MyQuery?, respondWith: ([User]?, RequestError?) -> Void) in
                        print("GET array with optional parameters on /userMultiMiddleware - received headers \(middleware.header), \(middleware2.header), \(middleware3.header)")
                        if let query = query {
                            let matchedUsers = userArray.filter { $0.id == query.id }
                            respondWith(matchedUsers, nil)
            Severity: Minor
            Found in Tests/KituraTests/TestTypeSafeMiddleware.swift and 1 other location - About 55 mins to fix
            Tests/KituraTests/TestTypeSafeMiddleware.swift on lines 438..446

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

            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

                    router.get("/userMiddleware") { (middleware: UserMiddleware, respondWith: (User?, RequestError?) -> Void) in
                        print("GET on /userMiddleware - received header \(middleware.header)")
                        respondWith(user, nil)
                    }
            Severity: Major
            Found in Tests/KituraTests/TestTypeSafeMiddleware.swift and 2 other locations - About 55 mins to fix
            Tests/KituraTests/TestCodableRouter.swift on lines 144..147
            Tests/KituraTests/TestCodableRouter.swift on lines 156..159

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

            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

                    router.delete("/userMultiMiddleware") { (middleware: UserMiddleware, middleware2: UserMiddleware2, middleware3: UserMiddleware3, query: MyQuery?, respondWith: (RequestError?) -> Void) in
                        print("DELETE on /userMultiMiddleware - received headers \(middleware.header), \(middleware2.header), \(middleware3.header)")
                        if let query = query {
                            userArray1 = userArray1.filter { $0.id != query.id }
                            respondWith(nil)
            Severity: Minor
            Found in Tests/KituraTests/TestTypeSafeMiddleware.swift and 1 other location - About 50 mins to fix
            Tests/KituraTests/TestTypeSafeMiddleware.swift on lines 674..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 62.

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

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

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

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

            Refactorings

            Further Reading

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

                    router.delete("/userMiddleware") { (middleware: UserMiddleware, query: MyQuery?, respondWith: (RequestError?) -> Void) in
                        print("MY DELETE on /userMiddleware - received header \(middleware.header)")
                        if let query = query {
                            userArray1 = userArray1.filter { $0.id != query.id }
                            respondWith(nil)
            Severity: Minor
            Found in Tests/KituraTests/TestTypeSafeMiddleware.swift and 1 other location - About 50 mins to fix
            Tests/KituraTests/TestTypeSafeMiddleware.swift on lines 741..750

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 62.

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

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

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

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

            Refactorings

            Further Reading

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

                    customRouter.get("/customCoderQueryArray2") { (middleware: UserMiddleware, middleware2: UserMiddleware, query: SimpleQuery, respondWith: ([CodableDate]?, RequestError?) -> Void) in
                    print("GET on /customCoderQueryArray")
                    respondWith([codableDate], nil)
                    }
            Severity: Minor
            Found in Tests/KituraTests/TestTypeSafeMiddleware.swift and 1 other location - About 40 mins to fix
            Tests/KituraTests/TestTypeSafeMiddleware.swift on lines 201..204

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 50.

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

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

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

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

            Refactorings

            Further Reading

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

                    router.get("/userMultiMiddleware") { (middleware: UserMiddleware, middleware2: UserMiddleware2, middleware3: UserMiddleware3, respondWith: ([User]?, RequestError?) -> Void) in
                        print("GET on /userMultiMiddleware - received headers \(middleware.header), \(middleware2.header), \(middleware3.header)")
                        respondWith(userArray, nil)
                    }
            Severity: Minor
            Found in Tests/KituraTests/TestTypeSafeMiddleware.swift and 1 other location - About 40 mins to fix
            Tests/KituraTests/TestTypeSafeMiddleware.swift on lines 1038..1041

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 50.

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

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

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

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

            Refactorings

            Further Reading

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

                    router.delete("/userMultiMiddleware") { (middleware: UserMiddleware, middleware2: UserMiddleware2, middleware3: UserMiddleware3, id: Int, respondWith: (RequestError?) -> Void) in
                        print("DELETE on /userMultiMiddleware - received headers \(middleware.header), \(middleware2.header), \(middleware3.header)")
                        guard self.userStore.removeValue(forKey: id) != nil else {
                            respondWith(.notFound)
                            return
            Severity: Minor
            Found in Tests/KituraTests/TestTypeSafeMiddleware.swift and 1 other location - About 40 mins to fix
            Tests/KituraTests/TestTypeSafeMiddleware.swift on lines 704..711

            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

                    userStore = [1: User(id: 1, name: "Andy"), 2: User(id: 2, name: "Dave"), 3: User(id: 3, name: "Ian")]
            Severity: Minor
            Found in Tests/KituraTests/TestTypeSafeMiddleware.swift and 1 other location - About 40 mins to fix
            Tests/KituraTests/TestCodableRouter.swift on lines 56..56

            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

                    router.delete("/userMultiMiddleware") { (middleware: UserMiddleware, middleware2: UserMiddleware2, middleware3: UserMiddleware3, query: MyQuery, respondWith: (RequestError?) -> Void) in
                        print("DELETE on /userMultiMiddleware - received headers \(middleware.header), \(middleware2.header), \(middleware3.header)")
                        guard self.userStore.removeValue(forKey: query.id) != nil else {
                            respondWith(.notFound)
                            return
            Severity: Minor
            Found in Tests/KituraTests/TestTypeSafeMiddleware.swift and 1 other location - About 40 mins to fix
            Tests/KituraTests/TestTypeSafeMiddleware.swift on lines 613..620

            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

                    router.delete("/userMiddleware") { (middleware: UserMiddleware, query: MyQuery, respondWith: (RequestError?) -> Void) in
                        print("DELETE on /userMiddleware - received header \(middleware.header)")
                        guard self.userStore.removeValue(forKey: query.id) != nil else {
                            respondWith(.notFound)
                            return
            Severity: Minor
            Found in Tests/KituraTests/TestTypeSafeMiddleware.swift and 1 other location - About 35 mins to fix
            Tests/KituraTests/TestTypeSafeMiddleware.swift on lines 704..711

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 45.

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

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

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

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

            Refactorings

            Further Reading

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

                    router.get("/userMiddleware") { (middleware: UserMiddleware, query: MyQuery, respondWith: ([User]?, RequestError?) -> Void) in
                        print("GET array with parameters on /userMiddleware - received header \(middleware.header)")
                        let matchedUsers = userArray.filter { $0.id <=  query.id }
                        respondWith(matchedUsers, nil)
                    }
            Severity: Minor
            Found in Tests/KituraTests/TestTypeSafeMiddleware.swift and 1 other location - About 35 mins to fix
            Tests/KituraTests/TestTypeSafeMiddleware.swift on lines 1026..1029

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 43.

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

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

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

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

            Refactorings

            Further Reading

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

                    router.delete("/userMiddleware") { (middleware: UserMiddleware, id: Int, respondWith: (RequestError?) -> Void) in
                        print("DELETE on /userMiddleware - received header \(middleware.header)")
                        guard self.userStore.removeValue(forKey: id) != nil else {
                            respondWith(.notFound)
                            return
            Severity: Minor
            Found in Tests/KituraTests/TestTypeSafeMiddleware.swift and 1 other location - About 35 mins to fix
            Tests/KituraTests/TestTypeSafeMiddleware.swift on lines 613..620

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 43.

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

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

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

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

            Refactorings

            Further Reading

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

                    customRouter.get("/customCoderArray2") { (middleware: UserMiddleware, middleware2: UserMiddleware, respondWith: ([CodableDate]?, RequestError?) -> Void) in
                    print("GET on /customCoderArray")
                    respondWith([codableDate], nil)
                    }
            Severity: Minor
            Found in Tests/KituraTests/TestTypeSafeMiddleware.swift and 1 other location - About 35 mins to fix
            Tests/KituraTests/TestTypeSafeMiddleware.swift on lines 415..419

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 43.

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

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

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

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

            Refactorings

            Further Reading

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

                    router.get("/userMultiMiddleware") { (middleware: UserMiddleware, middleware2: UserMiddleware2, middleware3: UserMiddleware3, query: MyQuery, respondWith: ([User]?, RequestError?) -> Void) in
                        print("GET array with parameters on /userMultiMiddleware - received headers \(middleware.header), \(middleware2.header), \(middleware3.header)")
                        let matchedUsers = userArray.filter { $0.id <=  query.id }
                        respondWith(matchedUsers, nil)
                    }
            Severity: Minor
            Found in Tests/KituraTests/TestTypeSafeMiddleware.swift and 1 other location - About 30 mins to fix
            Tests/KituraTests/TestTypeSafeMiddleware.swift on lines 415..419

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 41.

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

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

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

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

            Refactorings

            Further Reading

            Closure is the function's final argument and may be passed as a trailing closure instead
            Open

                    let expectedIntData: [[String: User]] = intTuple.map({ [$0.value: $1] })

            trailing-closure

            Closures that are the last argument of a function should be passed into the function using trailing closure syntax.

            Preferred

            reversed = names.sort { s1, s2 in return s1 > s2 }

            Not Preferred

            reversed = names.sort({ s1, s2 in return s1 > s2 })

            Closure is the function's final argument and may be passed as a trailing closure instead
            Open

                    let expectedIntData: [[String: User]] = intTuple.map({ [$0.value: $1] })

            trailing-closure

            Closures that are the last argument of a function should be passed into the function using trailing closure syntax.

            Preferred

            reversed = names.sort { s1, s2 in return s1 > s2 }

            Not Preferred

            reversed = names.sort({ s1, s2 in return s1 > s2 })

            There are no issues that match your filters.

            Category
            Status