Showing 1,006 of 6,062 total issues
Method validate_proposal_elements
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def validate_proposal_elements proposal_elements
proposal_elements.each do |role_and_elements|
role, elements = role_and_elements
uniq_elements = elements.uniq
- 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 node_role_list
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def node_role_list(node)
all_roles = RoleObject.all
all_proposals = Proposal.all
list_items = ActiveSupport::OrderedHash.new.tap do |listing|
- 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 rails.js
has 302 lines of code (exceeds 250 allowed). Consider refactoring. Open
(function($, undefined) {
/**
* Unobtrusive scripting adapter for jQuery
* https://github.com/rails/jquery-ujs
- Create a ticketCreate a ticket
Function _keydown
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
_keydown: function( event ) {
/*jshint maxcomplexity:20*/
var match, prev, character, skip, regex,
preventDefault = true;
- Create a ticketCreate a ticket
Function initPreviewDeletes
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
initPreviewDeletes: function () {
var self = this, deleteExtraData = self.deleteExtraData || {},
resetProgress = function () {
var hasFiles = self.isUploadable ? previewCache.count(self.id) : self.$element.get(0).files.length;
if (self.$preview.find('.kv-file-remove').length === 0 && !hasFiles) {
- Create a ticketCreate a ticket
Function anonymous
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
lexer.performAction = function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {
function strip(start, end) {
return yy_.yytext = yy_.yytext.substr(start, yy_.yyleng-end);
- Create a ticketCreate a ticket
Function formatDate
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
formatDate: function (format, date, settings) {
if (!date) {
return "";
}
- Create a ticketCreate a ticket
Function init
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
init: function (options) {
var self = this, $el = self.$element, t;
$.each(options, function (key, value) {
switch (key) {
case 'minFileCount':
- Create a ticketCreate a ticket
Method transition
has 78 lines of code (exceeds 25 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
- Create a ticketCreate a ticket
Method unique_name
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def unique_name
# check first if we have already a claimed disk which points to the same
# device node. if so, use that as "unique name"
already_claimed_name = self.unique_name_already_claimed_by
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 initiate_nodes_upgrade
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def initiate_nodes_upgrade
upgrade_nodes = Node.all.reject do |node|
node.admin? || node[:platform] == "windows" || node.state != "crowbar_upgrade"
end
check_if_nodes_are_available upgrade_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
Function _clear
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
_clear: function(event, noPropagation) {
this.reverting = false;
// We delay all events that have to be triggered to after the point where the placeholder has been removed and
// everything else normalized again
- Create a ticketCreate a ticket
Method deallocate_ip_by_type
has 76 lines of code (exceeds 25 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?
- Create a ticketCreate a ticket
Function Sizzle
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Sizzle( selector, context, results, seed ) {
var match, elem, m, nodeType,
// QSA vars
i, groups, old, nid, newContext, newSelector;
- Create a ticketCreate a ticket
Function _mouseDrag
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
_mouseDrag: function(event) {
var i, item, itemElement, intersection,
o = this.options,
scrolled = false;
- Create a ticketCreate a ticket
Function _mouseStart
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
_mouseStart: function(event, overrideHandle, noActivation) {
var i, body,
o = this.options;
- Create a ticketCreate a ticket
Function registerDefaultHelpers
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
function registerDefaultHelpers(instance) {
instance.registerHelper('helperMissing', function(arg) {
if(arguments.length === 2) {
return undefined;
} else {
- Create a ticketCreate a ticket
Function buildFragment
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
buildFragment: function( elems, context, scripts, selection ) {
var j, elem, contains,
tmp, tag, tbody, wrap,
l = elems.length,
- Create a ticketCreate a ticket
Function _mouseDrag
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
_mouseDrag: function(event) {
this.dragged = true;
if (this.options.disabled) {
- Create a ticketCreate a ticket
Function Datepicker
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Datepicker() {
this._curInst = null; // The current instance in use
this._keyEvent = false; // If the last event was a key event
this._disabledInputs = []; // List of date picker inputs that have been disabled
this._datepickerShowing = false; // True if the popup picker is showing , false if not
- Create a ticketCreate a ticket