Showing 1,006 of 6,062 total issues
Function anonymous
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
performAction: function anonymous(yytext,yyleng,yylineno,yy,yystate,$$,_$) {
var $0 = $$.length - 1;
switch (yystate) {
case 1: return new yy.ProgramNode($$[$0-1]);
- Create a ticketCreate a ticket
Method validate_hook
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
def validate_hook(value, rule, path, errors)
case rule.name
when "DiskURL"
begin
arr = URI.split(value)
- Create a ticketCreate a ticket
File base.rb
has 313 lines of code (exceeds 250 allowed). Consider refactoring. Open
return if node[:platform_family] == "windows"
###
# If anything has to be applied to a Windows node, it has to be done
# before the return above, anything from this point forward being applied
- Create a ticketCreate a ticket
File upgrade_status.rb
has 312 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "yaml"
require "pathname"
require_relative "lock"
require_relative "lock/local_blocking"
- Create a ticketCreate a ticket
File javascript.js
has 311 lines of code (exceeds 250 allowed). Consider refactoring. Open
CodeMirror.defineMode("javascript", function(config, parserConfig) {
var indentUnit = config.indentUnit;
var jsonMode = parserConfig.json;
// Tokenizer
- Create a ticketCreate a ticket
File prepare-upgrade-scripts.rb
has 311 lines of code (exceeds 250 allowed). Consider refactoring. Open
arch = node[:kernel][:machine]
roles = node["run_list_map"].keys
target_platform, target_platform_version = node[:target_platform].split("-")
new_repos = Provisioner::Repositories.get_repos(
- Create a ticketCreate a ticket
Function _refresh
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
_refresh: function() {
var maxHeight,
options = this.options,
heightStyle = options.heightStyle,
parent = this.element.parent(),
- Create a ticketCreate a ticket
Method parse_address
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def self.parse_address(a)
addr,subnet = a.split("/",2)
unless addr.kind_of?(String) && (addr =~ /^[0-9a-f:]+$/) &&
(! addr.include?(":::")) && addr.length >= 2
raise ArgumentError.new("#{addr} is not a valid IP6 address")
- 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 parallel_upgrade_compute_nodes
has a Cognitive Complexity of 24 (exceeds 5 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")
- 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 get_proposals_from_barclamps
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def get_proposals_from_barclamps(barclamps)
modules = {}
active = RoleObject.active
barclamps.each do |name, details|
modules[name] = {
- 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 change
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
change: function (e) {
var self = this, $el = self.$element;
if (!self.isUploadable && isEmpty($el.val()) && self.fileInputCleared) { // IE 11 fix
self.fileInputCleared = false;
return;
- Create a ticketCreate a ticket
File ucs_controller.rb
has 308 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "net/http"
require "uri"
require "rexml/document"
require "cgi"
- Create a ticketCreate a ticket
Function Animation
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Animation( elem, properties, options ) {
var result,
stopped,
index = 0,
length = animationPrefilters.length,
- Create a ticketCreate a ticket
Function _doKeyDown
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
_doKeyDown: function(event) {
var onSelect, dateStr, sel,
inst = $.datepicker._getInst(event.target),
handled = true,
isRTL = inst.dpDiv.is(".ui-datepicker-rtl");
- Create a ticketCreate a ticket
Method openstackbackup
has 84 lines of code (exceeds 25 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...")
- Create a ticketCreate a ticket
Method node_detail_hardware
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
def node_detail_hardware
@node_detail_hardware ||= begin
raid_data = if bios_raid_options[:show].include?(:raid)
content_tag(
:em,
- Create a ticketCreate a ticket
Function initInnerToggle
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
initInnerToggle: function (el, options) {
var attachment = (el.css('direction') === 'rtl') ? 'left' : 'right'
, elWidth = el[options.widthMethod]()
, wrapperCSS = {
- Create a ticketCreate a ticket
Method load
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. 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]
- 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 relevant_attributes_changed_if_roles?
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def relevant_attributes_changed_if_roles?(node, old_role, new_role, ignore_attr, only_for_roles)
# if only_for_roles has some sole
unless only_for_roles.nil? || only_for_roles.empty?
# get roles for this node
roles_in_new = new_role.elements.keys.select { |r| new_role.elements[r].include?(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
Method validate_proposal_constraints
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def validate_proposal_constraints(proposal)
elements = proposal["deployment"][@bc_name]["elements"]
nodes_is_admin = {}
role_constraints.keys.each do |role|
- 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"