sabirvirtuoso/Mockit

View on GitHub

Showing 131 of 148 total issues

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

  func testVerificationModeAtMostOnceSucceedsWhenMethodIsCalledLessThanOnce() {
    // Given
    XCTAssertNil(failer.message)
    XCTAssertNil(failer.file)
    XCTAssertNil(failer.line)
Severity: Major
Found in Example/Tests/CallHandlerTests.swift and 2 other locations - About 1 hr to fix
Example/Tests/CallHandlerTests.swift on lines 262..275
Example/Tests/CallHandlerTests.swift on lines 489..502

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

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

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

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

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

Refactorings

Further Reading

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

  func testVerificationModeNeverSucceedsWhenMethodIsNeverCalled() {
    // Given
    XCTAssertNil(failer.message)
    XCTAssertNil(failer.file)
    XCTAssertNil(failer.line)
Severity: Major
Found in Example/Tests/CallHandlerTests.swift and 2 other locations - About 1 hr to fix
Example/Tests/CallHandlerTests.swift on lines 262..275
Example/Tests/CallHandlerTests.swift on lines 294..307

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

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

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

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

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

Refactorings

Further Reading

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

  func testVerificationModeAtLeastOnceFailsWhenMethodIsCalledLessThanOnce() {
    // Given
    XCTAssertNil(failer.message)
    XCTAssertNil(failer.file)
    XCTAssertNil(failer.line)
Severity: Major
Found in Example/Tests/CallHandlerTests.swift and 2 other locations - About 1 hr to fix
Example/Tests/CallHandlerTests.swift on lines 294..307
Example/Tests/CallHandlerTests.swift on lines 489..502

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

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

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

class Failer: MockFailer {

  var message: String?
  var file: String?
  var line: Int?
Severity: Major
Found in Example/Tests/CallHandlerTests.swift and 1 other location - About 1 hr to fix
Example/Tests/VerificationModeTests.swift on lines 32..44

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

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

  func testDifferentOptionalIntArrayArgumentsDoNotMatch() {
    // Given
    let firstArgument: [Int?] = [2, 1, nil]
    let secondArgument: [Int?] = [2, 2, 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 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 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 testSameOptionalIntArrayArgumentsMatch() {
    // Given
    let firstArgument: [Int?] = [1, 2, nil]
    let secondArgument: [Int?] = [1, 2, 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 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 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 5 locations. Consider refactoring.
Open

public class StringMatcher: TypeMatcher {

  public func match(argument arg: Any, withArgument withArg: Any) -> Bool {
    switch (arg, withArg) {
      case (let firstArg as String, let secondArg as String):
Severity: Major
Found in Mockit/Classes/TypeMatcher.swift and 4 other locations - About 1 hr to fix
Mockit/Classes/TypeMatcher.swift on lines 57..68
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 5 locations. Consider refactoring.
Open

public class DoubleMatcher: TypeMatcher {

  public func match(argument arg: Any, withArgument withArg: Any) -> Bool {
    switch (arg, withArg) {
      case (let firstArg as Double, let secondArg as Double):
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 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 testSameOptionalDoubleArrayArgumentsMatch() {
    // Given
    let firstArgument: [Double?] = [10.120, 10.130, nil]
    let secondArgument: [Double?] = [10.120, 10.130, 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 494..506
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 testDifferentOptionalBoolArrayArgumentsDoNotMatch() {
    // Given
    let firstArgument: [Bool?] = [true, false, nil]
    let secondArgument: [Bool?] = [false, true, 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 480..492
Example/Tests/MockMatcherTests.swift on lines 494..506
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 5 locations. Consider refactoring.
Open

public class IntMatcher: TypeMatcher {

  public func match(argument arg: Any, withArgument withArg: Any) -> Bool {
    switch (arg, withArg) {
      case (let firstArg as Int, let secondArg as Int):
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 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 testSameOptionalStringArrayArgumentsMatch() {
    // Given
    let firstArgument: [String?] = ["one", "two", nil]
    let secondArgument: [String?] = ["one", "two", nil]

Severity: Major
Found in Example/Tests/MockMatcherTests.swift and 9 other locations - About 1 hr to fix
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 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 testDifferentOptionalFloatArrayArgumentsDoNotMatch() {
    // Given
    let firstArgument: [Float?] = [10.5, 10.7, nil]
    let secondArgument: [Float?] = [10.4, 10.2, 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 522..534

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 testDifferentOptionalStringArrayArgumentsDoNotMatch() {
    // Given
    let firstArgument: [String?] = ["one", "two", nil]
    let secondArgument: [String?] = ["one", "three", 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 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 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 testSameOptionalBoolArrayArgumentsMatch() {
    // Given
    let firstArgument: [Bool?] = [true, false, nil]
    let secondArgument: [Bool?] = [true, false, 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 452..464
Example/Tests/MockMatcherTests.swift on lines 480..492
Example/Tests/MockMatcherTests.swift on lines 494..506
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

Severity
Category
Status
Source
Language