acquia/moonshot

View on GitHub

Showing 12 of 12 total issues

Class GithubRelease has 22 methods (exceeds 20 allowed). Consider refactoring.
Open

  class GithubRelease # rubocop:disable Metrics/ClassLength
    extend Forwardable
    include Moonshot::ResourcesHelper
    include Moonshot::DoctorHelper
    include Moonshot::Shell
Severity: Minor
Found in lib/moonshot/build_mechanism/github_release.rb - About 2 hrs to fix

    Method run! has 34 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def run! # rubocop:disable Metrics/MethodLength
          # Commands defined as Moonshot::Commands require a properly
          # configured Moonshot.rb and supporting files. Without them, we only
          # support `--help` and `new`.
          return if handle_early_commands
    Severity: Minor
    Found in lib/moonshot/command_line.rb - About 1 hr to fix

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

          def run! # rubocop:disable Metrics/MethodLength
            # Commands defined as Moonshot::Commands require a properly
            # configured Moonshot.rb and supporting files. Without them, we only
            # support `--help` and `new`.
            return if handle_early_commands
      Severity: Minor
      Found in lib/moonshot/command_line.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 choose! has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          def choose!
            groups = @stack.resources_of_type('AWS::AutoScaling::AutoScalingGroup')
      
            asg = if groups.count == 1
                    groups.first
      Severity: Minor
      Found in lib/moonshot/ssh_target_selector.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 pre_create has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

            def pre_create(res)
              @ilog = res.ilog
      
              key_arn = find_or_create_kms_key
              pe = ParameterEncrypter.new(key_arn)
      Severity: Minor
      Found in lib/plugins/encrypted_parameters.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 find_or_create_kms_key has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

            def find_or_create_kms_key
              key_arn = nil
      
              @ilog.start_threaded "Checking for KMS Key #{@kms_key_parameter_name}" do |s|
                if Moonshot.config.parameters.key?(@kms_key_parameter_name)
      Severity: Minor
      Found in lib/plugins/encrypted_parameters.rb - About 55 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 tar has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

            def tar(target_files)
              tar_stream = StringIO.new
              Gem::Package::TarWriter.new(tar_stream) do |writer|
                # adding user files
                unless target_files.nil? || target_files.empty?
      Severity: Minor
      Found in lib/plugins/backup.rb - About 55 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 wait_for_job has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          def wait_for_job(job_number)
            authenticate
      
            # Wait for the job to complete or hit the timeout.
            start = Time.new
      Severity: Minor
      Found in lib/moonshot/build_mechanism/travis_deploy.rb - About 35 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 run_all_checks has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          def run_all_checks
            success = true
            puts
            puts self.class.name.split('::').last
            private_methods.each do |meth|
      Severity: Minor
      Found in lib/moonshot/doctor_helper.rb - About 35 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 display_changes has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          def display_changes
            wait_for_change_set unless @change_set
      
            @change_set.changes.map(&:resource_change).each do |c|
              puts "* #{c.action} #{c.logical_resource_id} (#{c.resource_type})"
      Severity: Minor
      Found in lib/moonshot/change_set.rb - About 35 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 get has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          def get(sp)
            return unless Moonshot.config.interactive
      
            @sp = sp
      
      
      Severity: Minor
      Found in lib/moonshot/ask_user_source.rb - About 35 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 confirm? has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          def confirm?
            raise 'Cannot confirm ChangeSet when interactive mode is disabled!' unless Moonshot.config.interactive
      
            loop do
              print 'Apply changes? '
      Severity: Minor
      Found in lib/moonshot/change_set.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