XYOracleNetwork/sdk-xyo-swift

View on GitHub
Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AllTests.swift

Summary

Maintainability
D
3 days
Test Coverage

File Promise+AllTests.swift has 331 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import PromisesTestHelpers
import XCTest
@testable import Promises

class PromiseAllTests: XCTestCase {

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

      func testPromiseAllHeterogeneous4() {
        // Arrange.
        let expectedValues = (42, "hello world", Int?.none, 2.4)
        let promise1 = Promise<Int> { fulfill, _ in
          Test.delay(0.1) {

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

        func testPromiseAllHeterogeneous4Reject() {
          // Arrange.
          let promise1 = Promise { fulfill, _ in
            Test.delay(0.1) {
              fulfill(42)

        Function testPromiseAllHeterogeneous3 has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          func testPromiseAllHeterogeneous3() {
            // Arrange.
            let expectedValues = (42, "hello world", Int?.none)
            let promise1 = Promise<Int> { fulfill, _ in
              Test.delay(0.1) {

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

            func testPromiseAllRejectLast() {
              // Arrange.
              let promise1 = Promise { fulfill, _ in
                Test.delay(0.1) {
                  fulfill(42)
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AllTests.swift on lines 63..87
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+RaceTests.swift on lines 54..78

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

          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 testPromiseAllRejectFirst() {
              // Arrange.
              let promise1 = Promise { fulfill, _ in
                Test.delay(1) {
                  fulfill(42)
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AllTests.swift on lines 89..113
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+RaceTests.swift on lines 54..78

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

          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 testPromiseAllEmpty() {
              // Act.
              let promise = all([Promise<Any>]()).then { value in
                XCTAssert(value.isEmpty)
              }
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AnyTests.swift on lines 51..61

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

          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

              autoreleasepool {
                XCTAssertNil(weakExtendedPromise1)
                XCTAssertNil(weakExtendedPromise2)
                weakExtendedPromise1 = all(promise1, promise2, promise3)
                weakExtendedPromise2 = all(promise1, promise2, promise3)
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AnyTests.swift on lines 389..396

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

          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

              let combinedPromise = all(promise1, promise2, promise3).then { number, string, none in
                XCTAssert(number == expectedValues.0)
                XCTAssert(string == expectedValues.1)
                XCTAssert(none == expectedValues.2)
              }
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AnyTests.swift on lines 299..303
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AnyTests.swift on lines 334..338

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

          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

              autoreleasepool {
                XCTAssertNil(weakExtendedPromise1)
                XCTAssertNil(weakExtendedPromise2)
                weakExtendedPromise1 = all(promise1, promise2)
                weakExtendedPromise2 = all(promise1, promise2)
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AnyTests.swift on lines 258..265

          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

              autoreleasepool {
                XCTAssertNil(weakExtendedPromise1)
                XCTAssertNil(weakExtendedPromise2)
                weakExtendedPromise1 = all([promise])
                weakExtendedPromise2 = all([promise])
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AnyTests.swift on lines 148..155
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+RaceTests.swift on lines 111..118

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

          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

              let combinedPromise = all(promise1, promise2, promise3).then { _ in
                XCTFail()
              }.catch { error in
                XCTAssertTrue(error == Test.Error.code42)
              }
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AnyTests.swift on lines 368..372

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 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

              let combinedPromise = all(promise1, promise2).then { _ in
                XCTFail()
              }.catch { error in
                XCTAssertTrue(error == Test.Error.code42)
              }
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AnyTests.swift on lines 238..242

          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

              weak var weakExtendedPromise1: Promise<(Int, String, Int?, Double)>?
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AllTests.swift on lines 410..410

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 45.

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

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

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

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

          Refactorings

          Further Reading

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

              weak var weakExtendedPromise2: Promise<(Int, String, Int?, Double)>?
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AllTests.swift on lines 409..409

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 45.

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

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

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

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

          Refactorings

          Further Reading

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

              let promise1 = Promise<Int?> { fulfill, _ in
                Test.delay(0.1) {
                  fulfill(42)
                }
              }
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AllTests.swift on lines 28..32
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AllTests.swift on lines 33..37
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AllTests.swift on lines 236..240
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AllTests.swift on lines 270..274
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AllTests.swift on lines 333..337
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AllTests.swift on lines 379..383
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AnyTests.swift on lines 23..27
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AnyTests.swift on lines 28..32
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AnyTests.swift on lines 33..37
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AnyTests.swift on lines 292..296
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AnyTests.swift on lines 327..331

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

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

              let promise3 = Promise<Int?> { fulfill, _ in
                Test.delay(2) {
                  fulfill(nil)
                }
              }
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AllTests.swift on lines 23..27
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AllTests.swift on lines 28..32
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AllTests.swift on lines 236..240
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AllTests.swift on lines 270..274
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AllTests.swift on lines 333..337
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AllTests.swift on lines 379..383
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AnyTests.swift on lines 23..27
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AnyTests.swift on lines 28..32
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AnyTests.swift on lines 33..37
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AnyTests.swift on lines 292..296
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AnyTests.swift on lines 327..331

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

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

              let promise3 = Promise<Int?> { fulfill, _ in
                Test.delay(2) {
                  fulfill(nil)
                }
              }
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AllTests.swift on lines 23..27
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AllTests.swift on lines 28..32
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AllTests.swift on lines 33..37
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AllTests.swift on lines 236..240
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AllTests.swift on lines 270..274
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AllTests.swift on lines 379..383
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AnyTests.swift on lines 23..27
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AnyTests.swift on lines 28..32
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AnyTests.swift on lines 33..37
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AnyTests.swift on lines 292..296
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AnyTests.swift on lines 327..331

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

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

              let promise3 = Promise<Int?> { fulfill, _ in
                Test.delay(2) {
                  fulfill(nil)
                }
              }
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AllTests.swift on lines 23..27
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AllTests.swift on lines 28..32
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AllTests.swift on lines 33..37
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AllTests.swift on lines 236..240
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AllTests.swift on lines 333..337
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AllTests.swift on lines 379..383
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AnyTests.swift on lines 23..27
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AnyTests.swift on lines 28..32
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AnyTests.swift on lines 33..37
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AnyTests.swift on lines 292..296
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AnyTests.swift on lines 327..331

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

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

              let promise3 = Promise<Int?> { fulfill, _ in
                Test.delay(2) {
                  fulfill(nil)
                }
              }
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AllTests.swift on lines 23..27
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AllTests.swift on lines 28..32
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AllTests.swift on lines 33..37
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AllTests.swift on lines 236..240
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AllTests.swift on lines 270..274
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AllTests.swift on lines 333..337
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AnyTests.swift on lines 23..27
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AnyTests.swift on lines 28..32
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AnyTests.swift on lines 33..37
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AnyTests.swift on lines 292..296
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AnyTests.swift on lines 327..331

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

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

              let promise3 = Promise<Int?> { fulfill, _ in
                Test.delay(2) {
                  fulfill(nil)
                }
              }
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AllTests.swift on lines 23..27
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AllTests.swift on lines 28..32
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AllTests.swift on lines 33..37
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AllTests.swift on lines 270..274
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AllTests.swift on lines 333..337
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AllTests.swift on lines 379..383
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AnyTests.swift on lines 23..27
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AnyTests.swift on lines 28..32
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AnyTests.swift on lines 33..37
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AnyTests.swift on lines 292..296
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AnyTests.swift on lines 327..331

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

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

              let promise2 = Promise<Int?> { fulfill, _ in
                Test.delay(1) {
                  fulfill(13)
                }
              }
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AllTests.swift on lines 23..27
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AllTests.swift on lines 33..37
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AllTests.swift on lines 236..240
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AllTests.swift on lines 270..274
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AllTests.swift on lines 333..337
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AllTests.swift on lines 379..383
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AnyTests.swift on lines 23..27
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AnyTests.swift on lines 28..32
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AnyTests.swift on lines 33..37
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AnyTests.swift on lines 292..296
          Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AnyTests.swift on lines 327..331

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

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

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

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

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

          Refactorings

          Further Reading

          There are no issues that match your filters.

          Category
          Status