IBM-Swift/Kitura

View on GitHub

Showing 850 of 850 total issues

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 78.

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

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

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

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

Refactorings

Further Reading

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

    static var allTests: [(String, (TestSubrouter) -> () throws -> Void)] {
        return [
            ("testSimpleSub", testSimpleSub),
            ("testExternSub", testExternSub),
            ("testSubSubs", testSubSubs),
Severity: Major
Found in Tests/KituraTests/TestSubrouter.swift and 1 other location - About 1 hr to fix
Tests/KituraTests/TestCookies.swift on lines 44..52

Duplicated Code

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

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

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

Tuning

This issue has a mass of 78.

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

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

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

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

Refactorings

Further Reading

Function Input has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        function Input(o, www) {
            var id;
            o = o || {};
            if (!o.input) {
                $.error("input is missing");
Severity: Minor
Found in docs/js/typeahead.jquery.js - About 1 hr to fix

    Function testCodablePostSuccessStatuses has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        func testCodablePostSuccessStatuses() {
            // Test POST success statuses other than .created
            router.post("/ok") { (user: User, respondWith: (User?, RequestError?) -> Void) in
                print("POST on /ok for user \(user)")
                respondWith(user, .ok)
    Severity: Minor
    Found in Tests/KituraTests/TestCodableRouter.swift - About 1 hr to fix

      Function Input has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              function Input(o, www) {
                  var id;
                  o = o || {};
                  if (!o.input) {
                      $.error("input is missing");

        Function combinedRanges has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            static func combinedRanges(ranges: [Range<UInt64>]) -> [Range<UInt64>] {
        
                // map [Range]s to [IndexedRange]s and sort them by range.lowerBound
                var index = 0
                var ordered = ranges.map { range in
        Severity: Minor
        Found in Sources/Kitura/staticFileServer/RangeHeader.swift - About 1 hr to fix

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

                  buildServerTest(router, timeout: 30)
          
                      .request("post", path: "/noBody", data: user)
                      .hasStatus(.created)
                      .hasHeader("Location", only: "1")
          Severity: Major
          Found in Tests/KituraTests/TestCodableRouter.swift and 1 other location - About 1 hr to fix
          Tests/KituraTests/TestCodableRouter.swift on lines 507..518

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 77.

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

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

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

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

          Refactorings

          Further Reading

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

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

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 77.

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

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

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

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

          Refactorings

          Further Reading

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

                  buildServerTest(router, timeout: 30)
          
                      .request("post", path: "/noBody", data: user)
                      .hasStatus(.noContent)
                      .hasHeader("Location", only: "1")
          Severity: Major
          Found in Tests/KituraTests/TestCodableRouter.swift and 1 other location - About 1 hr to fix
          Tests/KituraTests/TestCodableRouter.swift on lines 534..545

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 77.

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

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

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

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

          Refactorings

          Further Reading

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

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

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 77.

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

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

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

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

          Refactorings

          Further Reading

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

              func testShouldParseStringWithSomeInvalidRanges() {
                  let range = parse(200, "bytes=0-499,1000-,500-999")
                  XCTAssertEqual(range?.type, "bytes")
                  XCTAssertEqual(range?.ranges.count, 1)
                  XCTAssertEqual(range?.ranges[0], 0..<199)
          Severity: Major
          Found in Tests/KituraTests/TestRangeHeader.swift and 9 other locations - About 1 hr to fix
          Tests/KituraTests/TestRangeHeader.swift on lines 87..92
          Tests/KituraTests/TestRangeHeader.swift on lines 94..99
          Tests/KituraTests/TestRangeHeader.swift on lines 101..106
          Tests/KituraTests/TestRangeHeader.swift on lines 108..113
          Tests/KituraTests/TestRangeHeader.swift on lines 115..120
          Tests/KituraTests/TestRangeHeader.swift on lines 122..127
          Tests/KituraTests/TestRangeHeader.swift on lines 129..134
          Tests/KituraTests/TestRangeHeader.swift on lines 136..141
          Tests/KituraTests/TestRangeHeader.swift on lines 159..164

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

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

              func testParseString() {
                  let range = parse(1000, "bytes=0-499")
                  XCTAssertEqual(range?.type, "bytes")
                  XCTAssertEqual(range?.ranges.count, 1)
                  XCTAssertEqual(range?.ranges[0], 0..<499)
          Severity: Major
          Found in Tests/KituraTests/TestRangeHeader.swift and 9 other locations - About 1 hr to fix
          Tests/KituraTests/TestRangeHeader.swift on lines 94..99
          Tests/KituraTests/TestRangeHeader.swift on lines 101..106
          Tests/KituraTests/TestRangeHeader.swift on lines 108..113
          Tests/KituraTests/TestRangeHeader.swift on lines 115..120
          Tests/KituraTests/TestRangeHeader.swift on lines 122..127
          Tests/KituraTests/TestRangeHeader.swift on lines 129..134
          Tests/KituraTests/TestRangeHeader.swift on lines 136..141
          Tests/KituraTests/TestRangeHeader.swift on lines 152..157
          Tests/KituraTests/TestRangeHeader.swift on lines 159..164

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

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

              func testShouldParseStringWithOnlyStart() {
                  let range = parse(1000, "bytes=400-")
                  XCTAssertEqual(range?.type, "bytes")
                  XCTAssertEqual(range?.ranges.count, 1)
                  XCTAssertEqual(range?.ranges[0], 400..<999)
          Severity: Major
          Found in Tests/KituraTests/TestRangeHeader.swift and 9 other locations - About 1 hr to fix
          Tests/KituraTests/TestRangeHeader.swift on lines 87..92
          Tests/KituraTests/TestRangeHeader.swift on lines 94..99
          Tests/KituraTests/TestRangeHeader.swift on lines 101..106
          Tests/KituraTests/TestRangeHeader.swift on lines 108..113
          Tests/KituraTests/TestRangeHeader.swift on lines 122..127
          Tests/KituraTests/TestRangeHeader.swift on lines 129..134
          Tests/KituraTests/TestRangeHeader.swift on lines 136..141
          Tests/KituraTests/TestRangeHeader.swift on lines 152..157
          Tests/KituraTests/TestRangeHeader.swift on lines 159..164

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

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

              func testShouldParseStringAskingForLastByte() {
                  let range = parse(1000, "bytes=-1")
                  XCTAssertEqual(range?.type, "bytes")
                  XCTAssertEqual(range?.ranges.count, 1)
                  XCTAssertEqual(range?.ranges[0], 999..<999)
          Severity: Major
          Found in Tests/KituraTests/TestRangeHeader.swift and 9 other locations - About 1 hr to fix
          Tests/KituraTests/TestRangeHeader.swift on lines 87..92
          Tests/KituraTests/TestRangeHeader.swift on lines 94..99
          Tests/KituraTests/TestRangeHeader.swift on lines 101..106
          Tests/KituraTests/TestRangeHeader.swift on lines 108..113
          Tests/KituraTests/TestRangeHeader.swift on lines 115..120
          Tests/KituraTests/TestRangeHeader.swift on lines 122..127
          Tests/KituraTests/TestRangeHeader.swift on lines 129..134
          Tests/KituraTests/TestRangeHeader.swift on lines 152..157
          Tests/KituraTests/TestRangeHeader.swift on lines 159..164

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

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

              func testShouldParseStringWithOnlyEnd() {
                  let range = parse(1000, "bytes=-400")
                  XCTAssertEqual(range?.type, "bytes")
                  XCTAssertEqual(range?.ranges.count, 1)
                  XCTAssertEqual(range?.ranges[0], 600..<999)
          Severity: Major
          Found in Tests/KituraTests/TestRangeHeader.swift and 9 other locations - About 1 hr to fix
          Tests/KituraTests/TestRangeHeader.swift on lines 87..92
          Tests/KituraTests/TestRangeHeader.swift on lines 94..99
          Tests/KituraTests/TestRangeHeader.swift on lines 101..106
          Tests/KituraTests/TestRangeHeader.swift on lines 115..120
          Tests/KituraTests/TestRangeHeader.swift on lines 122..127
          Tests/KituraTests/TestRangeHeader.swift on lines 129..134
          Tests/KituraTests/TestRangeHeader.swift on lines 136..141
          Tests/KituraTests/TestRangeHeader.swift on lines 152..157
          Tests/KituraTests/TestRangeHeader.swift on lines 159..164

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

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

              func testShouldParseNormalString() {
                  let range = parse(1000, "bytes=40-80")
                  XCTAssertEqual(range?.type, "bytes")
                  XCTAssertEqual(range?.ranges.count, 1)
                  XCTAssertEqual(range?.ranges[0], 40..<80)
          Severity: Major
          Found in Tests/KituraTests/TestRangeHeader.swift and 9 other locations - About 1 hr to fix
          Tests/KituraTests/TestRangeHeader.swift on lines 87..92
          Tests/KituraTests/TestRangeHeader.swift on lines 94..99
          Tests/KituraTests/TestRangeHeader.swift on lines 108..113
          Tests/KituraTests/TestRangeHeader.swift on lines 115..120
          Tests/KituraTests/TestRangeHeader.swift on lines 122..127
          Tests/KituraTests/TestRangeHeader.swift on lines 129..134
          Tests/KituraTests/TestRangeHeader.swift on lines 136..141
          Tests/KituraTests/TestRangeHeader.swift on lines 152..157
          Tests/KituraTests/TestRangeHeader.swift on lines 159..164

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

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

              func testShouldCapEndAtSize() {
                  let range = parse(200, "bytes=0-499")
                  XCTAssertEqual(range?.type, "bytes")
                  XCTAssertEqual(range?.ranges.count, 1)
                  XCTAssertEqual(range?.ranges[0], 0..<199)
          Severity: Major
          Found in Tests/KituraTests/TestRangeHeader.swift and 9 other locations - About 1 hr to fix
          Tests/KituraTests/TestRangeHeader.swift on lines 87..92
          Tests/KituraTests/TestRangeHeader.swift on lines 101..106
          Tests/KituraTests/TestRangeHeader.swift on lines 108..113
          Tests/KituraTests/TestRangeHeader.swift on lines 115..120
          Tests/KituraTests/TestRangeHeader.swift on lines 122..127
          Tests/KituraTests/TestRangeHeader.swift on lines 129..134
          Tests/KituraTests/TestRangeHeader.swift on lines 136..141
          Tests/KituraTests/TestRangeHeader.swift on lines 152..157
          Tests/KituraTests/TestRangeHeader.swift on lines 159..164

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

          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(customRouter) { expectation in
                      self.performRequest("get", path: "/rawget", callback: { response in
                          if let response = response, let responseString = try? response.readString() {
                              XCTAssertEqual(responseString, "{\"date\":540899256}")
                          } else {
          Severity: Major
          Found in Tests/KituraTests/TestCustomCoders.swift and 1 other location - About 1 hr to fix
          Tests/KituraTests/TestCustomCoders.swift on lines 214..223

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

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

              func testShouldParseNonBytesRange() {
                  let range = parse(1000, "items=0-5")
                  XCTAssertEqual(range?.type, "items")
                  XCTAssertEqual(range?.ranges.count, 1)
                  XCTAssertEqual(range?.ranges[0], 0..<5)
          Severity: Major
          Found in Tests/KituraTests/TestRangeHeader.swift and 9 other locations - About 1 hr to fix
          Tests/KituraTests/TestRangeHeader.swift on lines 87..92
          Tests/KituraTests/TestRangeHeader.swift on lines 94..99
          Tests/KituraTests/TestRangeHeader.swift on lines 101..106
          Tests/KituraTests/TestRangeHeader.swift on lines 108..113
          Tests/KituraTests/TestRangeHeader.swift on lines 115..120
          Tests/KituraTests/TestRangeHeader.swift on lines 122..127
          Tests/KituraTests/TestRangeHeader.swift on lines 129..134
          Tests/KituraTests/TestRangeHeader.swift on lines 136..141
          Tests/KituraTests/TestRangeHeader.swift on lines 152..157

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

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

              func testShouldParseStringWithBytesEqualZeroZero() {
                  let range = parse(1000, "bytes=0-0")
                  XCTAssertEqual(range?.type, "bytes")
                  XCTAssertEqual(range?.ranges.count, 1)
                  XCTAssertEqual(range?.ranges[0], 0..<0)
          Severity: Major
          Found in Tests/KituraTests/TestRangeHeader.swift and 9 other locations - About 1 hr to fix
          Tests/KituraTests/TestRangeHeader.swift on lines 87..92
          Tests/KituraTests/TestRangeHeader.swift on lines 94..99
          Tests/KituraTests/TestRangeHeader.swift on lines 101..106
          Tests/KituraTests/TestRangeHeader.swift on lines 108..113
          Tests/KituraTests/TestRangeHeader.swift on lines 115..120
          Tests/KituraTests/TestRangeHeader.swift on lines 122..127
          Tests/KituraTests/TestRangeHeader.swift on lines 136..141
          Tests/KituraTests/TestRangeHeader.swift on lines 152..157
          Tests/KituraTests/TestRangeHeader.swift on lines 159..164

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

          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

          Severity
          Category
          Status
          Source
          Language