Showing 1,006 of 6,062 total issues
Method ha_config_check
has a Cognitive Complexity of 34 (exceeds 5 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|
- 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 adminrepocheck
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
def adminrepocheck
upgrade_status = ::Crowbar::UpgradeStatus.new
upgrade_status.start_step(:repocheck_crowbar)
zypper_stream = Hash.from_xml(
`sudo /usr/bin/zypper-retry --xmlout products`
- 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
Consider simplifying this complex logical expression. Open
if ( event.pageX == null && original.clientX != null ) {
eventDoc = event.target.ownerDocument || document;
doc = eventDoc.documentElement;
body = eventDoc.body;
- Create a ticketCreate a ticket
Function uploadSingle
has 125 lines of code (exceeds 25 allowed). Consider refactoring. Open
uploadSingle: function (i, files, allFiles) {
var self = this, total = self.getFileStack().length, formdata = new FormData(), outData,
previewId = self.previewInitId + "-" + i, $thumb, chkComplete, $btnUpload, $btnDelete,
hasPostData = self.filestack.length > 0 || !$.isEmptyObject(self.uploadExtraData),
fnBefore, fnSuccess, fnComplete, fnError, updateUploadLog, params = {id: previewId, index: i};
- Create a ticketCreate a ticket
Method deallocate_ip_by_type
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
def deallocate_ip_by_type(bc_instance, network, object, type)
Rails.logger.debug("Network deallocate ip from #{type}: entering #{object} #{network}")
return [404, "No network specified"] if network.nil?
return [404, "No type specified"] if type.nil?
- 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 122 lines of code (exceeds 25 allowed). Consider refactoring. Open
init: function (el, values, options, width, height) {
var barWidth = parseInt(options.get('barWidth'), 10),
barSpacing = parseInt(options.get('barSpacing'), 10),
chartRangeMin = options.get('chartRangeMin'),
chartRangeMax = options.get('chartRangeMax'),
- Create a ticketCreate a ticket
File default.rb
has 367 lines of code (exceeds 250 allowed). Consider refactoring. Open
include_recipe "utils"
require "ipaddr"
package "bind9" do
case node[:platform_family]
- Create a ticketCreate a ticket
Method get_node_and_network
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
def get_node_and_network(node_name)
network = {}
@network = []
@node = Node.find_by_name(node_name) if @node.nil?
if @node
- 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 __module6__
has 115 lines of code (exceeds 25 allowed). Consider refactoring. Open
var __module6__ = (function(__dependency1__, __dependency2__, __dependency3__) {
"use strict";
var __exports__ = {};
/*global Utils */
var Utils = __dependency1__;
- Create a ticketCreate a ticket
File upgrade_status_spec.rb
has 357 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "spec_helper"
describe Crowbar::UpgradeStatus do
let(:new_status) { subject.class.new }
- Create a ticketCreate a ticket
File network_service.rb
has 354 lines of code (exceeds 250 allowed). Consider refactoring. Open
class NetworkService < ServiceObject
def initialize(thelogger = nil)
super
@bc_name = "network"
end
- Create a ticketCreate a ticket
File repository.rb
has 350 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Crowbar
class Repository
attr_reader :platform, :arch, :id, :config
class << self
- Create a ticketCreate a ticket
Function __module7__
has 109 lines of code (exceeds 25 allowed). Consider refactoring. Open
var __module7__ = (function(__dependency1__) {
"use strict";
var __exports__ = {};
var Exception = __dependency1__;
- Create a ticketCreate a ticket
Function uploadBatch
has 109 lines of code (exceeds 25 allowed). Consider refactoring. Open
uploadBatch: function () {
var self = this, files = self.filestack, total = files.length, params = {},
hasPostData = self.filestack.length > 0 || !$.isEmptyObject(self.uploadExtraData),
setAllUploaded, fnBefore, fnSuccess, fnComplete, fnError;
self.formdata = new FormData();
- Create a ticketCreate a ticket
Function _create
has 107 lines of code (exceeds 25 allowed). Consider refactoring. Open
_create: function() {
var n, i, handle, axis, hname,
that = this,
o = this.options;
- Create a ticketCreate a ticket
Method unique_device_for
has a Cognitive Complexity of 29 (exceeds 5 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?
- 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 load!
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def load!
# reset other cached values
@admin_ip = nil
@web_port = nil
- 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 defaultPrefilter
has 105 lines of code (exceeds 25 allowed). Consider refactoring. Open
function defaultPrefilter( elem, props, opts ) {
/* jshint validthis: true */
var prop, value, toggle, tween, hooks, oldfire, display, checkDisplay,
anim = this,
orig = {},
- Create a ticketCreate a ticket
Method switch
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
def switch
@port_start = 1
@sum = 0
@vports = {}
@groups = {}
- 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 adminrepocheck
has 102 lines of code (exceeds 25 allowed). Consider refactoring. Open
def adminrepocheck
upgrade_status = ::Crowbar::UpgradeStatus.new
upgrade_status.start_step(:repocheck_crowbar)
zypper_stream = Hash.from_xml(
`sudo /usr/bin/zypper-retry --xmlout products`
- Create a ticketCreate a ticket