cloudamatic/mu

View on GitHub
modules/mu/groomers/chef.rb

Summary

Maintainability
D
2 days
Test Coverage

Assignment Branch Condition size for saveChefMetadata is too high. [202/75]
Open

      def saveChefMetadata
        self.class.loadChefLib
        @server.getSSHConfig # why though
        MU.log "Saving #{@server.mu_name} Chef artifacts"

Severity: Minor
Found in modules/mu/groomers/chef.rb by rubocop

This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

Assignment Branch Condition size for run is too high. [199.9/75]
Open

      def run(purpose: "Chef run", update_runlist: true, max_retries: 5, output: true, override_runlist: nil, reboot_first_fail: false, timeout: 1800)
        self.class.loadChefLib
        if update_runlist and !@config['run_list'].nil?
          knifeAddToRunList(multiple: @config['run_list'])
        end
Severity: Minor
Found in modules/mu/groomers/chef.rb by rubocop

This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

Assignment Branch Condition size for bootstrap is too high. [186.2/75]
Open

      def bootstrap
        self.class.loadChefLib
        stashHostSSLCertSecret
        splunkVaultInit
        if !@config['cleaned_chef']
Severity: Minor
Found in modules/mu/groomers/chef.rb by rubocop

This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

Method run has a Cognitive Complexity of 125 (exceeds 75 allowed). Consider refactoring.
Open

      def run(purpose: "Chef run", update_runlist: true, max_retries: 5, output: true, override_runlist: nil, reboot_first_fail: false, timeout: 1800)
        self.class.loadChefLib
        if update_runlist and !@config['run_list'].nil?
          knifeAddToRunList(multiple: @config['run_list'])
        end
Severity: Minor
Found in modules/mu/groomers/chef.rb - About 1 day 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

Perceived complexity for run is too high. [65/35]
Open

      def run(purpose: "Chef run", update_runlist: true, max_retries: 5, output: true, override_runlist: nil, reboot_first_fail: false, timeout: 1800)
        self.class.loadChefLib
        if update_runlist and !@config['run_list'].nil?
          knifeAddToRunList(multiple: @config['run_list'])
        end
Severity: Minor
Found in modules/mu/groomers/chef.rb by rubocop

This cop tries to produce a complexity score that's a measure of the complexity the reader experiences when looking at a method. For that reason it considers when nodes as something that doesn't add as much complexity as an if or a &&. Except if it's one of those special case/when constructs where there's no expression after case. Then the cop treats it as an if/elsif/elsif... and lets all the when nodes count. In contrast to the CyclomaticComplexity cop, this cop considers else nodes as adding complexity.

Example:

def my_method                   # 1
  if cond                       # 1
    case var                    # 2 (0.8 + 4 * 0.2, rounded)
    when 1 then func_one
    when 2 then func_two
    when 3 then func_three
    when 4..10 then func_other
    end
  else                          # 1
    do_something until a && b   # 2
  end                           # ===
end                             # 7 complexity points

Cyclomatic complexity for run is too high. [57/30]
Open

      def run(purpose: "Chef run", update_runlist: true, max_retries: 5, output: true, override_runlist: nil, reboot_first_fail: false, timeout: 1800)
        self.class.loadChefLib
        if update_runlist and !@config['run_list'].nil?
          knifeAddToRunList(multiple: @config['run_list'])
        end
Severity: Minor
Found in modules/mu/groomers/chef.rb by rubocop

This cop checks that the cyclomatic complexity of methods is not higher than the configured maximum. The cyclomatic complexity is the number of linearly independent paths through a method. The algorithm counts decision points and adds one.

An if statement (or unless or ?:) increases the complexity by one. An else branch does not, since it doesn't add a decision point. The && operator (or keyword and) can be converted to a nested if statement, and ||/or is shorthand for a sequence of ifs, so they also add one. Loops can be said to have an exit condition, so they add one.

