Showing 1,006 of 6,062 total issues
Method wait_for_script_to_finish
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. 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)
- 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 dl_item
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def dl_item(term, definition, options={})
unless definition.blank? && options[:show_if_blank] != true
html = "<dt>#{options[:escape_html] != false ? (h term) : (term)}</dt>"
dd = "<dd" + (options[:class].nil? ? "" : " class=""+options[:class]+""") + (options[:title].nil? ? "" : " title="" + options[:title]+""") + ">"
html += "#{dd}#{options[:escape_html] != false ? (h definition) : (definition)}</dd>"
- 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 where
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def where(options = {})
platform = options.fetch :platform, nil
arch = options.fetch :arch, nil
repo = options.fetch :repo, nil
result = []
- 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 internalData
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
function internalData( elem, name, data, pvt /* Internal Use Only */ ) {
if ( !jQuery.acceptData( elem ) ) {
return;
}
- Create a ticketCreate a ticket
Function select
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
select = Sizzle.select = function( selector, context, results, seed ) {
var i, tokens, token, type, find,
compiled = typeof selector === "function" && selector,
match = !seed && tokenize( (selector = compiled.selector || selector) );
- Create a ticketCreate a ticket
Function resize
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
resize: function() {
var that = $(this).data("ui-resizable"),
o = that.options,
cs = that.size,
os = that.originalSize,
- Create a ticketCreate a ticket
Function scale
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.effects.effect.scale = function( o, done ) {
// Create element
var el = $( this ),
options = $.extend( true, {}, o ),
- Create a ticketCreate a ticket
Function registerEvents
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
NodeList.prototype.registerEvents = function() {
var self = this;
$('.dropzone .delete').live('click', function(event) {
event.preventDefault();
- Create a ticketCreate a ticket
Method unique_name
has 47 lines of code (exceeds 25 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?
- Create a ticketCreate a ticket
Method node_detail_software
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
def node_detail_software
@node_detail_software ||= begin
[].tap do |result|
result.push [
t("model.attributes.node.name"),
- Create a ticketCreate a ticket
Function tokenize
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
var matched, match, tokens, type,
soFar, groups, preFilters,
cached = tokenCache[ selector + " " ];
- Create a ticketCreate a ticket
Function matcherFromTokens
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
function matcherFromTokens( tokens ) {
var checkContext, matcher, j,
len = tokens.length,
leadingRelative = Expr.relative[ tokens[0].type ],
implicitRelative = leadingRelative || Expr.relative[" "],
- Create a ticketCreate a ticket
Function _generatePosition
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
_generatePosition: function(event) {
var top, left,
o = this.options,
pageX = event.pageX,
- Create a ticketCreate a ticket
Function processGroups
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
LedUpdate.prototype.processGroups = function(response, ignores) {
var self = this;
var reload = false;
$('[data-group]').each(function(index, current) {
var current_handle = $(current).data('group');
- Create a ticketCreate a ticket
Function fold
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.effects.effect.fold = function( o, done ) {
// Create element
var el = $( this ),
props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
- Create a ticketCreate a ticket
Function slide
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Carousel.prototype.slide = function (type, next) {
var $active = this.$element.find('.item.active')
var $next = next || this.getItemForDirection(type, $active)
var isCycling = this.interval
var direction = type == 'next' ? 'left' : 'right'
- Create a ticketCreate a ticket
Method proposal_commit
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
def proposal_commit
code, message = @service_object.proposal_commit(
params[:id]
)
- Create a ticketCreate a ticket
Function _tabKeydown
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
_tabKeydown: function( event ) {
/*jshint maxcomplexity:15*/
var focusedTab = $( this.document[0].activeElement ).closest( "li" ),
selectedIndex = this.tabs.index( focusedTab ),
goingForward = true;
- Create a ticketCreate a ticket
Function _mouseStart
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
_mouseStart: function(event) {
var o = this.options;
//Create and append the visible helper
- Create a ticketCreate a ticket
Function _setContainment
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
_setContainment: function() {
var over, c, ce,
o = this.options;
- Create a ticketCreate a ticket