tnarik/vagrant-solaris10

View on GitHub

Showing 4 of 4 total issues

Method mount_vmware_shared_folder has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

        def self.mount_vmware_shared_folder(machine, name, guestpath, options)
          owner = options[:owner]
          group = options[:group]
          machine.communicate.tap do |comm|
            if owner.is_a? Integer
Severity: Minor
Found in lib/vagrant-solaris10/cap/mount_vmware_shared_folder.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 mount_vmware_shared_folder has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        def self.mount_vmware_shared_folder(machine, name, guestpath, options)
          owner = options[:owner]
          group = options[:group]
          machine.communicate.tap do |comm|
            if owner.is_a? Integer
Severity: Minor
Found in lib/vagrant-solaris10/cap/mount_vmware_shared_folder.rb - About 1 hr to fix

    Method change_host_name has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

            def self.change_host_name(machine, name)
    
              # Only do this if the hostname is not already set
              machine.communicate.tap do |comm|
                if !comm.test("hostname | grep '#{name}", sudo: true)
    Severity: Minor
    Found in lib/vagrant-solaris10/cap/change_host_name.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 mount_nfs_folder has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

            def self.mount_nfs_folder(machine, ip, folders)
              folders.each do |name, opts|
                # Expand the guest path so we can handle things like "~/vagrant"
                expanded_guest_path = machine.guest.capability(
                  :shell_expand_guest_path, opts[:guestpath])
    Severity: Minor
    Found in lib/vagrant-solaris10/cap/mount_nfs_folder.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