elpassion/DropColour-iOS

View on GitHub

Showing 91 of 91 total issues

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

                    context("with 2 correct urls") {
                        it("should present alert") {
                            sut.infoViewDidTapAuthor(FakeAuthorProvider().authors.first!.copy(withType: .developer))
                            expect(spyPresenter.capturedPresentedViewController as? UIAlertController).notTo(beNil())
                        }
ELColorGameTests/TestCase/ViewControllers/InfoViewControllerSpec.swift on lines 120..141

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

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

                context("with type .Designer") {

                    it("should present alert") {
                        sut.infoViewDidTapAuthor(FakeAuthorProvider().authors.first!.copy(withType: .designer))
                        expect(spyPresenter.capturedPresentedViewController as? UIAlertController).notTo(beNil())
ELColorGameTests/TestCase/ViewControllers/InfoViewControllerSpec.swift on lines 96..116

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

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

    override func spec() {

        describe("InfoViewController") {

            var sut: InfoViewController!

    Function spec has 54 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        override func spec() {
    
            describe("Tracker") {
    
                var sut: Tracker!
    Severity: Major
    Found in ELColorGameTests/TestCase/TrackerSpec.swift - About 2 hrs to fix

      Function setupLayout has 42 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private func setupLayout() {
              topView.snp.makeConstraints {
                  guard let topViewSuperview = topView.superview else { return }
                  $0.top.equalTo(20)
                  $0.left.equalTo(16)
      Severity: Minor
      Found in ELColorGame/UI/Screens/Game/Views/GameView.swift - About 1 hr to fix

        Function setupLayout has 38 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private func setupLayout() {
                blurEffectView.snp.makeConstraints {
                    $0.edges.equalToSuperview()
                }
                scoreView.snp.makeConstraints {
        Severity: Minor
        Found in ELColorGame/UI/Screens/GameOver/GameOverView.swift - About 1 hr to fix

          Function setupLayout has 36 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private func setupLayout() {
                  blurEffectView.snp.makeConstraints {
                      $0.edges.equalToSuperview()
                  }
                  scrollView.snp.makeConstraints {
          Severity: Minor
          Found in ELColorGame/UI/Screens/Info/Views/InfoView.swift - About 1 hr to fix

            Function setupLayout has 33 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private func setupLayout() {
                    avatarImageView.snp.makeConstraints {
                        $0.top.equalToSuperview()
                        $0.bottom.lessThanOrEqualTo(0)
                        $0.size.equalTo(CGSize(width: 80, height: 80))
            Severity: Minor
            Found in ELColorGame/UI/Screens/Info/Views/AuthorView.swift - About 1 hr to fix

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

                          describe("track game scored event") {
                              it("should send data with score") {
                                  sut.trackGameScoredEvent(scoredValue: 73)
                                  expect(gaiTrackerSpy.dataWasSend).to(beTrue())
                                  expect(gaiTrackerSpy.capturedData["value"] as? NSNumber).to(equal(73))
              Severity: Major
              Found in ELColorGameTests/TestCase/TrackerSpec.swift and 1 other location - About 1 hr to fix
              ELColorGameTests/TestCase/TrackerSpec.swift on lines 62..68

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 83.

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

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

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

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

              Refactorings

              Further Reading

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

                          describe("track event end") {
                              it("should send data with score") {
                                  sut.trackGameEndEvent(score: 46)
                                  expect(gaiTrackerSpy.dataWasSend).to(beTrue())
                                  expect(gaiTrackerSpy.capturedData["value"] as? NSNumber).to(equal(46))
              Severity: Major
              Found in ELColorGameTests/TestCase/TrackerSpec.swift and 1 other location - About 1 hr to fix
              ELColorGameTests/TestCase/TrackerSpec.swift on lines 70..76

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 83.

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

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

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

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

              Refactorings

              Further Reading

              Function setupLayout has 29 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  private func setupLayout() {
                      blurEffectView.snp.makeConstraints {
                          $0.edges.equalToSuperview()
                      }
                      resumeButton.snp.makeConstraints {
              Severity: Minor
              Found in ELColorGame/UI/Screens/Menu/MenuView.swift - About 1 hr to fix

                Function spec has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    override func spec() {
                
                        describe("GameViewController") {
                
                            var sut: GameViewController!

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

                      private let scoreTextLabel: UILabel = {
                          let label = UILabel(frame: .zero)
                          label.text = yourScore.localized
                          label.font = UIFont(font: FontFamily.BebasNeue.bold, size: 20)
                          label.textColor = UIColor(color: .white)
                  Severity: Major
                  Found in ELColorGame/UI/Screens/GameOver/GameOverView.swift and 1 other location - About 1 hr to fix
                  ELColorGame/UI/Screens/Game/Views/GameView.swift on lines 67..73

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

                      private let scoreTextLabel: UILabel = {
                          let label = UILabel(frame: .zero)
                          label.text = score.localized
                          label.font = UIFont(font: FontFamily.BebasNeue.bold, size: 17)
                          label.textColor = UIColor(color: .lightPurple7D75C7)
                  Severity: Major
                  Found in ELColorGame/UI/Screens/Game/Views/GameView.swift and 1 other location - About 1 hr to fix
                  ELColorGame/UI/Screens/GameOver/GameOverView.swift on lines 60..66

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

                      override func spec() {
                  
                          var sut: Author!
                  
                          describe("Login from url extension for Author") {
                  Severity: Minor
                  Found in ELColorGameTests/TestCase/Extension/AuthorLoginFromUrlSpec.swift - About 1 hr to fix

                    Function spec has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        override func spec() {
                            describe("DifficultyLevel") {
                    
                                var sut: DifficultyLevel!
                    
                    
                    Severity: Minor
                    Found in ELColorGameTests/TestCase/Logic/DifficultyLevelSpec.swift - About 1 hr to fix

                      Function setupLayout has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          private func setupLayout() {
                              backgroundView.snp.makeConstraints {
                                  $0.edges.equalToSuperview()
                              }
                      
                      
                      Severity: Minor
                      Found in ELColorGame/UI/Screens/Start/StartView.swift - About 1 hr to fix

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

                            private func boardVerticalMargin() -> CGFloat {
                                return (frame.size.height - (slotSize.height * CGFloat(rows)) - (spacing * CGFloat(rows - 1))) / 2
                            }
                        Severity: Minor
                        Found in ELColorGame/UI/Screens/Game/Views/GameBoardView.swift and 1 other location - About 1 hr to fix
                        ELColorGame/UI/Screens/Game/Views/GameBoardView.swift on lines 47..49

                        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

                            private func boardHorizontalMargin() -> CGFloat {
                                return (frame.size.width - (slotSize.width * CGFloat(columns)) - (spacing * CGFloat(columns - 1))) / 2
                            }
                        Severity: Minor
                        Found in ELColorGame/UI/Screens/Game/Views/GameBoardView.swift and 1 other location - About 1 hr to fix
                        ELColorGame/UI/Screens/Game/Views/GameBoardView.swift on lines 51..53

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

                                rankingButton.snp.makeConstraints {
                                    $0.top.equalTo(retryButton.snp.bottom).offset(15)
                                    $0.width.equalTo(200)
                                    $0.height.equalTo(50)
                                    $0.centerXWithinMargins.equalToSuperview()
                        Severity: Major
                        Found in ELColorGame/UI/Screens/GameOver/GameOverView.swift and 5 other locations - About 50 mins to fix
                        ELColorGame/UI/Screens/GameOver/GameOverView.swift on lines 91..96
                        ELColorGame/UI/Screens/Info/Views/LogoDescriptionView.swift on lines 46..51
                        ELColorGame/UI/Screens/Menu/MenuView.swift on lines 57..62
                        ELColorGame/UI/Screens/Start/StartView.swift on lines 73..78
                        ELColorGame/UI/Screens/Start/StartView.swift on lines 79..84

                        Duplicated Code

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

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

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

                        Tuning

                        This issue has a mass of 62.

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

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

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

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

                        Refactorings

                        Further Reading

                        Severity
                        Category
                        Status
                        Source
                        Language