Showing 1,006 of 6,062 total issues
Function getCurrentRegionTooltip
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
getCurrentRegionTooltip: function () {
var options = this.options,
header = '',
entries = [],
fields, formats, formatlen, fclass, text, i,
- Create a ticketCreate a ticket
Method parallel_upgrade_compute_nodes
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parallel_upgrade_compute_nodes(compute_nodes, controller = nil)
Rails.logger.info("Entering parallel upgrade of compute nodes, #{upgrade_mode} mode")
Rails.logger.info("Nodes for upgrade: #{compute_nodes.map(&:name).join(', ')}")
save_nodes_state(compute_nodes, "compute", "upgrading")
save_node_action("upgrading the packages")
- Create a ticketCreate a ticket
Function superMatcher
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
superMatcher = function( seed, context, xml, results, outermost ) {
var elem, j, matcher,
matchedCount = 0,
i = "0",
unmatched = seed && [],
- Create a ticketCreate a ticket
Function _showDatepicker
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
_showDatepicker: function(input) {
input = input.target || input;
if (input.nodeName.toLowerCase() !== "input") { // find from button/image trigger
input = $("input", input.parentNode)[0];
}
- Create a ticketCreate a ticket
Method add_and_filter
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def add_and_filter(file, add, filter_re)
lock = nil
lock = lock(@new_resource)
need_to_add = !add.nil?
need_to_remove = 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 node_state_valid_for_role?
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def self.node_state_valid_for_role?(node, barclamp, role)
# We always want deployer-client, both for heartbeat but also because it
# sets up the ability to use the barclamp library
return true if role == "deployer-client"
- 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 skip_unready_nodes
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def skip_unready_nodes(bc, inst, new_elements, old_elements)
logger.debug("skip_unready_nodes: enter for #{bc}:#{inst}")
skip_unready_nodes_roles = Rails.application.config.crowbar.fetch(
"skip_unready_nodes", {}
).fetch("roles", [])
- 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 element_nodes
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def element_nodes(roles = self.class.all, nodes = Node.all)
assigned_nodes = []
# Get all nodes from proposal roles mentioning this one
proposal_roles(roles).each do |prop|
- 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 expand_nodes_for_all
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def expand_nodes_for_all(items)
nodes = []
failures = []
items.each do |item|
- 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 restore_chef
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def restore_chef
Rails.logger.debug "Restoring chef backup files"
begin
[:nodes, :roles, :clients, :databags].each do |type|
- 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 init
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
init = jQuery.fn.init = function( selector, context ) {
var match, elem;
// HANDLE: $(""), $(null), $(undefined), $(false)
if ( !selector ) {
- Create a ticketCreate a ticket
Function send
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
send: function( headers, complete ) {
var i,
xhr = options.xhr(),
id = ++xhrId;
- Create a ticketCreate a ticket
Function domManip
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
domManip: function( args, callback ) {
// Flatten any nested arrays
args = concat.apply( [], args );
- Create a ticketCreate a ticket
Function drag
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
drag: function(event, ui) {
var ts, bs, ls, rs, l, r, t, b, i, first,
inst = $(this).data("ui-draggable"),
o = inst.options,
- Create a ticketCreate a ticket
Function drag
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
drag: function(event, ui) {
var inst = $(this).data("ui-draggable"), that = this;
$.each(inst.sortables, function() {
- Create a ticketCreate a ticket
Method node_ip_list
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
def node_ip_list(ips)
entries = [].tap do |result|
ips.each do |network, addresses|
unless network == "~notconnected" and addresses.nil?
network_list = if ["[not managed]", "[dhcp]"].include? network
- Create a ticketCreate a ticket
Function CHILD
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
"CHILD": function( type, what, argument, first, last ) {
var simple = type.slice( 0, 3 ) !== "nth",
forward = type.slice( -4 ) !== "last",
ofType = what === "of-type";
- Create a ticketCreate a ticket
Function Deferred
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Deferred: function( func ) {
var tuples = [
// action, add listener, listener list, final state
[ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ],
[ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ],
- Create a ticketCreate a ticket
Function success
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
success: function(data) {
// check for invalid network.json
$("#network-alert").remove();
if (!data.network.valid) {
$(".button_to").find("input").prop("disabled", true);
- Create a ticketCreate a ticket
Function explode
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.effects.effect.explode = function( o, done ) {
var rows = o.pieces ? Math.round( Math.sqrt( o.pieces ) ) : 3,
cells = rows,
el = $( this ),
- Create a ticketCreate a ticket