Showing 1,006 of 6,062 total issues
File nodes_helper.rb
has 523 lines of code (exceeds 250 allowed). Consider refactoring. Open
module NodesHelper
def all_non_admin_nodes
Node.find("NOT admin_node:true")
end
- Create a ticketCreate a ticket
Method checks
has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring. Open
def checks
upgrade_status = ::Crowbar::UpgradeStatus.new
upgrade_status.start_step(:prechecks)
{}.tap do |ret|
- 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
File setup_base_images.rb
has 511 lines of code (exceeds 250 allowed). Consider refactoring. Open
dirty = false
# Set up the OS images as well
# Common to all OSes
admin_net = Barclamp::Inventory.get_network_by_type(node, "admin")
- Create a ticketCreate a ticket
Method allocate_ip_by_type
has a Cognitive Complexity of 52 (exceeds 5 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?
- 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
File tooltip.js
has 497 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* ========================================================================
* Bootstrap: tooltip.js v3.4.1
* https://getbootstrap.com/docs/3.4/javascript/#tooltip
* Inspired by the original jQuery.tipsy by Jason Frame
* ========================================================================
- Create a ticketCreate a ticket
Method transition
has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring. Open
def transition(inst, name, state)
Rails.logger.debug("Deployer transition: entering: #{name} for #{state}")
# discovering because mandatory for discovery image
if ["discovering", "readying"].include? state
- 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 _create
has 197 lines of code (exceeds 25 allowed). Consider refactoring. Open
_create: function() {
// Some browsers only repeat keydown events, not keypress events,
// so we use the suppressKeyPress flag to determine if we've already
// handled the keydown event. #7269
// Unfortunately the code for & in keypress is the same as the up arrow,
- Create a ticketCreate a ticket
Method transition
has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring. Open
def transition(inst, name, state)
Rails.logger.debug("Network transition: entering: #{name} for #{state}")
# we need one state before "installed" (and after allocation) because we
# need the node to have the admin network fully defined for
- 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
File crowbar_spec.rb
has 474 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "spec_helper"
describe Api::Crowbar do
let(:pid) { rand(20000..30000) }
let(:admin_node) { NodeObject.find_node_by_name("admin") }
- Create a ticketCreate a ticket
File default.rb
has 471 lines of code (exceeds 250 allowed). Consider refactoring. Open
unless node[:platform_family] == "suse"
include_recipe "bluepill"
end
pkglist = ()
- Create a ticketCreate a ticket
Function insertNode
has 172 lines of code (exceeds 25 allowed). Consider refactoring. Open
NodeList.prototype.insertNode = function(role, id, alias, admin, platform, platform_version, cluster, remotes, initial) {
var self = this;
var $role = $(self.dataBag.roleTarget.format(role));
if (self.constraints) {
- Create a ticketCreate a ticket
Function registerEvents
has 172 lines of code (exceeds 25 allowed). Consider refactoring. Open
DynamicTable.prototype.registerEvents = function() {
var self = this;
self.root.find('[data-add]').live('click', function(event) {
self.prepareJson();
- Create a ticketCreate a ticket
Function _generateHTML
has 169 lines of code (exceeds 25 allowed). Consider refactoring. Open
_generateHTML: function(inst) {
var maxDraw, prevText, prev, nextText, next, currentText, gotoDate,
controls, buttonPanel, firstDay, showWeek, dayNames, dayNamesMin,
monthNames, monthNamesShort, beforeShowDay, showOtherMonths,
selectOtherMonths, defaultDate, html, dow, row, group, col, selectedDate,
- Create a ticketCreate a ticket
Method transition
has a Cognitive Complexity of 44 (exceeds 5 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
- 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
File nodeList.js
has 444 lines of code (exceeds 250 allowed). Consider refactoring. Open
;(function($, doc, win) {
'use strict';
function NodeList(el) {
this.$root = $(el);
- Create a ticketCreate a ticket
Method validate_hook
has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring. Open
def validate_hook(value, rule, path, errors)
case rule.name
when "DiskURL"
begin
arr = URI.split(value)
- 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
File barclamp_lib.rb
has 440 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "rubygems"
require "net/http"
require "net/http/digest_auth"
require "uri"
require "inifile"
- Create a ticketCreate a ticket
Method services
has 163 lines of code (exceeds 25 allowed). Consider refactoring. Open
def services
return unless cluster_health_check
return unless check_schema_migrations
return unless check_product_version
begin
- Create a ticketCreate a ticket
Class Repository
has 47 methods (exceeds 20 allowed). Consider refactoring. Open
class Repository
attr_reader :platform, :arch, :id, :config
class << self
def load!
- Create a ticketCreate a ticket
Function install
has 161 lines of code (exceeds 25 allowed). Consider refactoring. Open
function install(el, opts) {
var css, themedCSS;
var full = (el == window);
var msg = (opts && opts.message !== undefined ? opts.message : undefined);
opts = $.extend({}, $.blockUI.defaults, opts || {});
- Create a ticketCreate a ticket