sabirvirtuoso/Mockit

View on GitHub
Example/Tests/VerificationModeTests.swift

Summary

Maintainability
F
4 days
Test Coverage

File VerificationModeTests.swift has 295 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import XCTest
import Mockit


// MARK:- A test implementation of `MockFailer` protocol
Severity: Minor
Found in Example/Tests/VerificationModeTests.swift - About 3 hrs to fix

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

      func testVerificationModeAtMostTimesFailsWhenMethodIsCalledMoreThanGivenTimes() {
        // Given
        let verificationData = dummyVerificationData(timesInvoked: 4)
        let sut = AtMostTimes(times: Times(times: 3))
    
    
    Severity: Major
    Found in Example/Tests/VerificationModeTests.swift and 1 other location - About 2 hrs to fix
    Example/Tests/VerificationModeTests.swift on lines 348..365

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

    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 testVerificationModeAtLeastTimesFailsWhenMethodIsCalledLessThanGivenTimes() {
        // Given
        let verificationData = dummyVerificationData(timesInvoked: 2)
        let sut = AtLeastTimes(times: Times(times: 3))
    
    
    Severity: Major
    Found in Example/Tests/VerificationModeTests.swift and 1 other location - About 2 hrs to fix
    Example/Tests/VerificationModeTests.swift on lines 429..446

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

    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 testVerificationModeTimesFailsWhenMethodIsCalledLessThanGivenTimes() {
        // Given
        let verificationData = dummyVerificationData(timesInvoked: 2)
        let sut = Times(times: 3)
    
    
    Severity: Major
    Found in Example/Tests/VerificationModeTests.swift and 1 other location - About 2 hrs to fix
    Example/Tests/VerificationModeTests.swift on lines 303..320

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

    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 testVerificationModeTimesFailsWhenMethodIsCalledMoreThanGivenTimes() {
        // Given
        let verificationData = dummyVerificationData(timesInvoked: 4)
        let sut = Times(times: 3)
    
    
    Severity: Major
    Found in Example/Tests/VerificationModeTests.swift and 1 other location - About 2 hrs to fix
    Example/Tests/VerificationModeTests.swift on lines 284..301

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

    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 testVerificationModeOnceFailsWhenMethodIsCalledMoreThanOnce() {
        // Given
        let verificationData = dummyVerificationData(timesInvoked: 3)
        let sut = Once()
    
    
    Severity: Major
    Found in Example/Tests/VerificationModeTests.swift and 4 other locations - About 1 hr to fix
    Example/Tests/VerificationModeTests.swift on lines 76..93
    Example/Tests/VerificationModeTests.swift on lines 140..157
    Example/Tests/VerificationModeTests.swift on lines 239..256
    Example/Tests/VerificationModeTests.swift on lines 474..491

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

    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 testVerificationModeNeverFailsWhenMethodIsCalled() {
        // Given
        let verificationData = dummyVerificationData(timesInvoked: 1)
        let sut = Never()
    
    
    Severity: Major
    Found in Example/Tests/VerificationModeTests.swift and 4 other locations - About 1 hr to fix
    Example/Tests/VerificationModeTests.swift on lines 76..93
    Example/Tests/VerificationModeTests.swift on lines 113..130
    Example/Tests/VerificationModeTests.swift on lines 140..157
    Example/Tests/VerificationModeTests.swift on lines 239..256

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

    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 testVerificationModeOnceFailsWhenMethodIsCalledLessThanOnce() {
        // Given
        let verificationData = dummyVerificationData(timesInvoked: 0)
        let sut = Once()
    
    
    Severity: Major
    Found in Example/Tests/VerificationModeTests.swift and 4 other locations - About 1 hr to fix
    Example/Tests/VerificationModeTests.swift on lines 113..130
    Example/Tests/VerificationModeTests.swift on lines 140..157
    Example/Tests/VerificationModeTests.swift on lines 239..256
    Example/Tests/VerificationModeTests.swift on lines 474..491

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

    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 testVerificationModeAtMostOnceFailsWhenMethodIsCalledMoreThanOnce() {
        // Given
        let verificationData = dummyVerificationData(timesInvoked: 3)
        let sut = AtMostOnce()
    
    
    Severity: Major
    Found in Example/Tests/VerificationModeTests.swift and 4 other locations - About 1 hr to fix
    Example/Tests/VerificationModeTests.swift on lines 76..93
    Example/Tests/VerificationModeTests.swift on lines 113..130
    Example/Tests/VerificationModeTests.swift on lines 140..157
    Example/Tests/VerificationModeTests.swift on lines 474..491

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

    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 testVerificationModeAtLeastOnceFailsWhenMethodIsCalledLessThanOnce() {
        // Given
        let verificationData = dummyVerificationData(timesInvoked: 0)
        let sut = AtLeastOnce()
    
    
    Severity: Major
    Found in Example/Tests/VerificationModeTests.swift and 4 other locations - About 1 hr to fix
    Example/Tests/VerificationModeTests.swift on lines 76..93
    Example/Tests/VerificationModeTests.swift on lines 113..130
    Example/Tests/VerificationModeTests.swift on lines 239..256
    Example/Tests/VerificationModeTests.swift on lines 474..491

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

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

      func testVerificationModeAtLeastTimesSucceedsWhenMethodIsCalledMoreThanGivenTimes() {
        // Given
        let verificationData = dummyVerificationData(timesInvoked: 4)
        let sut = AtLeastTimes(times: Times(times: 3))
    
    
    Severity: Major
    Found in Example/Tests/VerificationModeTests.swift and 3 other locations - About 1 hr to fix
    Example/Tests/VerificationModeTests.swift on lines 330..346
    Example/Tests/VerificationModeTests.swift on lines 393..409
    Example/Tests/VerificationModeTests.swift on lines 411..427

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

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

      func testVerificationModeAtMostTimesSucceedsWhenMethodIsCalledGivenTimes() {
        // Given
        let verificationData = dummyVerificationData(timesInvoked: 3)
        let sut = AtMostTimes(times: Times(times: 3))
    
    
    Severity: Major
    Found in Example/Tests/VerificationModeTests.swift and 3 other locations - About 1 hr to fix
    Example/Tests/VerificationModeTests.swift on lines 330..346
    Example/Tests/VerificationModeTests.swift on lines 367..383
    Example/Tests/VerificationModeTests.swift on lines 411..427

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

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

      func testVerificationModeAtLeastTimesSucceedsWhenMethodIsCalledGivenTimes() {
        // Given
        let verificationData = dummyVerificationData(timesInvoked: 3)
        let sut = AtLeastTimes(times: Times(times: 3))
    
    
    Severity: Major
    Found in Example/Tests/VerificationModeTests.swift and 3 other locations - About 1 hr to fix
    Example/Tests/VerificationModeTests.swift on lines 367..383
    Example/Tests/VerificationModeTests.swift on lines 393..409
    Example/Tests/VerificationModeTests.swift on lines 411..427

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

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

      func testVerificationModeAtMostTimesSucceedsWhenMethodIsCalledLessThanGivenTimes() {
        // Given
        let verificationData = dummyVerificationData(timesInvoked: 2)
        let sut = AtMostTimes(times: Times(times: 3))
    
    
    Severity: Major
    Found in Example/Tests/VerificationModeTests.swift and 3 other locations - About 1 hr to fix
    Example/Tests/VerificationModeTests.swift on lines 330..346
    Example/Tests/VerificationModeTests.swift on lines 367..383
    Example/Tests/VerificationModeTests.swift on lines 393..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 104.

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

      func testVerificationModeAtMostOnceSucceedsWhenMethodIsCalledOnce() {
        // Given
        let verificationData = dummyVerificationData(timesInvoked: 1)
        let sut = AtMostOnce()
    
    
    Severity: Major
    Found in Example/Tests/VerificationModeTests.swift and 5 other locations - About 1 hr to fix
    Example/Tests/VerificationModeTests.swift on lines 95..111
    Example/Tests/VerificationModeTests.swift on lines 159..175
    Example/Tests/VerificationModeTests.swift on lines 177..193
    Example/Tests/VerificationModeTests.swift on lines 203..219
    Example/Tests/VerificationModeTests.swift on lines 456..472

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

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

      func testVerificationModeAtMostOnceSucceedsWhenMethodIsCalledLessThanOnce() {
        // Given
        let verificationData = dummyVerificationData(timesInvoked: 0)
        let sut = AtMostOnce()
    
    
    Severity: Major
    Found in Example/Tests/VerificationModeTests.swift and 5 other locations - About 1 hr to fix
    Example/Tests/VerificationModeTests.swift on lines 95..111
    Example/Tests/VerificationModeTests.swift on lines 159..175
    Example/Tests/VerificationModeTests.swift on lines 177..193
    Example/Tests/VerificationModeTests.swift on lines 221..237
    Example/Tests/VerificationModeTests.swift on lines 456..472

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

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

      func testVerificationModeNeverSucceedsWhenMethodIsNotCalled() {
        // Given
        let verificationData = dummyVerificationData(timesInvoked: 0)
        let sut = Never()
    
    
    Severity: Major
    Found in Example/Tests/VerificationModeTests.swift and 5 other locations - About 1 hr to fix
    Example/Tests/VerificationModeTests.swift on lines 95..111
    Example/Tests/VerificationModeTests.swift on lines 159..175
    Example/Tests/VerificationModeTests.swift on lines 177..193
    Example/Tests/VerificationModeTests.swift on lines 203..219
    Example/Tests/VerificationModeTests.swift on lines 221..237

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 94.

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

      func testVerificationModeOnceSucceedsWhenMethodIsCalledOnce() {
        // Given
        let verificationData = dummyVerificationData(timesInvoked: 1)
        let sut = Once()
    
    
    Severity: Major
    Found in Example/Tests/VerificationModeTests.swift and 5 other locations - About 1 hr to fix
    Example/Tests/VerificationModeTests.swift on lines 159..175
    Example/Tests/VerificationModeTests.swift on lines 177..193
    Example/Tests/VerificationModeTests.swift on lines 203..219
    Example/Tests/VerificationModeTests.swift on lines 221..237
    Example/Tests/VerificationModeTests.swift on lines 456..472

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

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

      func testVerificationModeAtLeastOnceSucceedsWhenMethodIsCalledMoreThanOnce() {
        // Given
        let verificationData = dummyVerificationData(timesInvoked: 3)
        let sut = AtLeastOnce()
    
    
    Severity: Major
    Found in Example/Tests/VerificationModeTests.swift and 5 other locations - About 1 hr to fix
    Example/Tests/VerificationModeTests.swift on lines 95..111
    Example/Tests/VerificationModeTests.swift on lines 159..175
    Example/Tests/VerificationModeTests.swift on lines 203..219
    Example/Tests/VerificationModeTests.swift on lines 221..237
    Example/Tests/VerificationModeTests.swift on lines 456..472

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

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

      func testVerificationModeAtLeastOnceSucceedsWhenMethodIsCalledOnce() {
        // Given
        let verificationData = dummyVerificationData(timesInvoked: 1)
        let sut = AtLeastOnce()
    
    
    Severity: Major
    Found in Example/Tests/VerificationModeTests.swift and 5 other locations - About 1 hr to fix
    Example/Tests/VerificationModeTests.swift on lines 95..111
    Example/Tests/VerificationModeTests.swift on lines 177..193
    Example/Tests/VerificationModeTests.swift on lines 203..219
    Example/Tests/VerificationModeTests.swift on lines 221..237
    Example/Tests/VerificationModeTests.swift on lines 456..472

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

    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

    class TestFailer: MockFailer {
    
      var message: String?
      var file: String?
      var line: Int?
    Severity: Major
    Found in Example/Tests/VerificationModeTests.swift and 1 other location - About 1 hr to fix
    Example/Tests/CallHandlerTests.swift on lines 62..74

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

    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