Showing 1,006 of 6,062 total issues
Function parse
has 101 lines of code (exceeds 25 allowed). Consider refactoring. Open
parse: function parse(input) {
var self = this, stack = [0], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
this.lexer.setInput(input);
this.lexer.yy = this.yy;
this.yy.lexer = this.lexer;
- Create a ticketCreate a ticket
Method reset_proposal
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def reset_proposal(inst, bc = @bc_name)
::Proposal.find_by(
barclamp: bc,
name: inst
).tap do |proposal|
- 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 upgradable_elements_of_proposals
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def upgradable_elements_of_proposals(proposals)
to_upgrade = []
# First find out the nodes with compute role, for later checks
compute_nodes = {}
- 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 nodes
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def nodes(component = "all")
status = ::Crowbar::UpgradeStatus.new
if component == "postpone"
status.postpone
- 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 process_queue
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def process_queue
logger.debug("process queue: enter")
loop_again = true
while loop_again
loop_again = false
- 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 nodes
has 96 lines of code (exceeds 25 allowed). Consider refactoring. Open
def nodes
if params[:component]
component = params[:component]
upgrade_status = ::Crowbar::UpgradeStatus.new
substep = upgrade_status.current_substep
- Create a ticketCreate a ticket
Class Restore
has 31 methods (exceeds 20 allowed). Consider refactoring. Open
class Restore
attr_accessor :backup, :version
def initialize(backup)
@backup = backup
- Create a ticketCreate a ticket
File barclamp_library.rb
has 324 lines of code (exceeds 250 allowed). Consider refactoring. Open
require_relative "conduit_resolver.rb"
require_relative "ssh_key_parser.rb"
module BarclampLibrary
class Barclamp
- Create a ticketCreate a ticket
Method allocate_ip_by_type
has 94 lines of code (exceeds 25 allowed). Consider refactoring. Open
def allocate_ip_by_type(bc_instance, network, range, object, type, suggestion = nil)
Rails.logger.debug("Network allocate ip for #{type}: entering #{object} #{network} #{range}")
return [404, "No network specified"] if network.nil?
return [404, "No range specified"] if range.nil?
return [404, "No object specified"] if object.nil?
- Create a ticketCreate a ticket
Method non_disruptive_upgrade_compute_nodes
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
def non_disruptive_upgrade_compute_nodes(names)
compute_nodes = names.map do |name|
::Node.find_node_by_name_or_alias(name)
end
- 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 bulk
has 93 lines of code (exceeds 25 allowed). Consider refactoring. Open
def bulk
@report = {
success: [],
failed: [],
duplicate_public: false,
- Create a ticketCreate a ticket
Method nodes
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
def nodes(component = "all")
status = ::Crowbar::UpgradeStatus.new
if component == "postpone"
status.postpone
- Create a ticketCreate a ticket
Method transition
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
def transition(inst, name, state)
self.transition_save_node = false
return [404, "No state specified"] if state.nil?
# FIXME: validate state
- Create a ticketCreate a ticket
Method checks
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
def checks
upgrade_status = ::Crowbar::UpgradeStatus.new
upgrade_status.start_step(:prechecks)
{}.tap do |ret|
- Create a ticketCreate a ticket
Method ha_config_check
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
def ha_config_check
prop = Proposal.where(barclamp: "cinder").first
unless prop.nil?
backends = prop["attributes"]["cinder"]["volumes"].select do |volume|
- Create a ticketCreate a ticket
Method apply_role_pre_chef_call
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def apply_role_pre_chef_call(old_role, role, all_nodes)
Rails.logger.debug("DNS apply_role_pre_chef_call: entering #{all_nodes.inspect}")
return if all_nodes.empty?
tnodes = role.override_attributes["dns"]["elements"]["dns-server"]
- 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 default_loader
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def default_loader
f = File.join "db","node_description.yml"
begin
if File.exist? f
default = {}
- 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 validate_proposal_after_save
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def validate_proposal_after_save proposal
super
errors = []
- 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 split_key_line
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def split_key_line(line)
line = line.clone
res = []
field = ""
escape = false # was last char a backslash (so current one is escaped)?
- 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
Function trigger
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
trigger: function( event, data, elem, onlyHandlers ) {
var handle, ontype, cur,
bubbleType, special, tmp, i,
eventPath = [ elem || document ],
type = hasOwn.call( event, "type" ) ? event.type : event,
- Create a ticketCreate a ticket