lib/vagrant-vcloud/action/build_vapp.rb
Method call
has a Cognitive Complexity of 90 (exceeds 5 allowed). Consider refactoring. Open
Open
def call(env)
# FIXME: we need to find a way to clean things up when a SIGINT get
# called... see env[:interrupted] in the vagrant code
cfg = env[:machine].provider_config
- Read upRead up
- Create a ticketCreate a ticket
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 243 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def call(env)
# FIXME: we need to find a way to clean things up when a SIGINT get
# called... see env[:interrupted] in the vagrant code
cfg = env[:machine].provider_config
- Create a ticketCreate a ticket
File build_vapp.rb
has 260 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require 'securerandom'
require 'etc'
require 'netaddr'
module VagrantPlugins
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
Open
if !net_id
raise 'vCloud User credentials has insufficient privileges'
end
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
Open
if !net_id
# TEMP FIX: permissions issues at the Org Level for vApp authors
# to "view" Org vDC Networks but they can see them at the
# Organization vDC level (tsugliani)
net_id = cfg.vdc[:networks][net[:vdc_network_name]]
- Create a ticketCreate a ticket