Showing 1,346 of 1,992 total issues
Method get_bus_order
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.get_bus_order(node)
buses = nil
product_name_attrib = node.get_attrib("product_name")
BarclampNetwork::BusMap.all.each do |bus_map|
- 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 discover_docs
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.discover_docs barclamp_id, doc_path
files_list = %x[find #{doc_path} -iname *.md]
files = files_list.split "\n"
files.each do |f|
# TODO ZEHICLE - figure out order by inspecting 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 index
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def index
@id = params[:id].gsub("%2B",'+') rescue nil
if Settings.docs.rebuild or params.has_key?(:rebuild)
# for dev, we want to be able to turn off rebuilds
Doc.delete_all unless params[:rebuild].eql? "false"
- 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 authenticate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def authenticate(req,uri,data=nil)
uri.user=@username
uri.password=@password
res=nil
Net::HTTP.start(uri.host, uri.port) {|http|
- 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 new
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.new(nic)
if o = @@interfaces[nic]
return o
elsif vlan?(nic)
o = ::Nic::Vlan.allocate
- 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 put_json2
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def put_json2(path, data=nil)
uri = URI.parse((@url || "http://#{@hostname}:#{@port}") + "/#{path}" )
res = authenticate(Net::HTTP::Put,uri,data)
puts "DEBUG: (put) hostname: #{uri.host}:#{uri.port}" if @debug
- 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"