Class Chef has 30 methods (exceeds 20 allowed). Consider refactoring.
Open

    class Chef

      Object.class_eval {
        def self.const_missing(symbol)
          if symbol.to_sym == :Chef or symbol.to_sym == :ChefVault
Severity: Minor
Found in modules/mu/groomers/chef.rb - About 3 hrs to fix

    Assignment Branch Condition size for purge is too high. [79.71/75]
    Open

          def self.purge(node, vaults_to_clean = [], noop = false, nodeonly: false)
            loadChefLib
            MU.log "Deleting Chef resources associated with #{node}"
            if !nodeonly
              vaults_to_clean.each { |vault|
    Severity: Minor
    Found in modules/mu/groomers/chef.rb by rubocop

    This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

    Cyclomatic complexity for bootstrap is too high. [33/30]
    Open

          def bootstrap
            self.class.loadChefLib
            stashHostSSLCertSecret
            splunkVaultInit
            if !@config['cleaned_chef']
    Severity: Minor
    Found in modules/mu/groomers/chef.rb by rubocop

    This cop checks that the cyclomatic complexity of methods is not higher than the configured maximum. The cyclomatic complexity is the number of linearly independent paths through a method. The algorithm counts decision points and adds one.

    An if statement (or unless or ?:) increases the complexity by one. An else branch does not, since it doesn't add a decision point. The && operator (or keyword and) can be converted to a nested if statement, and ||/or is shorthand for a sequence of ifs, so they also add one. Loops can be said to have an exit condition, so they add one.

    Perceived complexity for bootstrap is too high. [38/35]
    Open

          def bootstrap
            self.class.loadChefLib
            stashHostSSLCertSecret
            splunkVaultInit
            if !@config['cleaned_chef']
    Severity: Minor
    Found in modules/mu/groomers/chef.rb by rubocop

    This cop tries to produce a complexity score that's a measure of the complexity the reader experiences when looking at a method. For that reason it considers when nodes as something that doesn't add as much complexity as an if or a &&. Except if it's one of those special case/when constructs where there's no expression after case. Then the cop treats it as an if/elsif/elsif... and lets all the when nodes count. In contrast to the CyclomaticComplexity cop, this cop considers else nodes as adding complexity.

    Example:

    def my_method                   # 1
      if cond                       # 1
        case var                    # 2 (0.8 + 4 * 0.2, rounded)
        when 1 then func_one
        when 2 then func_two
        when 3 then func_three
        when 4..10 then func_other
        end
      else                          # 1
        do_something until a && b   # 2
      end                           # ===
    end                             # 7 complexity points

    Method run has 168 lines of code (exceeds 150 allowed). Consider refactoring.
    Open

          def run(purpose: "Chef run", update_runlist: true, max_retries: 5, output: true, override_runlist: nil, reboot_first_fail: false, timeout: 1800)
            self.class.loadChefLib
            if update_runlist and !@config['run_list'].nil?
              knifeAddToRunList(multiple: @config['run_list'])
            end
    Severity: Major
    Found in modules/mu/groomers/chef.rb - About 1 hr to fix

      Use =~ in places where the MatchData returned by #match will not be used.
      Open

                      if data.match(/#{error_signal}/)
      Severity: Minor
      Found in modules/mu/groomers/chef.rb by rubocop

      This cop identifies the use of Regexp#match or String#match, which returns #<MatchData>/nil. The return value of =~ is an integral index/nil and is more performant.

      Example:

      # bad
      do_something if str.match(/regex/)
      while regex.match('str')
        do_something
      end
      
      # good
      method(str =~ /regex/)
      return value unless regex =~ 'str'

      Use =~ in places where the MatchData returned by #match will not be used.
      Open

                  if entry.match(/^role\[(.+?)\]/)
      Severity: Minor
      Found in modules/mu/groomers/chef.rb by rubocop

      This cop identifies the use of Regexp#match or String#match, which returns #<MatchData>/nil. The return value of =~ is an integral index/nil and is more performant.

      Example:

      # bad
      do_something if str.match(/regex/)
      while regex.match('str')
        do_something
      end
      
      # good
      method(str =~ /regex/)
      return value unless regex =~ 'str'

      Use =~ in places where the MatchData returned by #match will not be used.
      Open

                    if path.match(/\/gems\/chef\-\d+\.\d+\.\d+\/lib$/)
      Severity: Minor
      Found in modules/mu/groomers/chef.rb by rubocop

      This cop identifies the use of Regexp#match or String#match, which returns #<MatchData>/nil. The return value of =~ is an integral index/nil and is more performant.

      Example:

      # bad
      do_something if str.match(/regex/)
      while regex.match('str')
        do_something
      end
      
      # good
      method(str =~ /regex/)
      return value unless regex =~ 'str'

      Use each_value instead of values.each.
      Open

                      deploy.deployment["databases"][dep['name']].values.each { |database|
      Severity: Minor
      Found in modules/mu/groomers/chef.rb by rubocop

      This cop checks for uses of each_key and each_value Hash methods.

      Note: If you have an array of two-element arrays, you can put parentheses around the block arguments to indicate that you're not working with a hash, and suppress RuboCop offenses.

      Example:

      # bad
      hash.keys.each { |k| p k }
      hash.values.each { |v| p v }
      hash.each { |k, _v| p k }
      hash.each { |_k, v| p v }
      
      # good
      hash.each_key { |k| p k }
      hash.each_value { |v| p v }

      Use =~ in places where the MatchData returned by #match will not be used.
      Open

                      raise MU::Cloud::BootstrapTempFail if data.match(/REBOOT_SCHEDULED| WARN: Reboot requested:|Rebooting server at a recipe's request|Chef::Exceptions::Reboot/)
      Severity: Minor
      Found in modules/mu/groomers/chef.rb by rubocop

      This cop identifies the use of Regexp#match or String#match, which returns #<MatchData>/nil. The return value of =~ is an integral index/nil and is more performant.

      Example:

      # bad
      do_something if str.match(/regex/)
      while regex.match('str')
        do_something
      end
      
      # good
      method(str =~ /regex/)
      return value unless regex =~ 'str'

      Use =~ in places where the MatchData returned by #match will not be used.
      Open

                  elsif entry.match(/^recipe\[(.+?)\]/)
      Severity: Minor
      Found in modules/mu/groomers/chef.rb by rubocop

      This cop identifies the use of Regexp#match or String#match, which returns #<MatchData>/nil. The return value of =~ is an integral index/nil and is more performant.

      Example:

      # bad
      do_something if str.match(/regex/)
      while regex.match('str')
        do_something
      end
      
      # good
      method(str =~ /regex/)
      return value unless regex =~ 'str'

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

                    entry_name = Regexp.last_match(1)
                    if recipe_list.nil?
                      query=%Q{#{MU::Groomer::Chef.knife} recipe list};
                      recipe_list = %x{#{query}}
                    end
      Severity: Minor
      Found in modules/mu/groomers/chef.rb and 1 other location - About 50 mins to fix
      modules/mu/groomers/chef.rb on lines 1141..1148

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

      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

                    entry_name = Regexp.last_match(1)
                    if role_list.nil?
                      query=%Q{#{MU::Groomer::Chef.knife} role list};
                      role_list = %x{#{query}}
                    end
      Severity: Minor
      Found in modules/mu/groomers/chef.rb and 1 other location - About 50 mins to fix
      modules/mu/groomers/chef.rb on lines 1151..1158

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

      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

              rescue SystemExit, Timeout::Error, MU::Cloud::BootstrapTempFail, Net::HTTPServerException, HTTPClient::ConnectTimeoutError, WinRM::WinRMError, Net::SSH::AuthenticationFailed, Net::SSH::Disconnect, Net::SSH::ConnectionTimeout, Net::SSH::Proxy::ConnectError, Net::SSH::Exception, Errno::ECONNRESET, Errno::EHOSTUNREACH, Errno::ECONNREFUSED, Errno::EPIPE, SocketError, IOError => e
                begin
                  ssh.close if !ssh.nil?
                rescue Net::SSH::Exception, IOError => e
                  if @server.windows?
      Severity: Minor
      Found in modules/mu/groomers/chef.rb and 1 other location - About 45 mins to fix
      modules/mu/groomers/chef.rb on lines 676..705

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

      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

              rescue SystemExit, Timeout::Error, MU::Cloud::BootstrapTempFail, Net::HTTPServerException, HTTPClient::ConnectTimeoutError, WinRM::WinRMError, Net::SSH::AuthenticationFailed, Net::SSH::Disconnect, Net::SSH::ConnectionTimeout, Net::SSH::Proxy::ConnectError, Net::SSH::Exception, Errno::ECONNRESET, Errno::EHOSTUNREACH, Errno::ECONNREFUSED, Errno::EPIPE, SocketError, IOError => e
                if retries < max_retries
                  retries += 1
                  # Bad Chef installs are possible culprits of bootstrap failures, so
                  # try scrubbing them when that happens.
      Severity: Minor
      Found in modules/mu/groomers/chef.rb and 1 other location - About 45 mins to fix
      modules/mu/groomers/chef.rb on lines 388..443

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

      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

              if !noop
                knife_cd = ::Chef::Knife::ClientDelete.new(['client', 'delete', node])
                knife_cd.config[:yes] = true
                begin
                  knife_cd.run
      Severity: Minor
      Found in modules/mu/groomers/chef.rb and 1 other location - About 15 mins to fix
      modules/mu/groomers/chef.rb on lines 869..875

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

      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

              if !noop
                knife_nd = ::Chef::Knife::NodeDelete.new(['node', 'delete', node])
                knife_nd.config[:yes] = true
                begin
                  knife_nd.run
      Severity: Minor
      Found in modules/mu/groomers/chef.rb and 1 other location - About 15 mins to fix
      modules/mu/groomers/chef.rb on lines 878..884

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

      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

      Redundant use of Object#to_s in interpolation.
      Open

                MU.log "Knife Bootstrap settings for #{@server.mu_name} (#{canonical_addr}), timeout set to #{timeout.to_s}", MU::NOTICE, details: kb.config
      Severity: Minor
      Found in modules/mu/groomers/chef.rb by rubocop

      This cop checks for string conversion in string interpolation, which is redundant.

      Example:

      # bad
      
      "result is #{something.to_s}"

      Example:

      # good
      
      "result is #{something}"

      Redundant use of Object#to_s in interpolation.
      Open

                  MU.log "Chef libraries loaded (took #{(Time.now-start).to_s} seconds)", MU::DEBUG
      Severity: Minor
      Found in modules/mu/groomers/chef.rb by rubocop

      This cop checks for string conversion in string interpolation, which is redundant.

      Example:

      # bad
      
      "result is #{something.to_s}"

      Example:

      # good
      
      "result is #{something}"

      } at 1074, 14 is not aligned with deploy.deployment["databases"][dep['name']].values.each { |database| at 1072, 16.
      Open

                    }
      Severity: Minor
      Found in modules/mu/groomers/chef.rb by rubocop

      This cop checks whether the end keywords are aligned properly for do end blocks.

      Three modes are supported through the EnforcedStyleAlignWith configuration parameter:

      start_of_block : the end shall be aligned with the start of the line where the do appeared.

      start_of_line : the end shall be aligned with the start of the line where the expression started.

      either (which is the default) : the end is allowed to be in either location. The autofixer will default to start_of_line.

      Example: EnforcedStyleAlignWith: either (default)

      # bad
      
      foo.bar
         .each do
           baz
             end
      
      # good
      
      variable = lambda do |i|
        i
      end

      Example: EnforcedStyleAlignWith: startofblock

      # bad
      
      foo.bar
         .each do
           baz
             end
      
      # good
      
      foo.bar
        .each do
           baz
         end

      Example: EnforcedStyleAlignWith: startofline

      # bad
      
      foo.bar
         .each do
           baz
             end
      
      # good
      
      foo.bar
        .each do
           baz
      end

      Do not suppress exceptions.
      Open

                rescue Net::HTTPServerException
      Severity: Minor
      Found in modules/mu/groomers/chef.rb by rubocop

      This cop checks for rescue blocks with no body.

      Example:

      # bad
      
      def some_method
        do_something
      rescue
        # do nothing
      end

      Example:

      # bad
      
      begin
        do_something
      rescue
        # do nothing
      end

      Example:

      # good
      
      def some_method
        do_something
      rescue
        handle_exception
      end

      Example:

      # good
      
      begin
        do_something
      rescue
        handle_exception
      end

      Do not suppress exceptions.
      Open

                rescue Net::HTTPServerException
      Severity: Minor
      Found in modules/mu/groomers/chef.rb by rubocop

      This cop checks for rescue blocks with no body.

      Example:

      # bad
      
      def some_method
        do_something
      rescue
        # do nothing
      end

      Example:

      # bad
      
      begin
        do_something
      rescue
        # do nothing
      end

      Example:

      # good
      
      def some_method
        do_something
      rescue
        handle_exception
      end

      Example:

      # good
      
      begin
        do_something
      rescue
        handle_exception
      end

      Redundant use of Object#to_s in interpolation.
      Open

                MU.log "saveDeployData invoked on #{@server.to_s} before Chef has been bootstrapped!", MU::WARN, details: caller
      Severity: Minor
      Found in modules/mu/groomers/chef.rb by rubocop

      This cop checks for string conversion in string interpolation, which is redundant.

      Example:

      # bad
      
      "result is #{something.to_s}"

      Example:

      # good
      
      "result is #{something}"

      Redundant use of Object#to_s in interpolation.
      Open

                  MU.log "#{@server.mu_name}: Knife Bootstrap failed #{e.inspect}, retrying in #{(10*retries).to_s}s (#{retries} of #{max_retries})", MU::WARN, details: e.backtrace
      Severity: Minor
      Found in modules/mu/groomers/chef.rb by rubocop

      This cop checks for string conversion in string interpolation, which is redundant.

      Example:

      # bad
      
      "result is #{something.to_s}"

      Example:

      # good
      
      "result is #{something}"

      Unused method argument - windows. If it's necessary, use _ or _windows as an argument name to indicate that it won't be used. You can also write as available?(*) if you want the method to accept any arguments but don't care about them.
      Open

            def self.available?(windows = false)
      Severity: Minor
      Found in modules/mu/groomers/chef.rb by rubocop

      This cop checks for unused method arguments.

      Example:

      # bad
      
      def some_method(used, unused, _unused_but_allowed)
        puts used
      end

      Example:

      # good
      
      def some_method(used, _unused, _unused_but_allowed)
        puts used
      end

      end at 311, 16 is not aligned with if at 309, 32.
      Open

                      end
      Severity: Minor
      Found in modules/mu/groomers/chef.rb by rubocop

      This cop checks whether the end keywords are aligned properly.

      Three modes are supported through the EnforcedStyleAlignWith configuration parameter:

      If it's set to keyword (which is the default), the end shall be aligned with the start of the keyword (if, class, etc.).

      If it's set to variable the end shall be aligned with the left-hand-side of the variable assignment, if there is one.

      If it's set to start_of_line, the end shall be aligned with the start of the line where the matching keyword appears.

      Example: EnforcedStyleAlignWith: keyword (default)

      # bad
      
      variable = if true
          end
      
      # good
      
      variable = if true
                 end

      Example: EnforcedStyleAlignWith: variable

      # bad
      
      variable = if true
          end
      
      # good
      
      variable = if true
      end

      Example: EnforcedStyleAlignWith: startofline

      # bad
      
      variable = if true
          end
      
      # good
      
      puts(if true
      end)

      Do not suppress exceptions.
      Open

                rescue Net::HTTPServerException
      Severity: Minor
      Found in modules/mu/groomers/chef.rb by rubocop

      This cop checks for rescue blocks with no body.

      Example:

      # bad
      
      def some_method
        do_something
      rescue
        # do nothing
      end

      Example:

      # bad
      
      begin
        do_something
      rescue
        # do nothing
      end

      Example:

      # good
      
      def some_method
        do_something
      rescue
        handle_exception
      end

      Example:

      # good
      
      begin
        do_something
      rescue
        handle_exception
      end

      Do not suppress exceptions.
      Open

                rescue Net::HTTPServerException
      Severity: Minor
      Found in modules/mu/groomers/chef.rb by rubocop

      This cop checks for rescue blocks with no body.

      Example:

      # bad
      
      def some_method
        do_something
      rescue
        # do nothing
      end

      Example:

      # bad
      
      begin
        do_something
      rescue
        # do nothing
      end

      Example:

      # good
      
      def some_method
        do_something
      rescue
        handle_exception
      end

      Example:

      # good
      
      begin
        do_something
      rescue
        handle_exception
      end

      Do not suppress exceptions.
      Open

                    rescue StandardError => e
      Severity: Minor
      Found in modules/mu/groomers/chef.rb by rubocop

      This cop checks for rescue blocks with no body.

      Example:

      # bad
      
      def some_method
        do_something
      rescue
        # do nothing
      end

      Example:

      # bad
      
      begin
        do_something
      rescue
        # do nothing
      end

      Example:

      # good
      
      def some_method
        do_something
      rescue
        handle_exception
      end

      Example:

      # good
      
      begin
        do_something
      rescue
        handle_exception
      end

      Do not suppress exceptions.
      Open

              rescue LoadError
      Severity: Minor
      Found in modules/mu/groomers/chef.rb by rubocop

      This cop checks for rescue blocks with no body.

      Example:

      # bad
      
      def some_method
        do_something
      rescue
        # do nothing
      end

      Example:

      # bad
      
      begin
        do_something
      rescue
        # do nothing
      end

      Example:

      # good
      
      def some_method
        do_something
      rescue
        handle_exception
      end

      Example:

      # good
      
      begin
        do_something
      rescue
        handle_exception
      end

      Do not suppress exceptions.
      Open

                rescue Net::HTTPServerException
      Severity: Minor
      Found in modules/mu/groomers/chef.rb by rubocop

      This cop checks for rescue blocks with no body.

      Example:

      # bad
      
      def some_method
        do_something
      rescue
        # do nothing
      end

      Example:

      # bad
      
      begin
        do_something
      rescue
        # do nothing
      end

      Example:

      # good
      
      def some_method
        do_something
      rescue
        handle_exception
      end

      Example:

      # good
      
      begin
        do_something
      rescue
        handle_exception
      end

      Do not suppress exceptions.
      Open

              rescue MuNoSuchSecret
      Severity: Minor
      Found in modules/mu/groomers/chef.rb by rubocop

      This cop checks for rescue blocks with no body.

      Example:

      # bad
      
      def some_method
        do_something
      rescue
        # do nothing
      end

      Example:

      # bad
      
      begin
        do_something
      rescue
        # do nothing
      end

      Example:

      # good
      
      def some_method
        do_something
      rescue
        handle_exception
      end

      Example:

      # good
      
      begin
        do_something
      rescue
        handle_exception
      end

      There are no issues that match your filters.

      Category
      Status