IBM-Swift/Kitura

View on GitHub
Tests/KituraTests/TestRequests.swift

Summary

Maintainability
F
3 days
Test Coverage

File TestRequests.swift has 344 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import XCTest
import Foundation
import KituraContracts

@testable import Kitura
Severity: Minor
Found in Tests/KituraTests/TestRequests.swift - About 4 hrs to fix

    Function testQueryParameters has 73 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        func testQueryParameters() {
            // Set up router for this test
            let router = Router()
    
            struct Params: QueryParams {
    Severity: Major
    Found in Tests/KituraTests/TestRequests.swift - About 2 hrs to fix

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

          func testQueryParameters() {
              // Set up router for this test
              let router = Router()
      
              struct Params: QueryParams {
      Severity: Minor
      Found in Tests/KituraTests/TestRequests.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 testParameters has 58 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          func testParameters() {
              let router = Router()
      
              router.parameter("user") { request, response, value, next in
                  XCTAssertNotNil(value)
      Severity: Major
      Found in Tests/KituraTests/TestRequests.swift - About 2 hrs to fix

        Function testParameterExit has 46 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            func testParameterExit() {
                let router = Router()
        
                router.parameter("id") { request, response, value, next in
                    XCTAssertNotNil(value)
        Severity: Minor
        Found in Tests/KituraTests/TestRequests.swift - About 1 hr to fix

          Function testMultipleParametersMultipleHandlers has 44 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              func testMultipleParametersMultipleHandlers() {
                  let router = Router()
          
                  router.parameter(["id"], handlers: [
                      { request, response, value, next in
          Severity: Minor
          Found in Tests/KituraTests/TestRequests.swift - About 1 hr to fix

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

                func testParameterExit() {
                    let router = Router()
            
                    router.parameter("id") { request, response, value, next in
                        XCTAssertNotNil(value)
            Severity: Minor
            Found in Tests/KituraTests/TestRequests.swift - About 1 hr to fix

            Cognitive Complexity

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

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

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

            Further reading

            Avoid too many return statements within this function.
            Open

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

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

                      router.get("/item/:id") { request, response, next in
                          response.status(.OK)
                          XCTAssertTrue(request.userInfo["handler1"] as? Bool ?? false)
                          XCTAssertTrue(request.userInfo["handler2"] as? Bool ?? false)
                          XCTAssertNil(request.userInfo["handler3"])
              Severity: Major
              Found in Tests/KituraTests/TestRequests.swift and 1 other location - About 1 hr to fix
              Tests/KituraTests/TestRequests.swift on lines 351..358

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

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

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

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

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

              Refactorings

              Further Reading

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

                      router.get("/user/:name") { request, response, next in
                          response.status(.OK)
                          XCTAssertTrue(request.userInfo["handler3"] as? Bool ?? false)
                          XCTAssertTrue(request.userInfo["handler4"] as? Bool ?? false)
                          XCTAssertNil(request.userInfo["handler1"])
              Severity: Major
              Found in Tests/KituraTests/TestRequests.swift and 1 other location - About 1 hr to fix
              Tests/KituraTests/TestRequests.swift on lines 342..349

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

              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.parameter("user") { request, response, value, next in
                          XCTAssertNotNil(value)
                          XCTAssertEqual(request.parameters["user"], value)
                          XCTAssertNil(response.headers["User"])
              
              
              Severity: Minor
              Found in Tests/KituraTests/TestRequests.swift and 1 other location - About 50 mins to fix
              Tests/KituraTests/TestRequests.swift on lines 229..237

              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.parameter(["id"]) { request, response, value, next in
                          XCTAssertNotNil(value)
                          XCTAssertEqual(request.parameters["id"], value)
                          XCTAssertNil(response.headers["User-Id"])
              
              
              Severity: Minor
              Found in Tests/KituraTests/TestRequests.swift and 1 other location - About 50 mins to fix
              Tests/KituraTests/TestRequests.swift on lines 219..227

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

                      router.parameter(["name"], handlers: [
                          { request, response, value, next in
                              request.userInfo["handler3"] = true
                              next()
                          },
              Severity: Major
              Found in Tests/KituraTests/TestRequests.swift and 2 other locations - About 45 mins to fix
              Tests/KituraTests/TestRequests.swift on lines 295..303
              Tests/KituraTests/TestRequests.swift on lines 322..330

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

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

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

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

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

              Refactorings

              Further Reading

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

                      router.parameter(["id"], handlers: [
                          { request, response, value, next in
                              request.userInfo["handler1"] = true
                              next()
                          },
              Severity: Major
              Found in Tests/KituraTests/TestRequests.swift and 2 other locations - About 45 mins to fix
              Tests/KituraTests/TestRequests.swift on lines 322..330
              Tests/KituraTests/TestRequests.swift on lines 332..340

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

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

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

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

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

              Refactorings

              Further Reading

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

                      router.parameter(["id"], handlers: [
                          { request, response, value, next in
                              request.userInfo["handler1"] = true
                              next()
                          },
              Severity: Major
              Found in Tests/KituraTests/TestRequests.swift and 2 other locations - About 45 mins to fix
              Tests/KituraTests/TestRequests.swift on lines 295..303
              Tests/KituraTests/TestRequests.swift on lines 332..340

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

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

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

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

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

              Refactorings

              Further Reading

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

                      router.get("users/:user/:id") { request, response, next in
                          XCTAssertNotNil(request.parameters["user"])
                          XCTAssertNotNil(request.parameters["id"])
                          response.status(.OK)
                          next()
              Severity: Minor
              Found in Tests/KituraTests/TestRequests.swift and 1 other location - About 45 mins to fix
              Tests/KituraTests/TestRequests.swift on lines 250..255

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

              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

                      subrouter.get("/:post/:id") { request, response, next in
                          XCTAssertNotNil(request.parameters["post"])
                          XCTAssertNotNil(request.parameters["id"])
                          response.status(.OK)
                          next()
              Severity: Minor
              Found in Tests/KituraTests/TestRequests.swift and 1 other location - About 45 mins to fix
              Tests/KituraTests/TestRequests.swift on lines 240..245

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

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

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

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

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

              Refactorings

              Further Reading

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

                      router.get("/user/:id") { request, response, next in
                          let id = request.parameters["id"]
                          XCTAssertNotNil(id, "URL parameter 'id' in middleware handler was nil")
                          XCTAssertEqual("my_custom_id", id, "URL parameter 'id' in middleware handler was wrong")
                          response.status(.OK)
              Severity: Minor
              Found in Tests/KituraTests/TestRequests.swift and 1 other location - About 40 mins to fix
              Tests/KituraTests/TestRequests.swift on lines 163..169

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

              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

                          for (key, value) in expectedQueryParams {
                              guard let v = request.queryParametersMultiValues[key] else {
                                  XCTFail("Query parameter \(key) was nil!")
                                  return
                              }
              Severity: Minor
              Found in Tests/KituraTests/TestRequests.swift and 1 other location - About 40 mins to fix
              Tests/KituraTests/TestRequests.swift on lines 115..121

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

              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 handle(request: RouterRequest, response: RouterResponse, next: @escaping () -> Void) {
                              let id = request.parameters["id"]
                              XCTAssertNotNil(id, "URL parameter 'id' in custom middleware was nil")
                              XCTAssertEqual("my_custom_id", id, "URL parameter 'id' in custom middleware was wrong")
                              response.status(.OK)
              Severity: Minor
              Found in Tests/KituraTests/TestRequests.swift and 1 other location - About 40 mins to fix
              Tests/KituraTests/TestRequests.swift on lines 175..181

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

              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

                          for (key, value) in expectedQueryParams {
                              guard let v = request.queryParameters[key] else {
                                  XCTFail("Query parameter \(key) was nil!")
                                  return
                              }
              Severity: Minor
              Found in Tests/KituraTests/TestRequests.swift and 1 other location - About 40 mins to fix
              Tests/KituraTests/TestRequests.swift on lines 130..136

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

              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

                              do {
                                  let body = try response?.readString()
                                  XCTAssertNotNil(body)
                                  XCTAssertEqual(body, "success")
                              } catch {
              Severity: Minor
              Found in Tests/KituraTests/TestRequests.swift and 1 other location - About 35 mins to fix
              Tests/KituraTests/TestRequests.swift on lines 402..408

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 44.

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

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

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

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

              Refactorings

              Further Reading

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

                              do {
                                  let body = try response?.readString()
                                  XCTAssertNotNil(body)
                                  XCTAssertEqual(body, "1000")
                              } catch {
              Severity: Minor
              Found in Tests/KituraTests/TestRequests.swift and 1 other location - About 35 mins to fix
              Tests/KituraTests/TestRequests.swift on lines 279..285

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 44.

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

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

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

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

              Refactorings

              Further Reading

              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/TestRequests.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 })

              Parentheses content should not end with whitespace
              Open

                          XCTAssert(parsedParams.key1 == "value1" && parsedParams.key2 == "value2" && parsedParams.key3 == ["value3.1","value3.2","value3.3"] )
              Severity: Minor
              Found in Tests/KituraTests/TestRequests.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/TestRequests.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 })

              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/TestRequests.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 })

              Parentheses content should not end with whitespace
              Open

                          XCTAssert(parsedParams.key1 == "value1" && parsedParams.key2 == "value2" && parsedParams.key3 == "value3" )
              Severity: Minor
              Found in Tests/KituraTests/TestRequests.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/TestRequests.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