Showing 167 of 167 total issues

File git_repo.rb has 551 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require "git"
require "tty-command"
require "securerandom"
require "digest"
require "task_queue"
Severity: Major
Found in app/shared/models/git_repo.rb - About 1 day to fix

    Method setup_repo has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
    Open

        def setup_repo
          retry_count ||= 0
          if File.directory?(local_folder)
            # TODO: test if this crashes if it's not a git directory
            begin
    Severity: Minor
    Found in app/shared/models/git_repo.rb - About 6 hrs 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

      describe('OnInit', () => {
        it('should route to home page if already logged in', () => {
          authService.isLoggedIn.and.returnValue(true);
          fixture.detectChanges();
    
    
    Severity: Major
    Found in web/app/login/login.component.spec.ts and 1 other location - About 5 hrs to fix
    web/app/signup/signup.component.spec.ts on lines 54..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 143.

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

      describe('OnInit', () => {
        it('should route to home page if already logged in', () => {
          authService.isLoggedIn.and.returnValue(true);
          fixture.detectChanges();
    
    
    Severity: Major
    Found in web/app/signup/signup.component.spec.ts and 1 other location - About 5 hrs to fix
    web/app/login/login.component.spec.ts on lines 54..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 143.

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

        def run(new_line_block:, completion_block:)
          if lane.nil?
            raise "Before calling `.run` on #{self}, you have to call `.setup` to finish preparing the BuildRunner"
          end
    
    
    Severity: Major
    Found in app/features/build_runner/fastlane_build_runner.rb - About 5 hrs to fix

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

        const mockLocalStorage = {
          getItem: (key: string): string => {
            return key in mockStorage ? mockStorage[key] : null;
          },
          setItem: (key: string, value: string) => {
      Severity: Major
      Found in web/app/services/auth.service.spec.ts and 1 other location - About 4 hrs to fix
      web/app/services/auth.interceptor.spec.ts on lines 18..31

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

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

        const mockLocalStorage = {
          getItem: (key: string): string => {
            return key in mockStorage ? mockStorage[key] : null;
          },
          setItem: (key: string, value: string) => {
      Severity: Major
      Found in web/app/services/auth.interceptor.spec.ts and 1 other location - About 4 hrs to fix
      web/app/services/auth.service.spec.ts on lines 17..30

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

      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 run has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
      Open

          def run(new_line_block:, completion_block:)
            if lane.nil?
              raise "Before calling `.run` on #{self}, you have to call `.setup` to finish preparing the BuildRunner"
            end
      
      
      Severity: Minor
      Found in app/features/build_runner/fastlane_build_runner.rb - About 4 hrs 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

      Class GitRepo has 31 methods (exceeds 20 allowed). Consider refactoring.
      Open

        class GitRepo
          # rubocop:enable Metrics/ClassLength
          include FastlaneCI::Logging
      
          DEFAULT_REMOTE = "origin"
      Severity: Minor
      Found in app/shared/models/git_repo.rb - About 3 hrs to fix

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

            it('should set repo option', () => {
              component.form.patchValue({'repo': 'fastlane/fastlane'});
              fixture.detectChanges();
        
              expect(repoSelectEl.textContent).toBe('fastlane/fastlane');
        web/app/dashboard/add-project-dialog/add-project-dialog.component.spec.ts on lines 156..166

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

        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

                 fixture.whenStable().then(() => {
                   component.form.patchValue({'lane': 'ios test'});
                   fixture.detectChanges();
        
                   expect(laneSelectEl.textContent).toBe('ios test');
        web/app/dashboard/add-project-dialog/add-project-dialog.component.spec.ts on lines 139..149

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

        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

        File build_runner.rb has 304 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        require_relative "../../shared/models/artifact"
        require_relative "./build_runner_output_row"
        
        # ideally we'd have a nicer way to inject this
        require_relative "../../features/build/build_controller"
        Severity: Minor
        Found in app/features/build_runner/build_runner.rb - About 3 hrs to fix

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

                it('should show build description after loading', () => {
                  expectElementNotToExist(headerEl, '.fci-build-description');
          
                  buildSubject.next(mockBuild);
                  fixture.detectChanges();
          Severity: Major
          Found in web/app/build/build.component.spec.ts and 1 other location - About 3 hrs to fix
          web/app/build/build.component.spec.ts on lines 195..204

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

          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 show status icon after loading', () => {
                  expectElementNotToExist(headerEl, 'fci-status-icon');
          
                  buildSubject.next(mockBuild);
                  fixture.detectChanges();
          Severity: Major
          Found in web/app/build/build.component.spec.ts and 1 other location - About 3 hrs to fix
          web/app/build/build.component.spec.ts on lines 216..228

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

          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

            getRepos(): Observable<Repository[]> {
              const url = `${HOSTNAME}/repos`;
              return this.http.get<RepositoryResponse[]>(url).pipe(
                  map((repos) => repos.map((repo) => new Repository(repo))));
            }
          Severity: Major
          Found in web/app/services/data.service.ts and 1 other location - About 2 hrs to fix
          web/app/services/data.service.ts on lines 32..36

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

          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

            getProjects(): Observable<ProjectSummary[]> {
              const url = `${HOSTNAME}/projects`;
              return this.http.get<ProjectSummaryResponse[]>(url).pipe(map(
                  (projects) => projects.map((project) => new ProjectSummary(project))));
            }
          Severity: Major
          Found in web/app/services/data.service.ts and 1 other location - About 2 hrs to fix
          web/app/services/data.service.ts on lines 83..87

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

          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

          Class Services has 25 methods (exceeds 20 allowed). Consider refactoring.
          Open

            class Services
              class << self
                include FastlaneCI::Logging
              end
          
          
          Severity: Minor
          Found in app/services/services.rb - About 2 hrs to fix

            Method initialize has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
            Open

                def initialize
                  @mutex = Mutex.new
                  @busy = false
                  # TODO: do we need a thread here to do the work or does `scheduler.schedule` handle that?
                  @thread = Thread.new do
            Severity: Minor
            Found in app/workers/worker_base.rb - About 2 hrs 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

            File add-project-dialog.component.spec.ts has 272 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import {CommonModule} from '@angular/common';
            import {DebugElement} from '@angular/core';
            import {async, ComponentFixture, fakeAsync, TestBed} from '@angular/core/testing';
            import {FormsModule, ReactiveFormsModule} from '@angular/forms';
            import {MatButtonModule, MatDialogModule, MatDialogRef, MatIconModule, MatProgressSpinnerModule, MatSelectModule} from '@angular/material';

              Class FastlaneCIOutput has 23 methods (exceeds 20 allowed). Consider refactoring.
              Open

                class FastlaneCIOutput < FastlaneCore::Interface
                  # The block being called for each new line that should
                  # be stored in the log.
                  attr_reader :each_line_block
              
              
                Severity
                Category
                Status
                Source
                Language