Showing 1,006 of 6,062 total issues
Method transition
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
def transition(inst, name, state)
Rails.logger.debug("IPMI transition: entering: #{name} for #{state}")
# discovering because mandatory for discovery image
if ["discovering", "readying"].include? state
- Create a ticketCreate a ticket
Function parse
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
parse: function( red, green, blue, alpha ) {
if ( red === undefined ) {
this._rgba = [ null, null, null, null ];
return this;
}
- Create a ticketCreate a ticket
Method canonical_address
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def canonical_address
f = 0
in_run = false
runs = Array.new
a = self.to_a
- 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 openstackbackup
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def openstackbackup
crowbar_lib_dir = "/var/lib/crowbar"
dump_path = "#{crowbar_lib_dir}/backup/8-to-9-openstack_dump.sql.gz"
if File.exist?(dump_path)
Rails.logger.warn("OpenStack backup already exists. Skipping...")
- 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 16 (exceeds 5 allowed). Consider refactoring. Open
def validate_proposal_after_save proposal
require "set"
proposal["attributes"]["provisioner"]["packages"].each do |platform, packages|
packages.each do |package|
- 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 interface_list
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def interface_list
return [] if @node.nil?
answer = []
@node["network"]["interfaces"].each do |k,v|
next if k == "lo" # no loopback, please
- 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 add_pending_elements
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def add_pending_elements(bc, inst, element_order, elements, queue_me, pre_cached_nodes = {})
nodes_map, pre_cached_nodes = elements_to_nodes_to_roles_map(
elements, element_order, pre_cached_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 elements_to_nodes_to_roles_map
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def elements_to_nodes_to_roles_map(elements, element_order = [], pre_cached_nodes = {})
nodes_map = {}
active_elements = element_order.flatten
elements.each do |role_name, 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
Function readInput
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
function readInput() {
if (leaveInputAlone) return;
var changed = false, text = input.value, sr = selRange(input);
if (!sr) return false;
var changed = editing.text != text, rs = reducedSelection;
- Create a ticketCreate a ticket
Function keydown
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
keydown: function( event ) {
/*jshint maxcomplexity:15*/
if ( this.element.prop( "readOnly" ) ) {
suppressKeyPress = true;
suppressInput = true;
- Create a ticketCreate a ticket
Function _refreshValue
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
_refreshValue: function() {
var lastValPercent, valPercent, value, valueMin, valueMax,
oRange = this.options.range,
o = this.options,
that = this,
- Create a ticketCreate a ticket
Function _processTabs
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
_processTabs: function() {
var that = this;
this.tablist = this._getList()
.addClass( "ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all" )
- Create a ticketCreate a ticket
Method node_barclamp_list
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
def node_barclamp_list(node)
all_proposals = Proposal.all
list_items = ActiveSupport::OrderedHash.new.tap do |listing|
node_barclamps(node).map do |role|
- Create a ticketCreate a ticket
Function remove
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
remove: function( elem, types, handler, selector, mappedTypes ) {
var j, handleObj, tmp,
origCount, t, events,
special, handlers, type,
namespaces, origType,
- Create a ticketCreate a ticket
Function onMouseDown
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
function onMouseDown(e) {
var ld = lastDoubleClick; lastDoubleClick = null;
// First, see if this is a click in the gutter
for (var n = e.target(); n != wrapper; n = n.parentNode)
if (n.parentNode == gutterText) {
- Create a ticketCreate a ticket
Function retrieveAllocated
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
NodeList.prototype.retrieveAllocated = function() {
var self = this;
$.each(self.json.elements, function(role, nodes) {
var $role = $(self.dataBag.roleTarget.format(role));
- Create a ticketCreate a ticket
Method unique_device_for
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
def unique_device_for(device)
# check first if we have already a claimed disk which points to the same
# device node. if so, use that as "unique device"
already_claimed_name = self.unique_name_already_claimed_by(device)
unless already_claimed_name.nil?
- Create a ticketCreate a ticket
Consider simplifying this complex logical expression. Open
if ( ( mappedTypes || origType === handleObj.origType ) &&
( !handler || handler.guid === handleObj.guid ) &&
( !tmp || tmp.test( handleObj.namespace ) ) &&
( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
handlers.splice( j, 1 );
- Create a ticketCreate a ticket
Function next
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
next:function () {
if (this.done) {
return this.EOF;
}
if (!this._input) this.done = true;
- Create a ticketCreate a ticket
Function animateClass
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.effects.animateClass = function( value, duration, easing, callback ) {
var o = $.speed( duration, easing, callback );
return this.queue( function() {
var animated = $( this ),
- Create a ticketCreate a ticket