pantuspavel/PPEventRegistryAPI

View on GitHub

Showing 63 of 63 total issues

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

    class func stubUserNotFound() {
        stub(condition: { (request) -> Bool in
            true
        }) { (response) -> OHHTTPStubsResponse in
            let responseData : [String: Any] = ["action": "unknownUser",
PPEventRegistryAPI/PPEventRegistryAPITests/Classes/API/Operations/PPLoginOperation+Fixture.swift on lines 15..23
PPEventRegistryAPI/PPEventRegistryAPITests/Classes/API/Operations/PPLoginOperation+Fixture.swift on lines 35..43

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

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

    class func stubUserMissingData() {
        stub(condition: { (request) -> Bool in
            true
        }) { (response) -> OHHTTPStubsResponse in
            let responseData : [String: Any] = ["action": "missingData",
PPEventRegistryAPI/PPEventRegistryAPITests/Classes/API/Operations/PPLoginOperation+Fixture.swift on lines 15..23
PPEventRegistryAPI/PPEventRegistryAPITests/Classes/API/Operations/PPLoginOperation+Fixture.swift on lines 25..33

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

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

    class func stubSuccess() {
        stub(condition: { (request) -> Bool in
            true
        }) { (response) -> OHHTTPStubsResponse in
            let responseData : [String: Any] = ["action": "success",
PPEventRegistryAPI/PPEventRegistryAPITests/Classes/API/Operations/PPLoginOperation+Fixture.swift on lines 25..33
PPEventRegistryAPI/PPEventRegistryAPITests/Classes/API/Operations/PPLoginOperation+Fixture.swift on lines 35..43

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

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

        it("Login returns nil error in case of success") {
            PPLoginOperation.stubSuccess()

            waitUntil { done in
                api.login("email@email.com", password: "password") { error in
PPEventRegistryAPI/PPEventRegistryAPITests/Classes/PPEventRegistryAPISpec.swift on lines 179..189

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

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

            it("adds login operation in logged out state") {
                PPLoginOperation.stubSuccess()

                waitUntil { done in
                    api.login("email@email.com", password: "password") { error in
PPEventRegistryAPI/PPEventRegistryAPITests/Classes/PPEventRegistryAPISpec.swift on lines 31..41

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

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 spec has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    override func spec() {

        describe("Equatable") {

            it("errors of the same type are equal") {

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

                it("successes with not equal associated types are not equal") {
                    let result1 = PPResult<String, PPError>(value: "a")
                    let result2 = PPResult<String, PPError>.Success("b")
                    expect(result1 == result2).to(beFalsy())
                }
    PPEventRegistryAPI/PPEventRegistryAPITests/Classes/Utility/PPResultSpec.swift on lines 89..93

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

    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

                it("successes with equal associated types are equal") {
                    let result1 = PPResult<String, PPError>(value: "a")
                    let result2 = PPResult<String, PPError>.Success("a")
                    expect(result1 == result2).to(beTruthy())
                }
    PPEventRegistryAPI/PPEventRegistryAPITests/Classes/Utility/PPResultSpec.swift on lines 95..99

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

    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

            it("Recent Articles return an appropriate error in case of transport error") {
                PPTransport.stubErrorResponse()
                
                waitUntil { done in
                    api.getRecentArticles(count: 10) { result in
    PPEventRegistryAPI/PPEventRegistryAPITests/Classes/PPEventRegistryAPISpec.swift on lines 102..111
    PPEventRegistryAPI/PPEventRegistryAPITests/Classes/PPEventRegistryAPISpec.swift on lines 113..122

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

    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

            it("Get Event returns an appropriate error in case of transport error") {
                PPTransport.stubErrorResponse()
                
                waitUntil { done in
                    api.getEvent(withID: 44808387) { result in
    PPEventRegistryAPI/PPEventRegistryAPITests/Classes/PPEventRegistryAPISpec.swift on lines 113..122
    PPEventRegistryAPI/PPEventRegistryAPITests/Classes/PPEventRegistryAPISpec.swift on lines 148..157

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

    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

            it("Get Event returns an appropriate error in case of an empty response") {
                PPGetEventOperation.stubEmptyResponse()
                
                waitUntil { done in
                    api.getEvent(withID: 44808387) { result in
    PPEventRegistryAPI/PPEventRegistryAPITests/Classes/PPEventRegistryAPISpec.swift on lines 102..111
    PPEventRegistryAPI/PPEventRegistryAPITests/Classes/PPEventRegistryAPISpec.swift on lines 148..157

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

    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 spec has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        override func spec() {
    
            var loginOperation = PPLoginOperation(email: "a@b.c",
                                                  password: "q",
                                                  completionHandler: {_ in})

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

              it("accepts 100 as a max articles count") {
                  getRecentArticles = PPRecentArticlesOperation(count: 100) {_ in}
                  let params = getRecentArticles.parameters
                  expect(params["recentActivityArticlesMaxArticleCount"] as? Int).to(equal(100))
              }
      PPEventRegistryAPI/PPEventRegistryAPITests/Classes/API/Operations/PPGetRecentAriclesSpec.swift on lines 60..64
      PPEventRegistryAPI/PPEventRegistryAPITests/Classes/API/Operations/PPGetRecentAriclesSpec.swift on lines 72..76
      PPEventRegistryAPI/PPEventRegistryAPITests/Classes/API/Operations/PPGetRecentAriclesSpec.swift on lines 78..82
      PPEventRegistryAPI/PPEventRegistryAPITests/Classes/API/Operations/PPGetRecentAriclesSpec.swift on lines 84..88

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

      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

              it("does not accept negative number as a max articles count") {
                  getRecentArticles = PPRecentArticlesOperation(count: -10) {_ in}
                  let params = getRecentArticles.parameters
                  expect(params["recentActivityArticlesMaxArticleCount"] as? Int).to(equal(5))
              }
      PPEventRegistryAPI/PPEventRegistryAPITests/Classes/API/Operations/PPGetRecentAriclesSpec.swift on lines 60..64
      PPEventRegistryAPI/PPEventRegistryAPITests/Classes/API/Operations/PPGetRecentAriclesSpec.swift on lines 66..70
      PPEventRegistryAPI/PPEventRegistryAPITests/Classes/API/Operations/PPGetRecentAriclesSpec.swift on lines 78..82
      PPEventRegistryAPI/PPEventRegistryAPITests/Classes/API/Operations/PPGetRecentAriclesSpec.swift on lines 84..88

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

      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

              it("does not accept zero as a max articles count") {
                  getRecentArticles = PPRecentArticlesOperation(count: 0) {_ in}
                  let params = getRecentArticles.parameters
                  expect(params["recentActivityArticlesMaxArticleCount"] as? Int).to(equal(5))
              }
      PPEventRegistryAPI/PPEventRegistryAPITests/Classes/API/Operations/PPGetRecentAriclesSpec.swift on lines 60..64
      PPEventRegistryAPI/PPEventRegistryAPITests/Classes/API/Operations/PPGetRecentAriclesSpec.swift on lines 66..70
      PPEventRegistryAPI/PPEventRegistryAPITests/Classes/API/Operations/PPGetRecentAriclesSpec.swift on lines 72..76
      PPEventRegistryAPI/PPEventRegistryAPITests/Classes/API/Operations/PPGetRecentAriclesSpec.swift on lines 84..88

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

      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

              it("does not accept too big articles count") {
                  getRecentArticles = PPRecentArticlesOperation(count: 10000) {_ in}
                  let params = getRecentArticles.parameters
                  expect(params["recentActivityArticlesMaxArticleCount"] as? Int).to(equal(5))
              }
      PPEventRegistryAPI/PPEventRegistryAPITests/Classes/API/Operations/PPGetRecentAriclesSpec.swift on lines 60..64
      PPEventRegistryAPI/PPEventRegistryAPITests/Classes/API/Operations/PPGetRecentAriclesSpec.swift on lines 66..70
      PPEventRegistryAPI/PPEventRegistryAPITests/Classes/API/Operations/PPGetRecentAriclesSpec.swift on lines 72..76
      PPEventRegistryAPI/PPEventRegistryAPITests/Classes/API/Operations/PPGetRecentAriclesSpec.swift on lines 78..82

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

      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

              it("correctly configures max articles count") {
                  getRecentArticles = PPRecentArticlesOperation(count: 10) {_ in}
                  let params = getRecentArticles.parameters
                  expect(params["recentActivityArticlesMaxArticleCount"] as? Int).to(equal(10))
              }
      PPEventRegistryAPI/PPEventRegistryAPITests/Classes/API/Operations/PPGetRecentAriclesSpec.swift on lines 66..70
      PPEventRegistryAPI/PPEventRegistryAPITests/Classes/API/Operations/PPGetRecentAriclesSpec.swift on lines 72..76
      PPEventRegistryAPI/PPEventRegistryAPITests/Classes/API/Operations/PPGetRecentAriclesSpec.swift on lines 78..82
      PPEventRegistryAPI/PPEventRegistryAPITests/Classes/API/Operations/PPGetRecentAriclesSpec.swift on lines 84..88

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

      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 func stubSuccess() {
              stub(condition: { (request) -> Bool in
                  true
              }) { (response) -> OHHTTPStubsResponse in
                  return OHHTTPStubsResponse(jsonObject: successResponseData(), statusCode: 200, headers: nil)
      PPEventRegistryAPI/PPEventRegistryAPITests/Classes/API/Operations/PPGetRecentAricles+Fixture.swift on lines 15..21

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

          class func stubSuccess() {
              stub(condition: { (request) -> Bool in
                  true
              }) { (response) -> OHHTTPStubsResponse in
                  return OHHTTPStubsResponse(jsonObject: successResponseData(), statusCode: 200, headers: nil)
      PPEventRegistryAPI/PPEventRegistryAPITests/Classes/API/Operations/PPGetEventOperation+Fixture.swift on lines 15..21

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

                      it("Maps articles correctly") {
                          let articles: [PPArticle] = modelMapper.mapDataToModelObjects(PPRecentArticlesOperation.successResponseData())
                          expect(articles).to(haveCount(3))
                      }
      PPEventRegistryAPI/PPEventRegistryAPITests/Classes/API/Models/PPModelMapperSpec.swift on lines 76..79

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

      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