Showing 531 of 531 total issues
Function Sizzle
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function Sizzle( selector, context, results, seed ) {
var match, elem, m, nodeType,
// QSA vars
i, groups, old, nid, newContext, newSelector;
Function buildFragment
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
buildFragment: function( elems, context, scripts, selection ) {
var j, elem, contains,
tmp, tag, tbody, wrap,
l = elems.length,
File helper.rb
has 289 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
module Olelo
module BlockHelper
def blocks
@blocks ||= Hash.new('')
end
Function openTree
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function openTree(element, path) {
// Cache key for cached json data
var cacheKey = options.cacheStore ? options.cacheStore + ':' + path : null;
// Store json in cache
Function _create
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_create: function() {
this.activeMenu = this.element;
// flag used to prevent firing of the click handler
// as the event bubbles up through nested menus
this.mouseHandled = false;
Function widget
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$.widget = function( name, base, prototype ) {
var fullName, existingConstructor, constructor, basePrototype,
// proxiedPrototype allows the provided prototype to remain unmodified
// so that it can be used as a mixin for multiple widgets (#8876)
proxiedPrototype = {},
Function data
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
itself.data = function () {
var data = {functions: []}, fu, globals, implieds = [], f, i, j,
members = [], n, unused = [], v;
if (itself.errors.length) {
Function data
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
itself.data = function () {
var data = {functions: []}, fu, globals, implieds = [], f, i, j,
members = [], n, unused = [], v;
if (itself.errors.length) {
Function matcherFromGroupMatchers
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
// A counter to specify which element is currently being matched
var matcherCachedRuns = 0,
bySet = setMatchers.length > 0,
byElement = elementMatchers.length > 0,
Function add
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
add: function( elem, types, handler, data, selector ) {
var tmp, events, t, handleObjIn,
special, eventHandle, handleObj,
handlers, type, namespaces, origType,
elemData = jQuery._data( elem );
Function domManip
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
domManip: function( args, table, callback ) {
// Flatten any nested arrays
args = core_concat.apply( [], args );
Function statements
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function statements(begin) {
var a = [], f, p;
if (begin && !use_strict() && option.strict) {
warning('Missing "use strict" statement.', nexttoken);
}
Function str
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function str(key, holder) {
// Produce a string from holder[key].
var i, // The loop counter.
Function statements
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function statements(begin) {
var a = [], f, p;
if (begin && !use_strict() && option.strict) {
warning('Missing "use strict" statement.', nexttoken);
}
Method run
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
Open
def run(data = nil)
cmd = @cmd.join(' | ')
return `#{cmd}` if !data
Open3.popen3(cmd) do |stdin, stdout, stderr|
output = ''
- Read upRead up
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 pagination
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
Open
def pagination(path, page_count, page_nr, options = {})
return if page_count <= 1
unlimited = options.delete(:unlimited)
li = []
li << if page_nr > 1
- Read upRead up
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 done
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function done( status, nativeStatusText, responses, headers ) {
var isSuccess, success, error, response, modified,
statusText = nativeStatusText;
// Called once
Function exps
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
infix('(', function (left, that) {
if (prevtoken.id !== '}' && prevtoken.id !== ')') {
nobreak(prevtoken, token);
}
nospace();
Function exps
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
infix('(', function (left, that) {
if (prevtoken.id !== '}' && prevtoken.id !== ')') {
nobreak(prevtoken, token);
}
nospace();
Consider simplifying this complex logical expression. Open
Open
if ((i.id === '(number)' && /[.+\-Ee]/.test(i.value)) ||
(i.id === '-' && !i.right) ||
i.id === '(string)' || i.id === '[' ||
i.id === '{' || i.id === 'true' ||
i.id === 'false' ||