fgrehm/ventriloquist

View on GitHub

Showing 6 of 21 total issues

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

          def self.go_install(machine, version)
            if machine.communicate.test('which go > /dev/null')
              machine.env.ui.info("Skipping go installation")
              return
            end
Severity: Minor
Found in lib/ventriloquist/cap/platforms/debian/go_install.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 install_packages has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

          def self.install_packages(machine, packages, opts = {})
            packages = Array(packages).flatten
            machine.communicate.tap do |comm|
              # Based on http://askubuntu.com/a/17829
              packages_to_install = packages - installed_packages(machine)
Severity: Minor
Found in lib/ventriloquist/cap/utils/debian/install_packages.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 elixir_install has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

          def self.elixir_install(machine,version)
            @version = version

            machine.communicate.tap do |comm|
              if comm.test('which iex > /dev/null')
Severity: Minor
Found in lib/ventriloquist/cap/platforms/debian/elixir_install.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 download_with_curl has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

          def self.download_with_curl(machine, srcs, destination)
            Array(srcs).each_with_index do |src, idx|
              machine.env.ui.info("Attempting to download '#{src}' to '#{destination}'")
              begin
                machine.communicate.execute("curl #{src} -o #{destination} || { rm -f #{destination} && exit 1; }")
Severity: Minor
Found in lib/ventriloquist/cap/utils/linux/download.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 download_with_wget has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

          def self.download_with_wget(machine, srcs, destination)
            Array(srcs).each_with_index do |src, idx|
              machine.env.ui.info("Attempting to download '#{src}' to '#{destination}'")
              begin
                machine.communicate.execute("wget #{src} -O #{destination} || { rm -f #{destination} && exit 1; }")
Severity: Minor
Found in lib/ventriloquist/cap/utils/linux/download.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 provision_services has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def provision_services
        return if config.services.empty?

        @logger.info("Checking for Docker installation...")
        @installer.ensure_installed
Severity: Minor
Found in lib/ventriloquist/provisioner.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