Showing 236 of 328 total issues
Avoid deeply nested control flow statements. Open
Open
} else if (isWhiteSpace(ch)) {
++index;
} else if (isLineTerminator(ch)) {
++index;
if (ch === 13 && source.charCodeAt(index) === 10) {
Avoid deeply nested control flow statements. Open
Open
if (!((operator.value === 'in' || init.kind !== 'var') && init.declarations[0].init)) {
lex();
left = init;
right = parseExpression();
init = null;
Avoid deeply nested control flow statements. Open
Open
if (expr.argument.type === Syntax.ObjectPattern) {
throwError({}, Messages.ObjectPatternAsSpread);
}
Avoid deeply nested control flow statements. Open
Open
switch (ch) {
case 'n':
cooked += '\n';
break;
case 'r':
Avoid deeply nested control flow statements. Open
Open
if (ch === '\r' && source[index] === '\n') {
++index;
}
Avoid deeply nested control flow statements. Open
Open
} else if (isWhiteSpace(ch.charCodeAt(0))) {
++index;
} else if (isLineTerminator(ch.charCodeAt(0))) {
++index;
if (ch === '\r' && source[index] === '\n') {
Function performRequest
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
performRequest: function(host, method, template, values, payload, contentType) {
Method items_html
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
def items_html
return unless items = @schema["items"]
return if items.size == 0
html = ""
- 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
Avoid deeply nested control flow statements. Open
Open
if (ch === '/') {
loc = {
start: {
line: lineNumber,
column: index - lineStart
Avoid deeply nested control flow statements. Open
Open
if (ch === '*') {
ch = source[index];
if (ch === '/') {
comment = comment.substr(0, comment.length - 1);
blockComment = false;
Avoid deeply nested control flow statements. Open
Open
if (index >= length) {
throwError({}, Messages.UnexpectedToken, 'ILLEGAL');
}
Avoid deeply nested control flow statements. Open
Open
for (var i = 0; i < parentNode.params.length; i++) {
param = parentNode.params[i];
if (param.type === Syntax.Identifier) {
state.localScope.identifiers[param.name] = true;
}
Method properties_html
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
def properties_html
properties = if (props = @schema["properties"]).present?
props
elsif (ref_path = @schema["$ref"]).present?
ref = Lurker::RefObject.new(ref_path, options[:root_path])
- 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
Avoid deeply nested control flow statements. Open
Open
if (index >= length) {
throwError({}, Messages.UnexpectedToken, 'ILLEGAL');
}
Consider simplifying this complex logical expression. Open
Open
if (checkToken &&
checkToken.type === 'Keyword' &&
(checkToken.value === 'if' ||
checkToken.value === 'while' ||
checkToken.value === 'for' ||
Function _writeUInt32
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function _writeUInt32 (buf, value, offset, littleEndian, noAssert) {
Function _writeInt16
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function _writeInt16 (buf, value, offset, littleEndian, noAssert) {
Function SourceNode
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function SourceNode(aLine, aColumn, aSource, aChunks, aName) {
Function _writeInt32
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function _writeInt32 (buf, value, offset, littleEndian, noAssert) {
Function recursiveSearch
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare) {