IBM-Swift/Kitura

View on GitHub
Tests/KituraTests/TestResponse.swift

Summary

Maintainability
F
2 wks
Test Coverage

File TestResponse.swift has 1410 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import XCTest
import Foundation

@testable import Kitura
@testable import KituraNet
Severity: Major
Found in Tests/KituraTests/TestResponse.swift - About 3 days to fix

    Function setupRouter has 395 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        static func setupRouter() -> Router {
            let router = Router()
    
            // subdomains test
            router.get("subdomains") { request, response, next in
    Severity: Major
    Found in Tests/KituraTests/TestResponse.swift - About 1 day to fix

      Function setupRouter has a Cognitive Complexity of 94 (exceeds 5 allowed). Consider refactoring.
      Open

          static func setupRouter() -> Router {
              let router = Router()
      
              // subdomains test
              router.get("subdomains") { request, response, next in
      Severity: Minor
      Found in Tests/KituraTests/TestResponse.swift - About 1 day to fix

      Cognitive Complexity

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

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

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

      Further reading

      TestResponse has 38 methods (exceeds 20 allowed). Consider refactoring.
      Open

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

        Function testSend has 104 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            func testSend() {
                performServerTest(router) { expectation in
                    self.performRequest("get", path: "/data", callback: { response in
                        XCTAssertNotNil(response, "ERROR!!! ClientRequest response object was nil")
                        XCTAssertEqual(response?.statusCode, HTTPStatusCode.OK, "HTTP Status code was \(String(describing: response?.statusCode))")
        Severity: Major
        Found in Tests/KituraTests/TestResponse.swift - About 4 hrs to fix

          Function testMultipartFormParsing has 94 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              func testMultipartFormParsing() {
          
                  // ensure NSData.components works just like String.components
                  dataComponentsTest("AxAyAzA", separator: "A")
                  dataComponentsTest("HelloWorld", separator: "World")
          Severity: Major
          Found in Tests/KituraTests/TestResponse.swift - About 3 hrs to fix

            Function testSend has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
            Open

                func testSend() {
                    performServerTest(router) { expectation in
                        self.performRequest("get", path: "/data", callback: { response in
                            XCTAssertNotNil(response, "ERROR!!! ClientRequest response object was nil")
                            XCTAssertEqual(response?.statusCode, HTTPStatusCode.OK, "HTTP Status code was \(String(describing: response?.statusCode))")
            Severity: Minor
            Found in Tests/KituraTests/TestResponse.swift - About 2 hrs to fix

            Cognitive Complexity

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

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

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

            Further reading

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

                func testJsonp() {
                    performServerTest(router) { expectation in
                        self.performRequest("get", path: "/jsonp?callback=testfn", callback: { response in
                            XCTAssertNotNil(response, "ERROR!!! ClientRequest response object was nil")
                            XCTAssertEqual(response?.statusCode, HTTPStatusCode.OK, "HTTP Status code was \(String(describing: response?.statusCode))")
            Severity: Major
            Found in Tests/KituraTests/TestResponse.swift - About 2 hrs to fix

              Function testPostRequestUrlEncoded has 48 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  func testPostRequestUrlEncoded() {
                      performServerTest(router) { expectation in
                          self.performRequest("post", path: "/bodytest", callback: {response in
                              XCTAssertNotNil(response, "ERROR!!! ClientRequest response object was nil")
                              XCTAssertNotNil(response?.headers["Date"], "There was No Date header in the response")
              Severity: Minor
              Found in Tests/KituraTests/TestResponse.swift - About 1 hr to fix

                Function testAcceptTypes has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    func testAcceptTypes() {
                
                        router.get("/customPage") { request, response, next in
                
                            XCTAssertEqual(request.accepts(type: "html"), "html", "Accepts did not return expected value")
                Severity: Minor
                Found in Tests/KituraTests/TestResponse.swift - About 1 hr to fix

                  Function testFormat has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      func testFormat() {
                          performServerTest(router) { expectation in
                              self.performRequest("get", path:"/format", callback: {response in
                                  XCTAssertNotNil(response, "ERROR!!! ClientRequest response object was nil")
                                  XCTAssertEqual(response?.statusCode, HTTPStatusCode.OK, "HTTP Status code was \(String(describing: response?.statusCode))")
                  Severity: Minor
                  Found in Tests/KituraTests/TestResponse.swift - About 1 hr to fix

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

                        func testSubdomains() {
                            performServerTest(router) { expectation in
                                self.performRequest("get", path: "/subdomains", callback: { response in
                                    XCTAssertNotNil(response, "ERROR!!! ClientRequest response object was nil")
                                    XCTAssertEqual(response?.statusCode, HTTPStatusCode.OK, "HTTP Status code was \(String(describing: response?.statusCode))")
                    Severity: Minor
                    Found in Tests/KituraTests/TestResponse.swift - About 1 hr to fix

                      Function testAcceptEncodingTypes has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          func testAcceptEncodingTypes() {
                              router.get("/customPage") { request, response, next in
                                  XCTAssertEqual(request.accepts(header: "Accept-Encoding", type: "gzip"), "gzip", "Accepts did not return expected value")
                                  XCTAssertEqual(request.accepts(header: "Accept-Encoding", types: "compress"), "compress", "Accepts did not return expected value")
                                  XCTAssertEqual(request.accepts(header: "Accept-Encoding", types: ["compress", "gzip"]), "gzip", "Accepts did not return expected value")
                      Severity: Minor
                      Found in Tests/KituraTests/TestResponse.swift - About 1 hr to fix

                        Function testMultipartFormParsing has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                        Open

                            func testMultipartFormParsing() {
                        
                                // ensure NSData.components works just like String.components
                                dataComponentsTest("AxAyAzA", separator: "A")
                                dataComponentsTest("HelloWorld", separator: "World")
                        Severity: Minor
                        Found in Tests/KituraTests/TestResponse.swift - About 1 hr to fix

                        Cognitive Complexity

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

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

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

                        Further reading

                        Function testPostJSONRequest has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                        Open

                            func testPostJSONRequest() {
                                let jsonToTest = SomeJSON()
                        
                                performServerTest(router) { expectation in
                                    self.performRequest("post", path: "/bodytest", callback: { response in
                        Severity: Minor
                        Found in Tests/KituraTests/TestResponse.swift - About 1 hr to fix

                        Cognitive Complexity

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

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

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

                        Further reading

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

                            func testPostJSONRequest() {
                                let jsonToTest = SomeJSON()
                        
                                performServerTest(router) { expectation in
                                    self.performRequest("post", path: "/bodytest", callback: { response in
                        Severity: Minor
                        Found in Tests/KituraTests/TestResponse.swift - About 1 hr to fix

                          Function testHeaderModifiers has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              func testHeaderModifiers() {
                          
                                  router.get("/headerTest") { _, response, next in
                          
                                      response.headers.append("Content-Type", value: "text/html")
                          Severity: Minor
                          Found in Tests/KituraTests/TestResponse.swift - About 1 hr to fix

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

                                func testRawDataPost() {
                                    performServerTest(router) { expectation in
                                        self.performRequest("post",
                                                            path: "/bodytest",
                                                            callback: { response in
                            Severity: Minor
                            Found in Tests/KituraTests/TestResponse.swift - About 1 hr to fix

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

                                  func testFormat() {
                                      performServerTest(router) { expectation in
                                          self.performRequest("get", path:"/format", callback: {response in
                                              XCTAssertNotNil(response, "ERROR!!! ClientRequest response object was nil")
                                              XCTAssertEqual(response?.statusCode, HTTPStatusCode.OK, "HTTP Status code was \(String(describing: response?.statusCode))")
                              Severity: Minor
                              Found in Tests/KituraTests/TestResponse.swift - About 55 mins to fix

                              Cognitive Complexity

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

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

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

                              Further reading

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

                                  func testPostRequestUrlEncoded() {
                                      performServerTest(router) { expectation in
                                          self.performRequest("post", path: "/bodytest", callback: {response in
                                              XCTAssertNotNil(response, "ERROR!!! ClientRequest response object was nil")
                                              XCTAssertNotNil(response?.headers["Date"], "There was No Date header in the response")
                              Severity: Minor
                              Found in Tests/KituraTests/TestResponse.swift - About 55 mins to fix

                              Cognitive Complexity

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

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

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

                              Further reading

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

                                  func testJsonp() {
                                      performServerTest(router) { expectation in
                                          self.performRequest("get", path: "/jsonp?callback=testfn", callback: { response in
                                              XCTAssertNotNil(response, "ERROR!!! ClientRequest response object was nil")
                                              XCTAssertEqual(response?.statusCode, HTTPStatusCode.OK, "HTTP Status code was \(String(describing: response?.statusCode))")
                              Severity: Minor
                              Found in Tests/KituraTests/TestResponse.swift - About 55 mins to fix

                              Cognitive Complexity

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

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

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

                              Further reading

                              Avoid too many return statements within this function.
                              Open

                                              return XCTFail()
                              Severity: Major
                              Found in Tests/KituraTests/TestResponse.swift - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                        return router
                                Severity: Major
                                Found in Tests/KituraTests/TestResponse.swift - About 30 mins to fix

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

                                      func testRouteFunc() {
                                          performServerTest(router, asyncTasks: { expectation in
                                              self.performRequest("get", path: "/route", callback: {response in
                                                  XCTAssertNotNil(response, "ERROR!!! ClientRequest response object was nil")
                                                  XCTAssertEqual(response?.statusCode, HTTPStatusCode.OK, "HTTP Status code was \(String(describing: response?.statusCode))")
                                  Severity: Minor
                                  Found in Tests/KituraTests/TestResponse.swift - About 25 mins to fix

                                  Cognitive Complexity

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

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

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

                                  Further reading

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

                                      private func runTestParameters(pathParameter: String, queryParameter: String,
                                                                     expectedReturnedPathParameter: String? = nil,
                                                                     expectedReturnedQueryParameter: String? = nil) {
                                          let expectedReturnedPathParameter = expectedReturnedPathParameter ?? pathParameter
                                          let expectedReturnedQueryParameter = expectedReturnedQueryParameter ?? queryParameter
                                  Severity: Minor
                                  Found in Tests/KituraTests/TestResponse.swift - About 25 mins to fix

                                  Cognitive Complexity

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

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

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

                                  Further reading

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

                                      func testRawDataPost() {
                                          performServerTest(router) { expectation in
                                              self.performRequest("post",
                                                                  path: "/bodytest",
                                                                  callback: { response in
                                  Severity: Minor
                                  Found in Tests/KituraTests/TestResponse.swift - About 25 mins to fix

                                  Cognitive Complexity

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

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

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

                                  Further reading

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

                                          performServerTest(router) { expectation in
                                              self.performRequest("get", path: "/subdomains", callback: { response in
                                                  XCTAssertNotNil(response, "ERROR!!! ClientRequest response object was nil")
                                                  XCTAssertEqual(response?.statusCode, HTTPStatusCode.OK, "HTTP Status code was \(String(describing: response?.statusCode))")
                                                  let hostHeader = response?.headers["Host"]?.first
                                  Severity: Major
                                  Found in Tests/KituraTests/TestResponse.swift and 1 other location - About 2 hrs to fix
                                  Tests/KituraTests/TestResponse.swift on lines 967..980

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

                                  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

                                          performServerTest(router) { expectation in
                                              self.performRequest("get", path: "/subdomains", callback: { response in
                                                  XCTAssertNotNil(response, "ERROR!!! ClientRequest response object was nil")
                                                  XCTAssertEqual(response?.statusCode, HTTPStatusCode.OK, "HTTP Status code was \(String(describing: response?.statusCode))")
                                                  let hostHeader = response?.headers["Host"]?.first
                                  Severity: Major
                                  Found in Tests/KituraTests/TestResponse.swift and 1 other location - About 2 hrs to fix
                                  Tests/KituraTests/TestResponse.swift on lines 952..965

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

                                  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

                                          performServerTest(router) { expectation in
                                              self.performRequest("get", path:"/format", callback: {response in
                                                  XCTAssertNotNil(response, "ERROR!!! ClientRequest response object was nil")
                                                  XCTAssertEqual(response?.statusCode, HTTPStatusCode.OK, "HTTP Status code was \(String(describing: response?.statusCode))")
                                                  XCTAssertEqual(response?.headers["Content-Type"]?.first, "text/plain")
                                  Severity: Major
                                  Found in Tests/KituraTests/TestResponse.swift and 1 other location - About 2 hrs to fix
                                  Tests/KituraTests/TestResponse.swift on lines 794..807

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

                                  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

                                          performServerTest(router) { expectation in
                                              self.performRequest("get", path:"/format", callback: {response in
                                                  XCTAssertNotNil(response, "ERROR!!! ClientRequest response object was nil")
                                                  XCTAssertEqual(response?.statusCode, HTTPStatusCode.OK, "HTTP Status code was \(String(describing: response?.statusCode))")
                                                  XCTAssertEqual(response?.headers["Content-Type"]?.first, "text/html")
                                  Severity: Major
                                  Found in Tests/KituraTests/TestResponse.swift and 1 other location - About 2 hrs to fix
                                  Tests/KituraTests/TestResponse.swift on lines 809..822

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

                                  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

                                          performServerTest(router) { expectation in
                                              self.performRequest("get", path: "/jsonp_encoded?callback=testfn", callback: { response in
                                                  XCTAssertNotNil(response, "ERROR!!! ClientRequest response object was nil")
                                                  XCTAssertEqual(response?.statusCode, HTTPStatusCode.OK, "HTTP Status code was \(String(describing: response?.statusCode))")
                                                  do {
                                  Severity: Major
                                  Found in Tests/KituraTests/TestResponse.swift and 2 other locations - About 2 hrs to fix
                                  Tests/KituraTests/TestResponse.swift on lines 868..883
                                  Tests/KituraTests/TestResponse.swift on lines 901..916

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

                                  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

                                          performServerTest(router) { expectation in
                                              self.performRequest("get", path: "/jsonp?callback=testfn", callback: { response in
                                                  XCTAssertNotNil(response, "ERROR!!! ClientRequest response object was nil")
                                                  XCTAssertEqual(response?.statusCode, HTTPStatusCode.OK, "HTTP Status code was \(String(describing: response?.statusCode))")
                                                  do {
                                  Severity: Major
                                  Found in Tests/KituraTests/TestResponse.swift and 2 other locations - About 2 hrs to fix
                                  Tests/KituraTests/TestResponse.swift on lines 901..916
                                  Tests/KituraTests/TestResponse.swift on lines 918..933

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

                                  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 testPostRequest() {
                                          performServerTest(router) { expectation in
                                              self.performRequest("post", path: "/bodytest", callback: {response in
                                                  XCTAssertNotNil(response, "ERROR!!! ClientRequest response object was nil")
                                                  //XCTAssertEqual(response?.method, "POST", "The request wasn't recognized as a post")
                                  Severity: Major
                                  Found in Tests/KituraTests/TestResponse.swift and 1 other location - About 2 hrs to fix
                                  Tests/KituraTests/TestResponse.swift on lines 294..312

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

                                  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

                                          performServerTest(router) { expectation in
                                              self.performRequest("get", path: "/jsonp_cb?cb=testfn", callback: { response in
                                                  XCTAssertNotNil(response, "ERROR!!! ClientRequest response object was nil")
                                                  XCTAssertEqual(response?.statusCode, HTTPStatusCode.OK, "HTTP Status code was \(String(describing: response?.statusCode))")
                                                  do {
                                  Severity: Major
                                  Found in Tests/KituraTests/TestResponse.swift and 2 other locations - About 2 hrs to fix
                                  Tests/KituraTests/TestResponse.swift on lines 868..883
                                  Tests/KituraTests/TestResponse.swift on lines 918..933

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

                                  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 testPostRequestWithDoubleBodyParser() {
                                          performServerTest(router) { expectation in
                                              self.performRequest("post", path: "/doublebodytest", callback: {response in
                                                  XCTAssertNotNil(response, "ERROR!!! ClientRequest response object was nil")
                                                  //XCTAssertEqual(response?.method, "POST", "The request wasn't recognized as a post")
                                  Severity: Major
                                  Found in Tests/KituraTests/TestResponse.swift and 1 other location - About 2 hrs to fix
                                  Tests/KituraTests/TestResponse.swift on lines 220..238

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

                                  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

                                          performServerTest(router) { expectation in
                                              self.performRequest("post", path: "/bodytest", callback: {response in
                                                  XCTAssertNotNil(response, "ERROR!!! ClientRequest response object was nil")
                                                  XCTAssertNotNil(response?.headers["Date"], "There was No Date header in the response")
                                                  do {
                                  Severity: Major
                                  Found in Tests/KituraTests/TestResponse.swift and 2 other locations - About 2 hrs to fix
                                  Tests/KituraTests/TestResponse.swift on lines 332..347
                                  Tests/KituraTests/TestResponse.swift on lines 349..364

                                  Duplicated Code

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

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

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

                                  Tuning

                                  This issue has a mass of 134.

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

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

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

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

                                  Refactorings

                                  Further Reading

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

                                          performServerTest(router) { expectation in
                                              self.performRequest("post", path: "/bodytestMultiValue", callback: {response in
                                                  XCTAssertNotNil(response, "ERROR!!! ClientRequest response object was nil")
                                                  XCTAssertNotNil(response?.headers["Date"], "There was No Date header in the response")
                                                  do {
                                  Severity: Major
                                  Found in Tests/KituraTests/TestResponse.swift and 2 other locations - About 2 hrs to fix
                                  Tests/KituraTests/TestResponse.swift on lines 315..330
                                  Tests/KituraTests/TestResponse.swift on lines 332..347

                                  Duplicated Code

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

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

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

                                  Tuning

                                  This issue has a mass of 134.

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

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

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

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

                                  Refactorings

                                  Further Reading

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

                                          performServerTest(router) { expectation in
                                              self.performRequest("post", path: "/bodytest", callback: {response in
                                                  XCTAssertNotNil(response, "ERROR!!! ClientRequest response object was nil")
                                                  XCTAssertNotNil(response?.headers["Date"], "There was No Date header in the response")
                                                  do {
                                  Severity: Major
                                  Found in Tests/KituraTests/TestResponse.swift and 2 other locations - About 2 hrs to fix
                                  Tests/KituraTests/TestResponse.swift on lines 315..330
                                  Tests/KituraTests/TestResponse.swift on lines 349..364

                                  Duplicated Code

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

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

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

                                  Tuning

                                  This issue has a mass of 134.

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

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

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

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

                                  Refactorings

                                  Further Reading

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

                                          performServerTest(router) { expectation in
                                              self.performRequest("get", path: "/lifecycle", callback: { response in
                                                  XCTAssertNotNil(response, "ERROR!!! ClientRequest response object was nil")
                                                  XCTAssertEqual(response?.statusCode, HTTPStatusCode.OK, "HTTP Status code was \(String(describing: response?.statusCode))")
                                                  XCTAssertEqual(response?.headers["x-lifecycle"]?.first, "kitura", "Wrong lifecycle header")
                                  Severity: Major
                                  Found in Tests/KituraTests/TestResponse.swift and 1 other location - About 2 hrs to fix
                                  Tests/KituraTests/TestResponse.swift on lines 1093..1107

                                  Duplicated Code

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

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

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

                                  Tuning

                                  This issue has a mass of 132.

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

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

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

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

                                  Refactorings

                                  Further Reading

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

                                          performServerTest(router) { expectation in
                                              self.performRequest("get", path: "/download", callback: { response in
                                                  XCTAssertNotNil(response, "ERROR!!! ClientRequest response object was nil")
                                                  XCTAssertEqual(response?.statusCode, HTTPStatusCode.OK, "HTTP Status code was \(String(describing: response?.statusCode))")
                                                  XCTAssertEqual(response?.headers["Content-Type"]?.first, "text/html", "Wrong Content-Type header")
                                  Severity: Major
                                  Found in Tests/KituraTests/TestResponse.swift and 1 other location - About 2 hrs to fix
                                  Tests/KituraTests/TestResponse.swift on lines 984..997

                                  Duplicated Code

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

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

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

                                  Tuning

                                  This issue has a mass of 132.

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

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

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

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

                                  Refactorings

                                  Further Reading

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

                                      func testSimpleResponse() {
                                          performServerTest(router) { expectation in
                                              self.performRequest("get", path:"/qwer", callback: {response in
                                                  XCTAssertNotNil(response, "ERROR!!! ClientRequest response object was nil")
                                                  XCTAssertEqual(response?.statusCode, HTTPStatusCode.OK, "HTTP Status code was \(String(describing: response?.statusCode))")
                                  Severity: Major
                                  Found in Tests/KituraTests/TestResponse.swift and 2 other locations - About 2 hrs to fix
                                  Tests/KituraTests/TestBridgingHTTPStatusCode.swift on lines 43..59
                                  Tests/KituraTests/TestSubrouter.swift on lines 136..152

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

                                  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

                                          performServerTest(router, asyncTasks: { expectation in
                                              self.performRequest("get", path: "/customPage", callback: {response in
                                                  XCTAssertNotNil(response, "ERROR!!! ClientRequest response object was nil")
                                                  expectation.fulfill()
                                              }) {req in
                                  Severity: Major
                                  Found in Tests/KituraTests/TestResponse.swift and 1 other location - About 1 hr to fix
                                  Tests/KituraTests/TestResponse.swift on lines 726..740

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

                                  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

                                          performServerTest(router, asyncTasks: { expectation in
                                              self.performRequest("get", path: "/customPage", callback: {response in
                                                  XCTAssertNotNil(response, "ERROR!!! ClientRequest response object was nil")
                                                  expectation.fulfill()
                                              }) {req in
                                  Severity: Major
                                  Found in Tests/KituraTests/TestResponse.swift and 1 other location - About 1 hr to fix
                                  Tests/KituraTests/TestResponse.swift on lines 776..790

                                  Duplicated Code

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

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

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

                                  Tuning

                                  This issue has a mass of 123.

                                  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 testEmptyHandler() {
                                          performServerTest(router) { expectation in
                                              self.performRequest("get", path:"/emptyHandler", callback: {response in
                                                  XCTAssertEqual(response?.statusCode, HTTPStatusCode.serviceUnavailable, "HTTP Status code was \(String(describing: response?.statusCode))")
                                                  XCTAssertNotNil(response?.headers["Date"], "There was No Date header in the response")
                                  Severity: Major
                                  Found in Tests/KituraTests/TestResponse.swift and 1 other location - About 1 hr to fix
                                  Tests/KituraTests/TestResponse.swift on lines 188..202

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

                                  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 testResponseNoEndOrNext() {
                                          performServerTest(router) { expectation in
                                              self.performRequest("get", path:"/noEndOrNext", callback: {response in
                                                  XCTAssertEqual(response?.statusCode, HTTPStatusCode.OK, "HTTP Status code was \(String(describing: response?.statusCode))")
                                                  XCTAssertNotNil(response?.headers["Date"], "There was No Date header in the response")
                                  Severity: Major
                                  Found in Tests/KituraTests/TestResponse.swift and 1 other location - About 1 hr to fix
                                  Tests/KituraTests/TestResponse.swift on lines 204..218

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

                                  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

                                  /**
                                   * Copyright IBM Corporation 2016
                                   *
                                   * Licensed under the Apache License, Version 2.0 (the "License");
                                   * you may not use this file except in compliance with the License.
                                  Severity: Major
                                  Found in Tests/KituraTests/TestResponse.swift and 2 other locations - About 1 hr to fix
                                  Tests/KituraTests/TestStaticFileServer.swift on lines 1..710
                                  Tests/KituraTests/TestStaticFileServer.swift on lines 1..710

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

                                  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

                                          performServerTest(router) { expectation in
                                              self.performRequest("get", path: "/jsonp", callback: { response in
                                                  XCTAssertNotNil(response, "ERROR!!! ClientRequest response object was nil")
                                                  XCTAssertEqual(response?.statusCode, HTTPStatusCode.badRequest, "HTTP Status code was \(String(describing: response?.statusCode))")
                                                  expectation.fulfill()
                                  Severity: Major
                                  Found in Tests/KituraTests/TestResponse.swift and 2 other locations - About 55 mins to fix
                                  Tests/KituraTests/TestErrors.swift on lines 57..63
                                  Tests/KituraTests/TestResponse.swift on lines 885..891

                                  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

                                          performServerTest(router) { expectation in
                                              self.performRequest("get", path: "/jsonp?callback=test+fn", callback: { response in
                                                  XCTAssertNotNil(response, "ERROR!!! ClientRequest response object was nil")
                                                  XCTAssertEqual(response?.statusCode, HTTPStatusCode.badRequest, "HTTP Status code was \(String(describing: response?.statusCode))")
                                                  expectation.fulfill()
                                  Severity: Major
                                  Found in Tests/KituraTests/TestResponse.swift and 2 other locations - About 55 mins to fix
                                  Tests/KituraTests/TestErrors.swift on lines 57..63
                                  Tests/KituraTests/TestResponse.swift on lines 893..899

                                  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

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

                                          router.get("/qwer") { _, response, next in
                                              response.headers["Content-Type"] = "text/html; charset=utf-8"
                                              do {
                                                  try response.send("<!DOCTYPE html><html><body><b>Received</b></body></html>\n\n").end()
                                              } catch {
                                  Severity: Minor
                                  Found in Tests/KituraTests/TestResponse.swift and 1 other location - About 50 mins to fix
                                  Tests/KituraTests/TestBridgingHTTPStatusCode.swift on lines 63..71

                                  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.post("/sendNilString") { request, response, _ in
                                              do {
                                                  let str: String? = nil
                                                  try response.send(str).end()
                                              } catch {
                                  Severity: Minor
                                  Found in Tests/KituraTests/TestResponse.swift and 1 other location - About 50 mins to fix
                                  Tests/KituraTests/TestResponse.swift on lines 1224..1231

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

                                  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.post("/sendNonNilString") { request, response, _ in
                                              do {
                                                  let str: String? = "Test"
                                                  try response.send(str).end()
                                              } catch {
                                  Severity: Minor
                                  Found in Tests/KituraTests/TestResponse.swift and 1 other location - About 50 mins to fix
                                  Tests/KituraTests/TestResponse.swift on lines 1215..1222

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

                                  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 callbackHtml(request: RouterRequest, response: RouterResponse) {
                                              do {
                                                  try response.status(HTTPStatusCode.OK).send("<!DOCTYPE html><html><body>Hi from Kitura!</body></html>\n\n").end()
                                              } catch {}
                                  
                                  
                                  Severity: Minor
                                  Found in Tests/KituraTests/TestResponse.swift and 1 other location - About 45 mins to fix
                                  Tests/KituraTests/TestResponse.swift on lines 1376..1381

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

                                  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 callbackText(request: RouterRequest, response: RouterResponse) {
                                              do {
                                                  try response.status(HTTPStatusCode.OK).send("Hi from Kitura!").end()
                                              } catch {}
                                  
                                  
                                  Severity: Minor
                                  Found in Tests/KituraTests/TestResponse.swift and 1 other location - About 45 mins to fix
                                  Tests/KituraTests/TestResponse.swift on lines 1383..1388

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

                                  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

                                              do {
                                                  do {
                                                      try response.send(jsonp: json).end()
                                                  } catch JSONPError.invalidCallbackName {
                                                      try response.status(.badRequest).end()
                                  Severity: Minor
                                  Found in Tests/KituraTests/TestResponse.swift and 1 other location - About 45 mins to fix
                                  Tests/KituraTests/TestResponse.swift on lines 1428..1434

                                  Duplicated Code

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

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

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

                                  Tuning

                                  This issue has a mass of 54.

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

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

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

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

                                  Refactorings

                                  Further Reading

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

                                              do {
                                                  do {
                                                      try response.send(jsonp: json).end()
                                                  } catch JSONPError.invalidCallbackName {
                                                      try response.status(.badRequest).end()
                                  Severity: Minor
                                  Found in Tests/KituraTests/TestResponse.swift and 1 other location - About 45 mins to fix
                                  Tests/KituraTests/TestResponse.swift on lines 1455..1461

                                  Duplicated Code

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

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

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

                                  Tuning

                                  This issue has a mass of 54.

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

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

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

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

                                  Refactorings

                                  Further Reading

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

                                          performServerTest(router, asyncTasks: { expectation in
                                              self.performRequest("get", path: "/code_unknown_to_ok", callback: { response in
                                                  XCTAssertNotNil(response, "ERROR!!! ClientRequest response object was nil")
                                                  XCTAssertEqual(response?.statusCode, .OK, "HTTP Status code was \(String(describing: response?.statusCode))")
                                                  expectation.fulfill()
                                  Severity: Minor
                                  Found in Tests/KituraTests/TestResponse.swift and 1 other location - About 45 mins to fix
                                  Tests/KituraTests/TestResponse.swift on lines 1135..1141

                                  Duplicated Code

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

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

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

                                  Tuning

                                  This issue has a mass of 54.

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

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

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

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

                                  Refactorings

                                  Further Reading

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

                                          { expectation in
                                              self.performRequest("get", path: "/code_notFound_no_change", callback: { response in
                                                  XCTAssertNotNil(response, "ERROR!!! ClientRequest response object was nil")
                                                  XCTAssertEqual(response?.statusCode, .notFound, "HTTP Status code was \(String(describing: response?.statusCode))")
                                                  expectation.fulfill()
                                  Severity: Minor
                                  Found in Tests/KituraTests/TestResponse.swift and 1 other location - About 45 mins to fix
                                  Tests/KituraTests/TestResponse.swift on lines 1128..1134

                                  Duplicated Code

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

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

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

                                  Tuning

                                  This issue has a mass of 54.

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

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

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

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

                                  Refactorings

                                  Further Reading

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

                                              } else if let text = requestBody.asText {
                                                  do {
                                                      response.headers["Content-Type"] = "text/html; charset=utf-8"
                                                      try response.send("<!DOCTYPE html><html><body><b>Received text body: </b>\(text)</body></html>\n\n").end()
                                                  } catch {
                                  Severity: Minor
                                  Found in Tests/KituraTests/TestResponse.swift and 2 other locations - About 35 mins to fix
                                  Tests/KituraTests/TestResponse.swift on lines 1300..1335
                                  Tests/KituraTests/TestResponse.swift on lines 1307..1335

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

                                  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

                                              } else if let urlEncoded = requestBody.asURLEncodedMultiValue {
                                                  do {
                                                      response.headers["Content-Type"] = "text/html; charset=utf-8"
                                                      try response.send("<!DOCTYPE html><html><body><b>Received URL encoded body</b><br> \(urlEncoded) </body></html>\n\n").end()
                                                  } catch {
                                  Severity: Minor
                                  Found in Tests/KituraTests/TestResponse.swift and 2 other locations - About 35 mins to fix
                                  Tests/KituraTests/TestResponse.swift on lines 1300..1335
                                  Tests/KituraTests/TestResponse.swift on lines 1314..1335

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

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

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

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

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

                                  Refactorings

                                  Further Reading

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

                                              if let urlEncoded = requestBody.asURLEncoded {
                                                  do {
                                                      response.headers["Content-Type"] = "text/html; charset=utf-8"
                                                      try response.send("<!DOCTYPE html><html><body><b>Received URL encoded body</b><br> \(urlEncoded) </body></html>\n\n").end()
                                                  } catch {
                                  Severity: Minor
                                  Found in Tests/KituraTests/TestResponse.swift and 2 other locations - About 35 mins to fix
                                  Tests/KituraTests/TestResponse.swift on lines 1307..1335
                                  Tests/KituraTests/TestResponse.swift on lines 1314..1335

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

                                  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

                                  Parameter clause in closure signature should be preceded by exactly one space
                                  Open

                                              self.performRequest("post", path: "/bodytest", callback: {response in
                                  Severity: Minor
                                  Found in Tests/KituraTests/TestResponse.swift by tailor

                                  Parameter clause in closure signature should be preceded by exactly one space
                                  Open

                                              self.performRequest("get", path:"/format", callback: {response in
                                  Severity: Minor
                                  Found in Tests/KituraTests/TestResponse.swift by tailor

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

                                          { expectation in
                                  Severity: Minor
                                  Found in Tests/KituraTests/TestResponse.swift by tailor

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

                                  Parameter clause in closure signature should be preceded by exactly one space
                                  Open

                                              self.performRequest("post", path: "/doublebodytest", callback: {response in
                                  Severity: Minor
                                  Found in Tests/KituraTests/TestResponse.swift by tailor

                                  Parameter clause in closure signature should be preceded by exactly one space
                                  Open

                                              self.performRequest("get", path: "/error", callback: {response in
                                  Severity: Minor
                                  Found in Tests/KituraTests/TestResponse.swift by tailor

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

                                          }, {
                                  Severity: Minor
                                  Found in Tests/KituraTests/TestResponse.swift by tailor

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

                                  Parameter clause in closure signature should be preceded by exactly one space
                                  Open

                                              }) {req in
                                  Severity: Minor
                                  Found in Tests/KituraTests/TestResponse.swift by tailor

                                  Parameter clause in closure signature should be preceded by exactly one space
                                  Open

                                              self.performRequest("post", path: "/bodytest", callback: {response in
                                  Severity: Minor
                                  Found in Tests/KituraTests/TestResponse.swift by tailor

                                  Parameter clause in closure signature should be preceded by exactly one space
                                  Open

                                              self.performRequest("post", path: "/multibodytest", callback: {response in
                                  Severity: Minor
                                  Found in Tests/KituraTests/TestResponse.swift by tailor

                                  Parameter clause in closure signature should be preceded by exactly one space
                                  Open

                                              }) {req in
                                  Severity: Minor
                                  Found in Tests/KituraTests/TestResponse.swift by tailor

                                  Parameter clause in closure signature should be preceded by exactly one space
                                  Open

                                              self.performRequest("get", path:"/customPage2", callback: {response in
                                  Severity: Minor
                                  Found in Tests/KituraTests/TestResponse.swift by tailor

                                  Parameter clause in closure signature should be preceded by exactly one space
                                  Open

                                              self.performRequest("get", path:"/emptyHandler", callback: {response in
                                  Severity: Minor
                                  Found in Tests/KituraTests/TestResponse.swift by tailor

                                  Parameter clause in closure signature should be preceded by exactly one space
                                  Open

                                              }) {req in
                                  Severity: Minor
                                  Found in Tests/KituraTests/TestResponse.swift by tailor

                                  Parameter clause in closure signature should be preceded by exactly one space
                                  Open

                                              self.performRequest("post", path: "/multibodytest", callback: {response in
                                  Severity: Minor
                                  Found in Tests/KituraTests/TestResponse.swift by tailor

                                  Parameter clause in closure signature should be preceded by exactly one space
                                  Open

                                              self.performRequest("get", path: "/customPage", callback: {response in
                                  Severity: Minor
                                  Found in Tests/KituraTests/TestResponse.swift by tailor

                                  Parameter clause in closure signature should be preceded by exactly one space
                                  Open

                                              self.performRequest("get", path:"/format", callback: {response in
                                  Severity: Minor
                                  Found in Tests/KituraTests/TestResponse.swift by tailor

                                  Operator definitions should be followed by exactly one space
                                  Open

                                          static func ==(lhs: SomeJSON, rhs: SomeJSON) -> Bool {
                                  Severity: Minor
                                  Found in Tests/KituraTests/TestResponse.swift by tailor

                                  Parameter clause in closure signature should be preceded by exactly one space
                                  Open

                                              self.performRequest("post", path: "/bodytest", callback: {response in
                                  Severity: Minor
                                  Found in Tests/KituraTests/TestResponse.swift by tailor

                                  Parameter clause in closure signature should be preceded by exactly one space
                                  Open

                                              }) {req in
                                  Severity: Minor
                                  Found in Tests/KituraTests/TestResponse.swift by tailor

                                  Parameter clause in closure signature should be preceded by exactly one space
                                  Open

                                              self.performRequest("get", path: "/headerTest", callback: {response in
                                  Severity: Minor
                                  Found in Tests/KituraTests/TestResponse.swift by tailor

                                  Parameter clause in closure signature should be preceded by exactly one space
                                  Open

                                              }) {req in
                                  Severity: Minor
                                  Found in Tests/KituraTests/TestResponse.swift by tailor

                                  Parameter clause in closure signature should be preceded by exactly one space
                                  Open

                                              self.performRequest("get", path:"/format", callback: {response in
                                  Severity: Minor
                                  Found in Tests/KituraTests/TestResponse.swift by tailor

                                  Parameter clause in closure signature should be preceded by exactly one space
                                  Open

                                          .post {_, response, next in
                                  Severity: Minor
                                  Found in Tests/KituraTests/TestResponse.swift by tailor

                                  Parameter clause in closure signature should be preceded by exactly one space
                                  Open

                                              self.performRequest("get", path:"/qwer", callback: {response in
                                  Severity: Minor
                                  Found in Tests/KituraTests/TestResponse.swift by tailor

                                  Parameter clause in closure signature should be preceded by exactly one space
                                  Open

                                              }) {req in
                                  Severity: Minor
                                  Found in Tests/KituraTests/TestResponse.swift by tailor

                                  Parameter clause in closure signature should be preceded by exactly one space
                                  Open

                                              self.performRequest("post", path: "/multibodytest", callback: {response in
                                  Severity: Minor
                                  Found in Tests/KituraTests/TestResponse.swift by tailor

                                  Parameter clause in closure signature should be preceded by exactly one space
                                  Open

                                              self.performRequest("get", path: "/customPage", callback: {response in
                                  Severity: Minor
                                  Found in Tests/KituraTests/TestResponse.swift by tailor

                                  Parameter clause in closure signature should be preceded by exactly one space
                                  Open

                                              }) {req in
                                  Severity: Minor
                                  Found in Tests/KituraTests/TestResponse.swift by tailor

                                  Parameter clause in closure signature should be preceded by exactly one space
                                  Open

                                              self.performRequest("get", path: "/route", callback: {response in
                                  Severity: Minor
                                  Found in Tests/KituraTests/TestResponse.swift by tailor

                                  Parameter clause in closure signature should be preceded by exactly one space
                                  Open

                                              self.performRequest("get", path:"/customPage2", callback: {response in
                                  Severity: Minor
                                  Found in Tests/KituraTests/TestResponse.swift by tailor

                                  Parameter clause in closure signature should be preceded by exactly one space
                                  Open

                                              self.performRequest("post", path: "/bodytestMultiValue", callback: {response in
                                  Severity: Minor
                                  Found in Tests/KituraTests/TestResponse.swift by tailor

                                  Parameter clause in closure signature should be preceded by exactly one space
                                  Open

                                              self.performRequest("post", path: "/multibodytest", callback: {response in
                                  Severity: Minor
                                  Found in Tests/KituraTests/TestResponse.swift by tailor

                                  Parameter clause in closure signature should be preceded by exactly one space
                                  Open

                                              }) {req in
                                  Severity: Minor
                                  Found in Tests/KituraTests/TestResponse.swift by tailor

                                  Parameter clause in closure signature should be preceded by exactly one space
                                  Open

                                              }) {req in
                                  Severity: Minor
                                  Found in Tests/KituraTests/TestResponse.swift by tailor

                                  Parameter clause in closure signature should be preceded by exactly one space
                                  Open

                                              }) {req in
                                  Severity: Minor
                                  Found in Tests/KituraTests/TestResponse.swift by tailor

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

                                          { expectation in
                                  Severity: Minor
                                  Found in Tests/KituraTests/TestResponse.swift by tailor

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

                                  Parameter clause in closure signature should be preceded by exactly one space
                                  Open

                                              self.performRequest("post", path: "/bodytesthardway", callback: {response in
                                  Severity: Minor
                                  Found in Tests/KituraTests/TestResponse.swift by tailor

                                  Parameter clause in closure signature should be preceded by exactly one space
                                  Open

                                              }) {req in
                                  Severity: Minor
                                  Found in Tests/KituraTests/TestResponse.swift by tailor

                                  Parameter clause in closure signature should be preceded by exactly one space
                                  Open

                                              self.performRequest("get", path:"/noEndOrNext", callback: {response in
                                  Severity: Minor
                                  Found in Tests/KituraTests/TestResponse.swift by tailor

                                  Parameter clause in closure signature should be preceded by exactly one space
                                  Open

                                              }) {req in
                                  Severity: Minor
                                  Found in Tests/KituraTests/TestResponse.swift by tailor

                                  Parameter clause in closure signature should be preceded by exactly one space
                                  Open

                                              }) {req in
                                  Severity: Minor
                                  Found in Tests/KituraTests/TestResponse.swift by tailor

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

                                          }, { expectation in
                                  Severity: Minor
                                  Found in Tests/KituraTests/TestResponse.swift by tailor

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

                                  Parameter clause in closure signature should be preceded by exactly one space
                                  Open

                                              }) {req in
                                  Severity: Minor
                                  Found in Tests/KituraTests/TestResponse.swift by tailor

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

                                          }, { expectation in
                                  Severity: Minor
                                  Found in Tests/KituraTests/TestResponse.swift by tailor

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

                                  Parameter clause in closure signature should be preceded by exactly one space
                                  Open

                                              self.performRequest("get", path: "/redirect", callback: {response in
                                  Severity: Minor
                                  Found in Tests/KituraTests/TestResponse.swift by tailor

                                  Parameter clause in closure signature should be preceded by exactly one space
                                  Open

                                              self.performRequest("post", path: "/route", callback: {response in
                                  Severity: Minor
                                  Found in Tests/KituraTests/TestResponse.swift by tailor

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

                                          }, { expectation in
                                  Severity: Minor
                                  Found in Tests/KituraTests/TestResponse.swift by tailor

                                  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