Parallels/vagrant-parallels

View on GitHub

Showing 62 of 82 total issues

Function Modernizr has 594 lines of code (exceeds 25 allowed). Consider refactoring.
Open

window.Modernizr = (function( window, document, undefined ) {

    var version = '2.6.1',

    Modernizr = {},
Severity: Major
Found in website/docs/source/javascripts/modernizr.js - About 2 days to fix

    Function Modernizr has a Cognitive Complexity of 115 (exceeds 5 allowed). Consider refactoring.
    Open

    window.Modernizr = (function( window, document, undefined ) {
    
        var version = '2.6.1',
    
        Modernizr = {},
    Severity: Minor
    Found in website/docs/source/javascripts/modernizr.js - About 2 days 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

    File modernizr.js has 596 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*!
     * Modernizr v2.6.1
     * www.modernizr.com
     *
     * Copyright (c) Faruk Ates, Paul Irish, Alex Sexton
    Severity: Major
    Found in website/docs/source/javascripts/modernizr.js - About 1 day to fix

      File base.rb has 518 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      require 'log4r'
      require 'nokogiri'
      
      require 'vagrant/util/busy'
      require 'vagrant/util/network_ip'
      Severity: Major
      Found in lib/vagrant-parallels/driver/base.rb - About 1 day to fix

        Class Base has 57 methods (exceeds 20 allowed). Consider refactoring.
        Open

              class Base
                # Include this so we can use `Subprocess` more easily.
                include Vagrant::Util::Retryable
                include Vagrant::Util::NetworkIP
        
        
        Severity: Major
        Found in lib/vagrant-parallels/driver/base.rb - About 1 day to fix

          Method detect_owner_group_ids has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
          Open

                  def detect_owner_group_ids(machine, guest_path, mount_options, options)
                    mount_uid = find_mount_options_id("uid", mount_options)
                    mount_gid = find_mount_options_id("gid", mount_options)
          
                    if mount_uid.nil?
          Severity: Minor
          Found in lib/vagrant-parallels/util/unix_mount_helpers.rb - About 6 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

          File action.rb has 347 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          require 'vagrant/action/builder'
          
          module VagrantPlugins
            module Parallels
              module Action
          Severity: Minor
          Found in lib/vagrant-parallels/action.rb - About 4 hrs to fix

            File network.rb has 322 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            require 'ipaddr'
            require 'set'
            require 'log4r'
            
            require 'vagrant/util/scoped_hash_override'
            Severity: Minor
            Found in lib/vagrant-parallels/action/network.rb - About 3 hrs to fix

              Method call has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
              Open

                      def call(env)
                        @env = env
              
                        # Get the list of network adapters from the configuration
                        network_adapters_config = env[:machine].provider_config.network_adapters.dup
              Severity: Minor
              Found in lib/vagrant-parallels/action/network.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 bridged_adapter has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
              Open

                      def bridged_adapter(config)
                        # Find the bridged interfaces that are available
                        bridgedifs = @env[:machine].provider.driver.read_bridged_interfaces
                        bridgedifs.delete_if { |interface| interface[:status] == 'Down' }
              
              
              Severity: Minor
              Found in lib/vagrant-parallels/action/network.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 call has 74 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      def call(env)
                        @env = env
              
                        # Get the list of network adapters from the configuration
                        network_adapters_config = env[:machine].provider_config.network_adapters.dup
              Severity: Major
              Found in lib/vagrant-parallels/action/network.rb - About 2 hrs to fix

                Method hostonly_config has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                Open

                        def hostonly_config(options)
                          options = {
                            auto_config: true,
                            mac: nil,
                            name: nil,
                Severity: Minor
                Found in lib/vagrant-parallels/action/network.rb - About 2 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 detect_owner_group_ids has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        def detect_owner_group_ids(machine, guest_path, mount_options, options)
                          mount_uid = find_mount_options_id("uid", mount_options)
                          mount_gid = find_mount_options_id("gid", mount_options)
                
                          if mount_uid.nil?
                Severity: Major
                Found in lib/vagrant-parallels/util/unix_mount_helpers.rb - About 2 hrs to fix

                  Method hostonly_config has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          def hostonly_config(options)
                            options = {
                              auto_config: true,
                              mac: nil,
                              name: nil,
                  Severity: Major
                  Found in lib/vagrant-parallels/action/network.rb - About 2 hrs to fix

                    Method bridged_adapter has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            def bridged_adapter(config)
                              # Find the bridged interfaces that are available
                              bridgedifs = @env[:machine].provider.driver.read_bridged_interfaces
                              bridgedifs.delete_if { |interface| interface[:status] == 'Down' }
                    
                    
                    Severity: Major
                    Found in lib/vagrant-parallels/action/network.rb - About 2 hrs to fix

                      Method action_start has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                      Open

                            def self.action_start
                              Vagrant::Action::Builder.new.tap do |b|
                                b.use BoxCheckOutdated
                                b.use Call, IsState, :running do |env1, b1|
                                  # If the VM is running, run the necessary provisioners
                      Severity: Minor
                      Found in lib/vagrant-parallels/action.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 action_destroy has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                      Open

                            def self.action_destroy
                              Vagrant::Action::Builder.new.tap do |b|
                                b.use ConfigValidate
                                b.use Call, IsState, :not_created do |env1, b1|
                                  if env1[:result]
                      Severity: Minor
                      Found in lib/vagrant-parallels/action.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 hostonly_find_matching_network has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                      Open

                              def hostonly_find_matching_network(config)
                                this_netaddr = IPAddr.new("#{config[:ip]}/#{config[:netmask]}")
                      
                                @env[:machine].provider.driver.read_host_only_interfaces.each do |interface|
                                  return interface if config[:name] && config[:name] == interface[:name]
                      Severity: Minor
                      Found in lib/vagrant-parallels/action/network.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_parallels_tools has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              def self.install_parallels_tools(machine)
                                machine.communicate.tap do |comm|
                                  # Get the host arch. This is safe even if an older x86-only Vagrant version is used.
                                  arch = `arch -64 uname -m`.chomp
                      
                      
                      Severity: Minor
                      Found in lib/vagrant-parallels/guest_cap/windows/install_parallels_tools.rb - About 1 hr to fix

                        Method call has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                def call(env)
                                  options = {}
                        
                                  # Disable requiring password for register and clone actions [GH-67].
                                  acts = ['clone-vm']
                        Severity: Minor
                        Found in lib/vagrant-parallels/action/import.rb - About 1 hr to fix
                          Severity
                          Category
                          Status
                          Source
                          Language