frapposelli/vagrant-vcloud

View on GitHub
lib/vagrant-vcloud/command.rb

Summary

Maintainability
C
1 day
Test Coverage

Method command_vcloud_network has 98 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      def command_vcloud_network(cfg, vapp_id, ssh_host)
        # FIXME: this needs to be fixed to accomodate the bridged scenario
        # potentially showing only the assigned IPs in the VMs

        puts 'Fetching vCloud Director network settings ...'
Severity: Major
Found in lib/vagrant-vcloud/command.rb - About 3 hrs to fix

Method command_vcloud_network has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
Open

      def command_vcloud_network(cfg, vapp_id, ssh_host)
        # FIXME: this needs to be fixed to accomodate the bridged scenario
        # potentially showing only the assigned IPs in the VMs

        puts 'Fetching vCloud Director network settings ...'
Severity: Minor
Found in lib/vagrant-vcloud/command.rb - About 3 hrs 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 execute has 58 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      def execute
        options = {}
        opts = OptionParser.new do |o|
          o.banner = 'Usage: vagrant vcloud [options]'

Severity: Major
Found in lib/vagrant-vcloud/command.rb - About 2 hrs to fix

Method execute has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

      def execute
        options = {}
        opts = OptionParser.new do |o|
          o.banner = 'Usage: vagrant vcloud [options]'

Severity: Minor
Found in lib/vagrant-vcloud/command.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

There are no issues that match your filters.

Category
Status