sabirvirtuoso/Mockit

View on GitHub

Showing 148 of 148 total issues

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

  func testDifferentNumberOfStringArrayArgumentsDoNotMatch() {
    // Given
    let firstArgument = ["one", "two"]
    let secondArgument = ["one"]

Severity: Major
Found in Example/Tests/MockMatcherTests.swift and 4 other locations - About 50 mins to fix
Example/Tests/MockMatcherTests.swift on lines 656..668
Example/Tests/MockMatcherTests.swift on lines 698..710
Example/Tests/MockMatcherTests.swift on lines 740..752
Example/Tests/MockMatcherTests.swift on lines 782..794

Duplicated Code

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

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

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

Tuning

This issue has a mass of 61.

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

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

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

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

Refactorings

Further Reading

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

  func testDifferentNumberOfDoubleArrayArgumentsDoNotMatch() {
    // Given
    let firstArgument = [10.5, 10.2]
    let secondArgument = [10.5]

Severity: Major
Found in Example/Tests/MockMatcherTests.swift and 4 other locations - About 50 mins to fix
Example/Tests/MockMatcherTests.swift on lines 614..626
Example/Tests/MockMatcherTests.swift on lines 656..668
Example/Tests/MockMatcherTests.swift on lines 698..710
Example/Tests/MockMatcherTests.swift on lines 782..794

Duplicated Code

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

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

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

Tuning

This issue has a mass of 61.

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

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

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

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

Refactorings

Further Reading

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

  func testDifferentNumberOfFloatArrayArgumentsDoNotMatch() {
    // Given
    let firstArgument = [10.5, 10.2]
    let secondArgument = [10.5]

Severity: Major
Found in Example/Tests/MockMatcherTests.swift and 4 other locations - About 50 mins to fix
Example/Tests/MockMatcherTests.swift on lines 614..626
Example/Tests/MockMatcherTests.swift on lines 656..668
Example/Tests/MockMatcherTests.swift on lines 698..710
Example/Tests/MockMatcherTests.swift on lines 740..752

Duplicated Code

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

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

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

Tuning

This issue has a mass of 61.

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

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

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

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

Refactorings

Further Reading

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

  func testExpectNoMethod() {
    // Given

    // When
    sut.expectNoMethod()
Severity: Minor
Found in Example/Tests/ExampleTests.swift and 1 other location - About 45 mins to fix
Example/Tests/ExampleTests.swift on lines 166..176

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

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 testExpectAllThreeMethods() {
    // Given

    // When
    sut.expectAllThreeMethods()
Severity: Minor
Found in Example/Tests/ExampleTests.swift and 1 other location - About 45 mins to fix
Example/Tests/ExampleTests.swift on lines 178..188

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

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

Function accept has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

  func accept(_ returnValue: Any?, ofFunction function: String, atFile file: String,
                     inLine line: Int, withArgs args: Any?...) -> Any? {
Severity: Minor
Found in Example/Tests/MockTests.swift - About 35 mins to fix

    Function accept has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

      open func accept(_ returnValue: Any?, ofFunction function: String, atFile file: String,
                         inLine line: Int, withArgs args: Any?...) -> Any? {
    Severity: Minor
    Found in Mockit/Classes/CallHandlerImpl.swift - About 35 mins to fix

      Function match has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

        public func match(argument arg: Any, withArgument withArg: Any) -> Bool {
          switch (arg, withArg) {
          case (let firstArg as Array<Any?>, let secondArg as Array<Any?>):
            return match(firstArg, withArray: secondArg)
          case (let firstArg as Array<String?>, let secondArg as Array<String?>):
      Severity: Minor
      Found in Mockit/Classes/TypeMatcher.swift - About 35 mins to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

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

          let actionable = sut?.call(withReturnValue: dummyReturnValue).thenDo {
            (args: [Any?]) -> Void in
      
            array.append(true)
          }
      Severity: Minor
      Found in Example/Tests/StubTests.swift and 1 other location - About 35 mins to fix
      Example/Tests/StubTests.swift on lines 609..613

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

      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

      Function match has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

        public func match(argument arg: Any, withArgument withArg: Any) -> Bool {
          switch (arg, withArg) {
            case (let firstArg as Array<Any>, let secondArg as Array<Any>):
              return match(firstArg, withArray: secondArg)
            case (let firstArg as Array<String>, let secondArg as Array<String>):
      Severity: Minor
      Found in Mockit/Classes/TypeMatcher.swift - About 35 mins to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

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

          let actionable = sut?.call(withReturnValue: dummyReturnValue).thenDo {
            (args: [Any?]) -> Void in
      
            array.append(true)
          }.thenDo {
      Severity: Minor
      Found in Example/Tests/StubTests.swift and 1 other location - About 35 mins to fix
      Example/Tests/StubTests.swift on lines 488..492

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

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

        func accept(_ returnValue: Any?, ofFunction function: String, atFile file: String,
                           inLine line: Int, withArgs args: Any?...) -> Any? {
          argumentsOfSpecificCall = args
      
          return returnValue
      Severity: Minor
      Found in Example/Tests/MockTests.swift and 2 other locations - About 35 mins to fix
      Mockit/Classes/CallHandler.swift on lines 1..47
      Mockit/Classes/CallHandlerImpl.swift on lines 79..104

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

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

          let _ = (sut?.satisfyStub(withFunctionName: functionName))! && (sut?.satisfyStub(withActualArgs: [2, "two", true, nil]))!
      Severity: Major
      Found in Example/Tests/StubTests.swift and 5 other locations - About 35 mins to fix
      Example/Tests/StubTests.swift on lines 404..404
      Example/Tests/StubTests.swift on lines 432..432
      Example/Tests/StubTests.swift on lines 630..630
      Example/Tests/StubTests.swift on lines 767..767
      Example/Tests/StubTests.swift on lines 807..807

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

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

      //
      //  Mockit
      //
      //  Copyright (c) 2016 Syed Sabir Salman-Al-Musawi <sabirvirtuoso@gmail.com>
      //
      Severity: Minor
      Found in Mockit/Classes/CallHandler.swift and 2 other locations - About 35 mins to fix
      Example/Tests/MockTests.swift on lines 62..67
      Mockit/Classes/CallHandlerImpl.swift on lines 79..104

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

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

          let _ = (sut?.satisfyStub(withFunctionName: functionName))! && (sut?.satisfyStub(withActualArgs: [2, "two", true, nil]))!
      Severity: Major
      Found in Example/Tests/StubTests.swift and 5 other locations - About 35 mins to fix
      Example/Tests/StubTests.swift on lines 404..404
      Example/Tests/StubTests.swift on lines 583..583
      Example/Tests/StubTests.swift on lines 630..630
      Example/Tests/StubTests.swift on lines 767..767
      Example/Tests/StubTests.swift on lines 807..807

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

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

          let _ = (sut?.satisfyStub(withFunctionName: functionName))! && (sut?.satisfyStub(withActualArgs: [2, "two", true, nil]))!
      Severity: Major
      Found in Example/Tests/StubTests.swift and 5 other locations - About 35 mins to fix
      Example/Tests/StubTests.swift on lines 404..404
      Example/Tests/StubTests.swift on lines 432..432
      Example/Tests/StubTests.swift on lines 583..583
      Example/Tests/StubTests.swift on lines 767..767
      Example/Tests/StubTests.swift on lines 807..807

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

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

          let _ = (sut?.satisfyStub(withFunctionName: functionName))! && (sut?.satisfyStub(withActualArgs: [2, "two", true, nil]))!
      Severity: Major
      Found in Example/Tests/StubTests.swift and 5 other locations - About 35 mins to fix
      Example/Tests/StubTests.swift on lines 404..404
      Example/Tests/StubTests.swift on lines 432..432
      Example/Tests/StubTests.swift on lines 583..583
      Example/Tests/StubTests.swift on lines 630..630
      Example/Tests/StubTests.swift on lines 807..807

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

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

          let _ = (sut?.satisfyStub(withFunctionName: functionName))! && (sut?.satisfyStub(withActualArgs: [2, "two", true, nil]))!
      Severity: Major
      Found in Example/Tests/StubTests.swift and 5 other locations - About 35 mins to fix
      Example/Tests/StubTests.swift on lines 432..432
      Example/Tests/StubTests.swift on lines 583..583
      Example/Tests/StubTests.swift on lines 630..630
      Example/Tests/StubTests.swift on lines 767..767
      Example/Tests/StubTests.swift on lines 807..807

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

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

          let _ = (sut?.satisfyStub(withFunctionName: functionName))! && (sut?.satisfyStub(withActualArgs: [2, "two", true, nil]))!
      Severity: Major
      Found in Example/Tests/StubTests.swift and 5 other locations - About 35 mins to fix
      Example/Tests/StubTests.swift on lines 404..404
      Example/Tests/StubTests.swift on lines 432..432
      Example/Tests/StubTests.swift on lines 583..583
      Example/Tests/StubTests.swift on lines 630..630
      Example/Tests/StubTests.swift on lines 767..767

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

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

        @discardableResult
        open func accept(_ returnValue: Any?, ofFunction function: String, atFile file: String,
                           inLine line: Int, withArgs args: Any?...) -> Any? {
          switch state {
            case .none:
      Severity: Minor
      Found in Mockit/Classes/CallHandlerImpl.swift and 2 other locations - About 35 mins to fix
      Example/Tests/MockTests.swift on lines 62..67
      Mockit/Classes/CallHandler.swift on lines 1..47

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

      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