Showing 1,006 of 6,062 total issues
Function initFileActions
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
initFileActions: function () {
var self = this;
if (!self.showPreview) {
return;
}
- Create a ticketCreate a ticket
Consider simplifying this complex logical expression. Open
if (params[:raid_type] == "raid1" && raid_disks_selected < 2) || \
(params[:raid_type] == "raid0" && raid_disks_selected < 1) || \
(params[:raid_type] == "raid5" && raid_disks_selected < 3) || \
(params[:raid_type] == "raid6" && raid_disks_selected < 4) || \
(params[:raid_type] == "raid10" && raid_disks_selected < 4)
- Create a ticketCreate a ticket
Function internalRemoveData
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
function internalRemoveData( elem, name, pvt ) {
if ( !jQuery.acceptData( elem ) ) {
return;
}
- Create a ticketCreate a ticket
Function _setOption
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
_setOption: function( key, value ) {
/*jshint maxcomplexity:15*/
var isDraggable, isResizable,
uiDialog = this.uiDialog;
- Create a ticketCreate a ticket
Function _setOption
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
_setOption: function( key, value ) {
var i,
valsLength = 0;
if ( key === "range" && this.options.range === true ) {
- Create a ticketCreate a ticket
Function blind
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.effects.effect.blind = function( o, done ) {
// Create element
var el = $( this ),
props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
mode = $.effects.setMode( el, o.mode || "hide" ),
- Create a ticketCreate a ticket
Method transition
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
def transition(inst, name, state)
Rails.logger.debug("Provisioner transition: entering: #{name} for #{state}")
# hardware-installing for the bootdisk finder
if ["hardware-installing", "installed", "readying"].include? state
- Create a ticketCreate a ticket
Method process_queue
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
def process_queue
logger.debug("process queue: enter")
loop_again = true
while loop_again
loop_again = false
- Create a ticketCreate a ticket
Function _determineDate
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
_determineDate: function(inst, date, defaultDate) {
var offsetNumeric = function(offset) {
var date = new Date();
date.setDate(date.getDate() + offset);
return date;
- Create a ticketCreate a ticket
Function _animate
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
_animate: function( toShow, toHide, data ) {
var total, easing, duration,
that = this,
adjust = 0,
down = toShow.length &&
- Create a ticketCreate a ticket
Function _mouseCapture
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
_mouseCapture: function( event ) {
var position, normValue, distance, closestHandle, index, allowed, offset, mouseOverHandle,
that = this,
o = this.options;
- Create a ticketCreate a ticket
Function _toggle
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
_toggle: function( event, eventData ) {
var that = this,
toShow = eventData.newPanel,
toHide = eventData.oldPanel;
- Create a ticketCreate a ticket
Method aaaLogin
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
def aaaLogin(ucs_url, username, password)
if ucs_url.blank?
logger.debug "Cisco UCS: missing login URL"
redirect_to ucs_settings_path, alert: "You must provide a login URL"
return nil
- Create a ticketCreate a ticket
Method get_supported_speeds
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def get_supported_speeds(interface)
ecmd = EthtoolCmd.new
ecmd.cmd = ETHTOOL_GSET
ifreq = [interface, ecmd.data].pack("a16P")
- 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 make_zone
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def make_zone(zone)
# copy over SOA records that we have not overridden
populate_soa zone
zonefile_entries=Array.new
Chef::Log.debug "Processing zone: #{zone.inspect}"
- 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_postponed_nodes
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def validate_postponed_nodes(proposal)
return unless upgrade_postponed?
skip_unready_nodes_enabled = Rails.application.config.crowbar.fetch(
"skip_unready_nodes", {}
- 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 violates_admin_constraint?
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def violates_admin_constraint?(elements, role, nodes_is_admin = {})
if role_constraints[role] && !role_constraints[role]["admin"]
elements[role].each do |element|
next if is_cluster?(element) || is_remotes?(element)
unless nodes_is_admin.key? element
- 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 prepare_nodes_for_crowbar_upgrade
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def prepare_nodes_for_crowbar_upgrade
proposal = Proposal.find_by(barclamp: "crowbar", name: "default")
# To all nodes, add a new role which prepares them for the upgrade
nodes_to_upgrade = []
- 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 set_state
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def set_state(state)
# use the real transition function for this
cb = CrowbarService.new
result = cb.transition "default", @node.name, 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
Method hash_to_ul
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def hash_to_ul(hash)
content_tag :ul do
hash.collect do |key, value|
content = []
- 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"