reachlocal/boxci

View on GitHub

Showing 5 of 12 total issues

Method test has 54 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def test(options)
      File.open('/tmp/boxci.log', 'w') do |f|
        f.write('')
      end

Severity: Major
Found in lib/boxci/tester.rb - About 2 hrs to fix

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

        def generate_script
          snippets = []
          snippets << %q{#!/bin/bash --login}
          snippets << %q{BOXCI_TEST_RESULT=0}
          snippets << <<SNIPPET
    Severity: Minor
    Found in lib/boxci/test_runner.rb - About 1 hr to fix

      Method install_puppet_on_box has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

          def install_puppet_on_box
            say "Opening SSH tunnel into the box...", :blue if verbose?
            Net::SSH.start("default", nil, {:config => File.join(@project_workspace_folder, "ssh-config.local")}) do |ssh|
              puppet = ssh.exec! "which puppet"
              unless puppet
      Severity: Minor
      Found in lib/boxci/tester.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 spin_up_box has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          def spin_up_box
            inside @project_workspace_folder do
              if verbose?
                if !run "vagrant up --no-provision --provider #{provider}", :verbose => verbose?
                  raise Boxci::CommandFailed, "Failed to successfully run vagrant up --no-provision --provider #{provider}"
      Severity: Minor
      Found in lib/boxci/tester.rb - About 25 mins to fix

      Cognitive Complexity

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

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

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

      Further reading

      Method setup_ssh_config has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          def setup_ssh_config
            inside @project_workspace_folder do
              if verbose?
                if !run "vagrant ssh-config > ssh-config.local", :verbose => verbose?
                  raise Boxci::CommandFailed, "Failed to successfully run vagrant ssh-config > ssh-config.local"
      Severity: Minor
      Found in lib/boxci/tester.rb - About 25 mins to fix

      Cognitive Complexity

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

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

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

      Further reading

      Severity
      Category
      Status
      Source
      Language