Showing 463 of 531 total issues
Function str
has 70 lines of code (exceeds 25 allowed). Consider refactoring. 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
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
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
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
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
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
infix('(', function (left, that) {
if (prevtoken.id !== '}' && prevtoken.id !== ')') {
nobreak(prevtoken, token);
}
nospace();
Consider simplifying this complex logical expression. 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' ||
Consider simplifying this complex logical expression. 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' ||
Class GitrbRepository
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
class GitrbRepository < Repository
CONTENT_EXT = '.content'
ATTRIBUTE_EXT = '.attributes'
def initialize(config)
Function setMatcher
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
if ( postFilter && !postFilter[ expando ] ) {
postFilter = setMatcher( postFilter );
}
if ( postFinder && !postFinder[ expando ] ) {
Method build_path
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def build_path(page, options = {})
options = options.dup
action = options.delete(:action)
version = options.delete(:version)
path = (page.try(:path) || page).to_s
- 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 superMatcher
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
superMatcher = function( seed, context, xml, results, expandContext ) {
var elem, j, matcher,
setMatched = [],
matchedCount = 0,
i = "0",
Function styleValue
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
function styleValue(v) {
var i = 0,
n,
once,
match,
Function styleValue
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
function styleValue(v) {
var i = 0,
n,
once,
match,
Method parse
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.parse(patch, *h)
h = h.size == 1 ? h[0] : Adapter.new(h)
src = dst = nil
state = :start
h.initialize!
Function Deferred
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Deferred: function( func ) {
var tuples = [
// action, add listener, listener list, final state
[ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ],
[ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ],
File patch.rb
has 266 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Olelo
class PatchParser
include Util
class Handler
Function CHILD
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
"CHILD": function( type, what, argument, first, last ) {
var simple = type.slice( 0, 3 ) !== "nth",
forward = type.slice( -4 ) !== "last",
ofType = what === "of-type";
Function doAttribute
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
function doAttribute(n, a, v) {
var u, x;
if (a === 'id') {
u = typeof v === 'string' ? v.toUpperCase() : '';
if (ids[u] === true) {