Showing 6,062 of 6,062 total issues
Function data
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
data: function( key, value ) {
var i, name, data,
elem = this[0],
attrs = elem && elem.attributes;
- Create a ticketCreate a ticket
Function fixCloneNodeIssues
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function fixCloneNodeIssues( src, dest ) {
var nodeName, e, data;
// We do not need to do anything for non-Elements
if ( dest.nodeType !== 1 ) {
- Create a ticketCreate a ticket
Function load
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
jQuery.fn.load = function( url, params, callback ) {
if ( typeof url !== "string" && _load ) {
return _load.apply( this, arguments );
}
- Create a ticketCreate a ticket
Function addClass
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
addClass: function( value ) {
var classes, elem, cur, clazz, j, finalValue,
i = 0,
len = this.length,
proceed = typeof value === "string" && value;
- Create a ticketCreate a ticket
Function _size
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_size: function() {
// If the user has resized the dialog, the .ui-dialog and .ui-dialog-content
// divs will both have width and height set, so we need to reset them
var nonContentHeight, minContentHeight, maxContentHeight,
options = this.options;
- Create a ticketCreate a ticket
Function left
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
left: function( position, data ) {
var within = data.within,
withinOffset = within.offset.left + within.scrollLeft,
outerWidth = within.width,
offsetLeft = within.isWindow ? within.scrollLeft : within.offset.left,
- Create a ticketCreate a ticket
Function _refreshItems
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_refreshItems: function(event) {
this.items = [];
this.containers = [this];
- Create a ticketCreate a ticket
Function _normalizeArguments
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function _normalizeArguments( effect, options, speed, callback ) {
// allow passing all options as the first parameter
if ( $.isPlainObject( effect ) ) {
options = effect;
- Create a ticketCreate a ticket
Function raise
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
raise: function (event, params) {
var self = this, e = $.Event(event);
if (params !== undefined) {
self.$element.trigger(e, params);
} else {
- Create a ticketCreate a ticket
Method load
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def load(group, barclamp, instance = nil)
# If no instance is specified, see if this node uses an instance of
# this barclamp and use it
if instance.nil? && @node[barclamp] && @node[barclamp][:config]
instance = @node[barclamp][:config][:environment]
- Create a ticketCreate a ticket
Function compile
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
compile: function(environment, options, context, asObject) {
this.environment = environment;
this.options = options || {};
log('debug', this.environment.disassemble() + "\n\n");
- Create a ticketCreate a ticket
Method wait_for_reboot
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def wait_for_reboot(node)
nobj = Node.find_by_name(node)
if nobj[:crowbar_wall][:wait_for_reboot]
puts "Waiting for reboot of node #{node}"
if RemoteNode.ready?(node, 1200)
- Create a ticketCreate a ticket
Method transition
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def transition
name = params[:id]
state = params[:state]
load_node
- Create a ticketCreate a ticket
Method element_nodes
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
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|
- Create a ticketCreate a ticket
Method get_node_and_network
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def get_node_and_network(node_name)
network = {}
@network = []
@node = Node.find_by_name(node_name) if @node.nil?
if @node
- Create a ticketCreate a ticket
Method update
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def update
@updateDoc = ""
case params[:updateAction]
when "compute"
- Create a ticketCreate a ticket
Method adminrepocheck
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def adminrepocheck
check = Api::Upgrade.adminrepocheck
if check.key?(:error)
render json: {
- Create a ticketCreate a ticket
Method wait_for_script_to_finish
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def wait_for_script_to_finish(script, seconds, args = [], enforce_timeout = false)
cmd = script
cmd += " " + args.join(" ") unless args.empty?
raise "Script #{script} is not present on the node #{@node.name}." unless file_exist?(script)
- Create a ticketCreate a ticket
Method add_role_to_instance_and_node
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Open
def add_role_to_instance_and_node(barclamp, instance, name, prop, role, newrole)
node = Node.find_by_name(name)
if node.nil?
Rails.logger.debug("ARTOI: couldn't find node #{name}. bailing")
return 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 enable_repository
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Open
def enable_repository(platform, arch, repo)
repo_object = Crowbar::Repository.where(platform: platform, arch: arch, repo: repo).first
if repo_object.nil?
message = "#{repo} repository for #{platform} / #{arch} does not exist."
Rails.logger.debug(message)
- 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"