petems/vagrant-puppet-install

View on GitHub

Showing 5 of 5 total issues

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

        def install(version, env)
          shell_escaped_version = Shellwords.escape(version)

          @machine.communicate.tap do |comm|
            comm.upload(@script_tmp_path, install_script_name)
Severity: Minor
Found in lib/vagrant-puppet-install/action/install_puppet.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 default_install_url has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

        def default_install_url
          if @machine.config.puppet_install.puppet_version.nil?
            nil
          elsif windows_guest?
            # No Windows Version yet
Severity: Minor
Found in lib/vagrant-puppet-install/action/install_puppet.rb - About 45 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 installed_version has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        def installed_version
          version = nil
          opts = nil
          if windows_guest?
            # Not sure how to do this yet...
Severity: Minor
Found in lib/vagrant-puppet-install/action/install_puppet.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 recover has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        def recover(_env)
          if @script_tmp_path && File.exist?(@script_tmp_path)
            # Try extra hard to unlink the file so that it reliably works
            # on Windows hosts as well, see:
            # http://alx.github.io/2009/01/27/ruby-wundows-unlink.html
Severity: Minor
Found in lib/vagrant-puppet-install/action/install_puppet.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 call has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def call(env)
          @app.call(env)

          return unless @machine.communicate.ready? && provision_enabled?(env)

Severity: Minor
Found in lib/vagrant-puppet-install/action/install_puppet.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