XYOracleNetwork/sdk-xyo-swift

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

Summary

Maintainability
D
3 days
Test Coverage

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

import PromisesTestHelpers
import XCTest
@testable import Promises

class PromiseAnyTests: XCTestCase {

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

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

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

        func testPromiseAnyHeterogeneous3Reject() {
          // Arrange.
          let expectedValuesAndErrors = (Maybe(42), Maybe<String>(Test.Error.code42), Maybe(Int?.none))
          let promise1 = Promise { fulfill, _ in
            Test.delay(0.1) {

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

          func testPromiseAnyRejectFirst() {
            // Arrange.
            let expectedValuesAndErrors = [Maybe(42), Maybe(Test.Error.code42)]
            let promise1 = Promise<Int> { fulfill, _ in
              Test.delay(1) {
        Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AnyTests.swift on lines 89..113

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

        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 testPromiseAnyRejectLast() {
            // Arrange.
            let expectedValuesAndErrors = [Maybe(42), Maybe(Test.Error.code42)]
            let promise1 = Promise<Int> { fulfill, _ in
              Test.delay(0.1) {
        Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AnyTests.swift on lines 63..87

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

        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 testPromiseAnyEmpty() {
            // Act.
            let promise = any([Promise<Any>]()).then { value in
              XCTAssert(value.isEmpty)
            }
        Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AllTests.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 3 locations. Consider refactoring.
        Open

            let combinedPromise = any(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+AllTests.swift on lines 243..247
        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 3 locations. Consider refactoring.
        Open

            let combinedPromise = any(promise1, promise2, promise3).then { number, error, none in
              XCTAssert(number == expectedValuesAndErrors.0)
              XCTAssert(error == expectedValuesAndErrors.1)
              XCTAssert(none == expectedValuesAndErrors.2)
            }
        Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AllTests.swift on lines 243..247
        Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AnyTests.swift on lines 299..303

        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 = any(promise1, promise2, promise3)
              weakExtendedPromise2 = any(promise1, promise2, promise3)
        Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AllTests.swift on lines 298..305

        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 = any(promise1, promise2)
              weakExtendedPromise2 = any(promise1, promise2)
        Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AllTests.swift on lines 202..209

        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 = any([promise])
              weakExtendedPromise2 = any([promise])
        Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AllTests.swift on lines 122..129
        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

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

        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

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

        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 = any(promise1, promise2, promise3).then { _, _, _ in
              XCTFail()
            }.catch { error in
              XCTAssertTrue(error == Test.Error.code42)
            }
        Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AllTests.swift on lines 277..281

        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 = any(promise1, promise2).then { _, _ in
              XCTFail()
            }.catch { error in
              XCTAssertTrue(error == Test.Error.code42)
            }
        Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AllTests.swift on lines 182..186

        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<(Maybe<Int>, Maybe<String>)>?
        Carthage/Checkouts/promises/Tests/PromisesTests/Promise+AnyTests.swift on lines 255..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 43.

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

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

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

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

        Refactorings

        Further Reading

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

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

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 43.

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

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

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

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

        Refactorings

        Further Reading

        Similar blocks of code found in 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 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+AllTests.swift on lines 379..383
        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+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 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+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 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 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 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+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

        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