Showing 167 of 167 total issues

Method execute_update has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def execute_update
      tools_to_update = [GEM_NAME]
      updater = Gem::CommandManager.instance[:update]
      cleaner = Gem::CommandManager.instance[:cleanup]

Severity: Minor
Found in app/services/update_fastlane_ci_service.rb - About 1 hr to fix

    Function exports has 32 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    module.exports = function (config) {
      config.set({
        basePath: '',
        frameworks: ['jasmine', '@angular/cli'],
        plugins: [
    Severity: Minor
    Found in karma.conf.js - About 1 hr to fix

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

          it('should show time selection when trigger is nightly', () => {
            component.form.patchValue({'trigger': 'nightly'});
            fixture.detectChanges();
      
            expectElementToExist(fixtureEl, '.fci-hour-select');
      web/app/dashboard/add-project-dialog/add-project-dialog.component.spec.ts on lines 233..239

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

      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

      Method ensure_logged_in has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          def ensure_logged_in(route = nil)
            if route.nil?
              if defined?(self::HOME)
                route = "#{self::HOME}*"
              else
      Severity: Minor
      Found in app/shared/authentication_request_checker.rb - About 1 hr 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

      Method to_object_dictionary has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

            def to_object_dictionary(ignore_instance_variables: [])
              object_hash = {}
              instance_variables.each do |var|
                next if ignore_instance_variables.include?(var)
                # If we encounter with a `var` which value is an `Array`, we should iterate
      Severity: Minor
      Found in app/shared/json_convertible.rb - About 1 hr 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

      Method start_workers_for_project_and_credential has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          def start_workers_for_project_and_credential(project: nil, provider_credential: nil, notification_service:)
            user_responsible = provider_credential.ci_user
      
            if user_responsible.nil?
              name = project.project_name
      Severity: Minor
      Found in app/services/worker_service.rb - About 1 hr 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

      Method handle_exception has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          def handle_exception(ex, console_message: nil, exception_context: {})
            unless console_message.nil?
              logger.error(console_message)
            end
            logger.error(ex)
      Severity: Minor
      Found in app/shared/models/git_repo.rb - About 1 hr 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

      Method from_json! has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

            def from_json!(json_object)
              instance, json_object = _initialize_using!(json_object)
              json_object.each do |var, val|
                # If we encounter with a value that is represented by an array, iterate over it.
                if val.kind_of?(Array)
      Severity: Minor
      Found in app/shared/json_convertible.rb - About 1 hr 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

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

          it('should not show time selection when trigger is not nightly', () => {
            component.form.patchValue({'trigger': 'commit'});
            fixture.detectChanges();
      
            expectElementNotToExist(fixtureEl, '.fci-hour-select');
      web/app/dashboard/add-project-dialog/add-project-dialog.component.spec.ts on lines 225..231

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

      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

      Method do_build has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def do_build
            logger.debug("Running nightly build for #{project.project_name} (#{repo_full_name})")
            # TODO: build_service could be injected instead of referenced like this
            build_service = FastlaneCI::Services.build_service
      
      
      Severity: Minor
      Found in app/workers/nightly_build_github_worker.rb - About 1 hr to fix

        Method register_available_controllers has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def self.register_available_controllers
              # require all controllers
              require_relative "app/features/all"
              # Load up all the available controllers
        
        
        Severity: Minor
        Found in launch.rb - About 1 hr to fix

          Method enqueue_builds_for_open_github_prs_with_no_status has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              def self.enqueue_builds_for_open_github_prs_with_no_status(projects: nil, github_service: nil)
                logger.debug("Searching for open PRs with no status and starting a build for them")
                projects.each do |project|
                  # Don't enqueue builds for the open pull requests if we don't have a pull request trigger defined for it
                  next if project.find_triggers_of_type(trigger_type: :pull_request).first.nil?
          Severity: Minor
          Found in launch.rb - About 1 hr to fix

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

                    it('should show last successful build number', () => {
                      expect(getElementText(headerEls[2])).toBe('LAST SUCCESSFUL BUILD');
                      expect(getElementText(contentsEls[2])).toBe('2');
                    });
            Severity: Major
            Found in web/app/project/project.component.spec.ts and 3 other locations - About 1 hr to fix
            web/app/project/project.component.spec.ts on lines 294..297
            web/app/project/project.component.spec.ts on lines 299..302
            web/app/project/project.component.spec.ts on lines 309..312

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

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

                    it('should show lane', () => {
                      expect(getElementText(headerEls[1])).toBe('LANE');
                      expect(getElementText(contentsEls[1])).toBe('ios test');
                    });
            Severity: Major
            Found in web/app/project/project.component.spec.ts and 3 other locations - About 1 hr to fix
            web/app/project/project.component.spec.ts on lines 294..297
            web/app/project/project.component.spec.ts on lines 304..307
            web/app/project/project.component.spec.ts on lines 309..312

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

            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('should show build branch', () => {
                      expect(detailsEl.nativeElement.innerText).toContain('BRANCH');
                      expect(detailsEl.nativeElement.innerText).toContain('test-branch');
                    });
            Severity: Major
            Found in web/app/build/build.component.spec.ts and 2 other locations - About 1 hr to fix
            web/app/build/build.component.spec.ts on lines 253..256
            web/app/build/build.component.spec.ts on lines 263..266

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

            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('should show build trigger', () => {
                      expect(detailsEl.nativeElement.innerText).toContain('TRIGGER');
                      expect(detailsEl.nativeElement.innerText).toContain('commit');
                    });
            Severity: Major
            Found in web/app/build/build.component.spec.ts and 2 other locations - About 1 hr to fix
            web/app/build/build.component.spec.ts on lines 258..261
            web/app/build/build.component.spec.ts on lines 263..266

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

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

                    it('should show Repo name', () => {
                      expect(getElementText(headerEls[0])).toBe('REPO');
                      expect(getElementText(contentsEls[0])).toBe('fastlane/TacoRocat');
                    });
            Severity: Major
            Found in web/app/project/project.component.spec.ts and 3 other locations - About 1 hr to fix
            web/app/project/project.component.spec.ts on lines 299..302
            web/app/project/project.component.spec.ts on lines 304..307
            web/app/project/project.component.spec.ts on lines 309..312

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

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

                    it('should show last failed build number', () => {
                      expect(getElementText(headerEls[3])).toBe('LAST FAILED BUILD');
                      expect(getElementText(contentsEls[3])).toBe('1');
                    });
            Severity: Major
            Found in web/app/project/project.component.spec.ts and 3 other locations - About 1 hr to fix
            web/app/project/project.component.spec.ts on lines 294..297
            web/app/project/project.component.spec.ts on lines 299..302
            web/app/project/project.component.spec.ts on lines 304..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 59.

            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('should have nested master section label', () => {
                const sectionLabelEls =
                    fixture.debugElement.queryAll(By.css('.fci-master-section-label'));
                expect(sectionLabelEls.length).toBe(1);
              });
            web/app/common/components/master-detail-card/master-detail-card.component.spec.ts on lines 43..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 59.

            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('should show shortened SHA', () => {
                      expect(detailsEl.nativeElement.innerText).toContain('SHA');
                      expect(detailsEl.nativeElement.innerText).toContain('5903a0');
                    });
            Severity: Major
            Found in web/app/build/build.component.spec.ts and 2 other locations - About 1 hr to fix
            web/app/build/build.component.spec.ts on lines 253..256
            web/app/build/build.component.spec.ts on lines 258..261

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

            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