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 = {},
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 = {},
- Read upRead up
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
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'
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
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?
- Read upRead up
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
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'
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
- Read upRead up
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' }
- Read upRead up
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
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,
- Read upRead up
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?
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,
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' }
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
- Read upRead up
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]
- Read upRead up
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]
- Read upRead up
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
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']