sabirvirtuoso/Mockit

View on GitHub

Showing 131 of 148 total issues

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

public class FloatMatcher: TypeMatcher {

  public func match(argument arg: Any, withArgument withArg: Any) -> Bool {
    switch (arg, withArg) {
      case (let firstArg as Float, let secondArg as Float):
Severity: Major
Found in Mockit/Classes/TypeMatcher.swift and 4 other locations - About 1 hr to fix
Mockit/Classes/TypeMatcher.swift on lines 40..51
Mockit/Classes/TypeMatcher.swift on lines 57..68
Mockit/Classes/TypeMatcher.swift on lines 74..85
Mockit/Classes/TypeMatcher.swift on lines 91..102

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

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

public class BoolMatcher: TypeMatcher {

  public func match(argument arg: Any, withArgument withArg: Any) -> Bool {
    switch (arg, withArg) {
      case (let firstArg as Bool, let secondArg as Bool):
Severity: Major
Found in Mockit/Classes/TypeMatcher.swift and 4 other locations - About 1 hr to fix
Mockit/Classes/TypeMatcher.swift on lines 40..51
Mockit/Classes/TypeMatcher.swift on lines 74..85
Mockit/Classes/TypeMatcher.swift on lines 91..102
Mockit/Classes/TypeMatcher.swift on lines 108..119

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

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 testDifferentOptionalDoubleArrayArgumentsDoNotMatch() {
    // Given
    let firstArgument: [Double?] = [10.12, 10.5, nil]
    let secondArgument: [Double?] = [10.4, 10.12, nil]

Severity: Major
Found in Example/Tests/MockMatcherTests.swift and 9 other locations - About 1 hr to fix
Example/Tests/MockMatcherTests.swift on lines 354..366
Example/Tests/MockMatcherTests.swift on lines 368..380
Example/Tests/MockMatcherTests.swift on lines 396..408
Example/Tests/MockMatcherTests.swift on lines 410..422
Example/Tests/MockMatcherTests.swift on lines 438..450
Example/Tests/MockMatcherTests.swift on lines 452..464
Example/Tests/MockMatcherTests.swift on lines 480..492
Example/Tests/MockMatcherTests.swift on lines 522..534
Example/Tests/MockMatcherTests.swift on lines 536..548

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

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 testSameOptionalFloatArrayArgumentsMatch() {
    // Given
    let firstArgument: [Float?] = [10.5, 10.6, nil]
    let secondArgument: [Float?] = [10.5, 10.6, nil]

Severity: Major
Found in Example/Tests/MockMatcherTests.swift and 9 other locations - About 1 hr to fix
Example/Tests/MockMatcherTests.swift on lines 354..366
Example/Tests/MockMatcherTests.swift on lines 368..380
Example/Tests/MockMatcherTests.swift on lines 396..408
Example/Tests/MockMatcherTests.swift on lines 410..422
Example/Tests/MockMatcherTests.swift on lines 438..450
Example/Tests/MockMatcherTests.swift on lines 452..464
Example/Tests/MockMatcherTests.swift on lines 480..492
Example/Tests/MockMatcherTests.swift on lines 494..506
Example/Tests/MockMatcherTests.swift on lines 536..548

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

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 testDifferentNumberOfOptionalStringArrayArgumentsDoNotMatch() {
    // Given
    let firstArgument: [String?] = ["one", "two", nil]
    let secondArgument: [String?] = ["one", nil]

Severity: Major
Found in Example/Tests/MockMatcherTests.swift and 4 other locations - About 1 hr to fix
Example/Tests/MockMatcherTests.swift on lines 424..436
Example/Tests/MockMatcherTests.swift on lines 466..478
Example/Tests/MockMatcherTests.swift on lines 508..520
Example/Tests/MockMatcherTests.swift on lines 550..562

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

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 testDifferentNumberOfOptionalBoolArrayArgumentsDoNotMatch() {
    // Given
    let firstArgument: [Bool?] = [true, true, nil]
    let secondArgument: [Bool?] = [true, nil]

Severity: Major
Found in Example/Tests/MockMatcherTests.swift and 4 other locations - About 1 hr to fix
Example/Tests/MockMatcherTests.swift on lines 382..394
Example/Tests/MockMatcherTests.swift on lines 424..436
Example/Tests/MockMatcherTests.swift on lines 508..520
Example/Tests/MockMatcherTests.swift on lines 550..562

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

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 testDifferentNumberOfOptionalIntArrayArgumentsDoNotMatch() {
    // Given
    let firstArgument: [Int?] = [2, 1, nil]
    let secondArgument: [Int?] = [2, nil]

Severity: Major
Found in Example/Tests/MockMatcherTests.swift and 4 other locations - About 1 hr to fix
Example/Tests/MockMatcherTests.swift on lines 382..394
Example/Tests/MockMatcherTests.swift on lines 466..478
Example/Tests/MockMatcherTests.swift on lines 508..520
Example/Tests/MockMatcherTests.swift on lines 550..562

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

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 testDifferentNumberOfOptionalDoubleArrayArgumentsDoNotMatch() {
    // Given
    let firstArgument: [Double?] = [10.5, 10.2, nil]
    let secondArgument: [Double?] = [10.5, nil]

Severity: Major
Found in Example/Tests/MockMatcherTests.swift and 4 other locations - About 1 hr to fix
Example/Tests/MockMatcherTests.swift on lines 382..394
Example/Tests/MockMatcherTests.swift on lines 424..436
Example/Tests/MockMatcherTests.swift on lines 466..478
Example/Tests/MockMatcherTests.swift on lines 550..562

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

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 testDifferentNumberOfOptionalFloatArrayArgumentsDoNotMatch() {
    // Given
    let firstArgument: [Float?] = [10.5, 10.2, nil]
    let secondArgument: [Float?] = [10.5, nil]

Severity: Major
Found in Example/Tests/MockMatcherTests.swift and 4 other locations - About 1 hr to fix
Example/Tests/MockMatcherTests.swift on lines 382..394
Example/Tests/MockMatcherTests.swift on lines 424..436
Example/Tests/MockMatcherTests.swift on lines 466..478
Example/Tests/MockMatcherTests.swift on lines 508..520

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

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

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

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

Severity
Category
Status
Source
Language