sabirvirtuoso/Mockit

View on GitHub

Showing 148 of 148 total issues

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

  func testCallingStubByChainingDifferentActionablesIncludingMultipleThenReturn() {
    // Given
    let sut = stub

    let functionName = "func"
Severity: Minor
Found in Example/Tests/StubTests.swift - About 1 hr to fix

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

      func testCallingStubOnceWithNonOptionalArgumentsReturnsValueByPerformingActionsOnSuccessfulStubMatching() {
        // Given
        let _ = mockImplementation.when().call(withReturnValue: mockImplementation.doSomethingWithNonOptionalArguments("one", arg2: 1)).thenReturn(42)
    
        // When
    Severity: Major
    Found in Example/Tests/CallHandlerTests.swift and 1 other location - About 1 hr to fix
    Example/Tests/CallHandlerTests.swift on lines 163..172

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

    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 testCallingStubReturnsDefaultValueOnUnsuccessfulStubMatching() {
        // Given
        let _ = mockImplementation.when().call(withReturnValue: mockImplementation.doSomethingWithNonOptionalArguments("one", arg2: 1)).thenReturn(42)
    
        // When
    Severity: Major
    Found in Example/Tests/CallHandlerTests.swift and 1 other location - About 1 hr to fix
    Example/Tests/CallHandlerTests.swift on lines 99..108

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

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

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

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

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

    Refactorings

    Further Reading

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

      fileprivate func match<T: Any>(_ array: Array<T>, withArray: Array<T>) -> Bool {
        guard array.count == withArray.count else {
          return false
        }
    
    
    Severity: Minor
    Found in Mockit/Classes/TypeMatcher.swift and 1 other location - About 1 hr to fix
    Mockit/Classes/TypeMatcher.swift on lines 146..154

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

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

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

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

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

    Refactorings

    Further Reading

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

      fileprivate func match<T: Any>(_ array: Array<T?>, withArray: Array<T?>) -> Bool {
        guard array.count == withArray.count else {
          return false
        }
    
    
    Severity: Minor
    Found in Mockit/Classes/TypeMatcher.swift and 1 other location - About 1 hr to fix
    Mockit/Classes/TypeMatcher.swift on lines 183..191

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

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

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

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

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

    Refactorings

    Further Reading

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

        let actionable = sut?.call(withReturnValue: dummyReturnValue).thenAnswer {
          (args: [Any?]) -> Int in
    
          return (args[0] as! Int) * 2
        }
    Severity: Minor
    Found in Example/Tests/StubTests.swift and 1 other location - About 55 mins to fix
    Example/Tests/StubTests.swift on lines 683..687

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

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

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

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

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

    Refactorings

    Further Reading

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

        let actionable = sut?.call(withReturnValue: dummyReturnValue).thenAnswer {
          (args: [Any?]) -> Int in
    
          return (args[0] as! Int) * 2
        }
    Severity: Minor
    Found in Example/Tests/StubTests.swift and 1 other location - About 55 mins to fix
    Example/Tests/StubTests.swift on lines 660..664

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

    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

    //
    //  Mockit
    //
    //  Copyright (c) 2016 Syed Sabir Salman-Al-Musawi <sabirvirtuoso@gmail.com>
    //
    Severity: Major
    Found in Mockit/Classes/TypeMatcher.swift and 9 other locations - About 55 mins to fix
    Mockit/Classes/TypeMatcher.swift on lines 1..313
    Mockit/Classes/TypeMatcher.swift on lines 1..313
    Mockit/Classes/TypeMatcher.swift on lines 1..313
    Mockit/Classes/TypeMatcher.swift on lines 1..313
    Mockit/Classes/TypeMatcher.swift on lines 1..313
    Mockit/Classes/TypeMatcher.swift on lines 1..313
    Mockit/Classes/TypeMatcher.swift on lines 1..313
    Mockit/Classes/TypeMatcher.swift on lines 1..313
    Mockit/Classes/TypeMatcher.swift on lines 1..313

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

    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 testDifferentBoolArrayArgumentsDoNotMatch() {
        // Given
        let firstArgument = [true, false]
        let secondArgument = [false, true]
    
    
    Severity: Major
    Found in Example/Tests/MockMatcherTests.swift and 9 other locations - About 50 mins to fix
    Example/Tests/MockMatcherTests.swift on lines 586..598
    Example/Tests/MockMatcherTests.swift on lines 600..612
    Example/Tests/MockMatcherTests.swift on lines 628..640
    Example/Tests/MockMatcherTests.swift on lines 642..654
    Example/Tests/MockMatcherTests.swift on lines 670..682
    Example/Tests/MockMatcherTests.swift on lines 712..724
    Example/Tests/MockMatcherTests.swift on lines 726..738
    Example/Tests/MockMatcherTests.swift on lines 754..766
    Example/Tests/MockMatcherTests.swift on lines 768..780

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

      func testSameStringArrayArgumentsMatch() {
        // Given
        let firstArgument = ["one", "two"]
        let secondArgument = ["one", "two"]
    
    
    Severity: Major
    Found in Example/Tests/MockMatcherTests.swift and 9 other locations - About 50 mins to fix
    Example/Tests/MockMatcherTests.swift on lines 600..612
    Example/Tests/MockMatcherTests.swift on lines 628..640
    Example/Tests/MockMatcherTests.swift on lines 642..654
    Example/Tests/MockMatcherTests.swift on lines 670..682
    Example/Tests/MockMatcherTests.swift on lines 684..696
    Example/Tests/MockMatcherTests.swift on lines 712..724
    Example/Tests/MockMatcherTests.swift on lines 726..738
    Example/Tests/MockMatcherTests.swift on lines 754..766
    Example/Tests/MockMatcherTests.swift on lines 768..780

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

      func testDifferentDoubleArrayArgumentsDoNotMatch() {
        // Given
        let firstArgument = [10.12, 10.5]
        let secondArgument = [10.4, 10.12]
    
    
    Severity: Major
    Found in Example/Tests/MockMatcherTests.swift and 9 other locations - About 50 mins to fix
    Example/Tests/MockMatcherTests.swift on lines 586..598
    Example/Tests/MockMatcherTests.swift on lines 600..612
    Example/Tests/MockMatcherTests.swift on lines 628..640
    Example/Tests/MockMatcherTests.swift on lines 642..654
    Example/Tests/MockMatcherTests.swift on lines 670..682
    Example/Tests/MockMatcherTests.swift on lines 684..696
    Example/Tests/MockMatcherTests.swift on lines 712..724
    Example/Tests/MockMatcherTests.swift on lines 754..766
    Example/Tests/MockMatcherTests.swift on lines 768..780

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

      func testSameIntArrayArgumentsMatch() {
        // Given
        let firstArgument = [1, 2]
        let secondArgument = [1, 2]
    
    
    Severity: Major
    Found in Example/Tests/MockMatcherTests.swift and 9 other locations - About 50 mins to fix
    Example/Tests/MockMatcherTests.swift on lines 586..598
    Example/Tests/MockMatcherTests.swift on lines 600..612
    Example/Tests/MockMatcherTests.swift on lines 642..654
    Example/Tests/MockMatcherTests.swift on lines 670..682
    Example/Tests/MockMatcherTests.swift on lines 684..696
    Example/Tests/MockMatcherTests.swift on lines 712..724
    Example/Tests/MockMatcherTests.swift on lines 726..738
    Example/Tests/MockMatcherTests.swift on lines 754..766
    Example/Tests/MockMatcherTests.swift on lines 768..780

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

      func testDifferentStringArrayArgumentsDoNotMatch() {
        // Given
        let firstArgument = ["one", "two"]
        let secondArgument = ["one", "three"]
    
    
    Severity: Major
    Found in Example/Tests/MockMatcherTests.swift and 9 other locations - About 50 mins to fix
    Example/Tests/MockMatcherTests.swift on lines 586..598
    Example/Tests/MockMatcherTests.swift on lines 628..640
    Example/Tests/MockMatcherTests.swift on lines 642..654
    Example/Tests/MockMatcherTests.swift on lines 670..682
    Example/Tests/MockMatcherTests.swift on lines 684..696
    Example/Tests/MockMatcherTests.swift on lines 712..724
    Example/Tests/MockMatcherTests.swift on lines 726..738
    Example/Tests/MockMatcherTests.swift on lines 754..766
    Example/Tests/MockMatcherTests.swift on lines 768..780

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

      func testSameDoubleArrayArgumentsMatch() {
        // Given
        let firstArgument = [10.120, 10.130]
        let secondArgument = [10.120, 10.130]
    
    
    Severity: Major
    Found in Example/Tests/MockMatcherTests.swift and 9 other locations - About 50 mins to fix
    Example/Tests/MockMatcherTests.swift on lines 586..598
    Example/Tests/MockMatcherTests.swift on lines 600..612
    Example/Tests/MockMatcherTests.swift on lines 628..640
    Example/Tests/MockMatcherTests.swift on lines 642..654
    Example/Tests/MockMatcherTests.swift on lines 670..682
    Example/Tests/MockMatcherTests.swift on lines 684..696
    Example/Tests/MockMatcherTests.swift on lines 726..738
    Example/Tests/MockMatcherTests.swift on lines 754..766
    Example/Tests/MockMatcherTests.swift on lines 768..780

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

      func testSameBoolArrayArgumentsMatch() {
        // Given
        let firstArgument = [true, false]
        let secondArgument = [true, false]
    
    
    Severity: Major
    Found in Example/Tests/MockMatcherTests.swift and 9 other locations - About 50 mins to fix
    Example/Tests/MockMatcherTests.swift on lines 586..598
    Example/Tests/MockMatcherTests.swift on lines 600..612
    Example/Tests/MockMatcherTests.swift on lines 628..640
    Example/Tests/MockMatcherTests.swift on lines 642..654
    Example/Tests/MockMatcherTests.swift on lines 684..696
    Example/Tests/MockMatcherTests.swift on lines 712..724
    Example/Tests/MockMatcherTests.swift on lines 726..738
    Example/Tests/MockMatcherTests.swift on lines 754..766
    Example/Tests/MockMatcherTests.swift on lines 768..780

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

      func testDifferentIntArrayArgumentsDoNotMatch() {
        // Given
        let firstArgument = [2, 1]
        let secondArgument = [2, 2]
    
    
    Severity: Major
    Found in Example/Tests/MockMatcherTests.swift and 9 other locations - About 50 mins to fix
    Example/Tests/MockMatcherTests.swift on lines 586..598
    Example/Tests/MockMatcherTests.swift on lines 600..612
    Example/Tests/MockMatcherTests.swift on lines 628..640
    Example/Tests/MockMatcherTests.swift on lines 670..682
    Example/Tests/MockMatcherTests.swift on lines 684..696
    Example/Tests/MockMatcherTests.swift on lines 712..724
    Example/Tests/MockMatcherTests.swift on lines 726..738
    Example/Tests/MockMatcherTests.swift on lines 754..766
    Example/Tests/MockMatcherTests.swift on lines 768..780

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

      func testSameFloatArrayArgumentsMatch() {
        // Given
        let firstArgument = [10.5, 10.6]
        let secondArgument = [10.5, 10.6]
    
    
    Severity: Major
    Found in Example/Tests/MockMatcherTests.swift and 9 other locations - About 50 mins to fix
    Example/Tests/MockMatcherTests.swift on lines 586..598
    Example/Tests/MockMatcherTests.swift on lines 600..612
    Example/Tests/MockMatcherTests.swift on lines 628..640
    Example/Tests/MockMatcherTests.swift on lines 642..654
    Example/Tests/MockMatcherTests.swift on lines 670..682
    Example/Tests/MockMatcherTests.swift on lines 684..696
    Example/Tests/MockMatcherTests.swift on lines 712..724
    Example/Tests/MockMatcherTests.swift on lines 726..738
    Example/Tests/MockMatcherTests.swift on lines 768..780

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

      func testDifferentFloatArrayArgumentsDoNotMatch() {
        // Given
        let firstArgument = [10.5, 10.7]
        let secondArgument = [10.4, 10.2]
    
    
    Severity: Major
    Found in Example/Tests/MockMatcherTests.swift and 9 other locations - About 50 mins to fix
    Example/Tests/MockMatcherTests.swift on lines 586..598
    Example/Tests/MockMatcherTests.swift on lines 600..612
    Example/Tests/MockMatcherTests.swift on lines 628..640
    Example/Tests/MockMatcherTests.swift on lines 642..654
    Example/Tests/MockMatcherTests.swift on lines 670..682
    Example/Tests/MockMatcherTests.swift on lines 684..696
    Example/Tests/MockMatcherTests.swift on lines 712..724
    Example/Tests/MockMatcherTests.swift on lines 726..738
    Example/Tests/MockMatcherTests.swift on lines 754..766

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

      func testDifferentNumberOfStringArrayArgumentsDoNotMatch() {
        // Given
        let firstArgument = ["one", "two"]
        let secondArgument = ["one"]
    
    
    Severity: Major
    Found in Example/Tests/MockMatcherTests.swift and 4 other locations - About 50 mins to fix
    Example/Tests/MockMatcherTests.swift on lines 656..668
    Example/Tests/MockMatcherTests.swift on lines 698..710
    Example/Tests/MockMatcherTests.swift on lines 740..752
    Example/Tests/MockMatcherTests.swift on lines 782..794

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 61.

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

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

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

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

    Refactorings

    Further Reading

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

      func testDifferentNumberOfIntArrayArgumentsDoNotMatch() {
        // Given
        let firstArgument = [2, 1]
        let secondArgument = [2]
    
    
    Severity: Major
    Found in Example/Tests/MockMatcherTests.swift and 4 other locations - About 50 mins to fix
    Example/Tests/MockMatcherTests.swift on lines 614..626
    Example/Tests/MockMatcherTests.swift on lines 698..710
    Example/Tests/MockMatcherTests.swift on lines 740..752
    Example/Tests/MockMatcherTests.swift on lines 782..794

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 61.

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

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

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

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

    Refactorings

    Further Reading

    Severity
    Category
    Status
    Source
    Language