Showing 1,896 of 2,859 total issues
Function CheckCStyleCast
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def CheckCStyleCast(filename, linenum, line, raw_line, cast_type, pattern,
Function __init__
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, text, requires, number, config, state, options, handler):
Function GitLog
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def GitLog(self, n=0, format="", grep="", git_hash="", parent_hash="",
Function __init__
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, peer=None, context=None, tests=None, binaries=None,
Function man_role
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def man_role(name, rawtext, text, lineno, inliner, options={}, content=[]):
Function emitKeys
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function emitKeys(stream, s) {
if (util.isBuffer(s)) {
if (s[0] > 127 && util.isUndefined(s[1])) {
s[0] -= 128;
s = '\x1b' + s.toString(stream.encoding || 'utf-8');
- 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 newSection
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function newSection(tok) {
var section = {};
// infer the type from the text.
var text = section.textRaw = tok.text;
if (text.match(eventExpr)) {
- 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
if (!self.paused) {
// Stream must be paused and resumed after SIGCONT to catch
// SIGINT, SIGTSTP, and EOF.
self.pause();
self.emit('SIGCONT');
Function socketOnData
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function socketOnData(d) {
var socket = this;
var req = this._httpMessage;
var parser = this.parser;
- 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
if (this._sawReturn)
this._sawReturn = false;
else
this._line();
Avoid deeply nested control flow statements. Open
if (match.index === posWithinLine) {
break;
}
Function stableSort
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function stableSort(array, compare) {
assert(Array.isArray(array), 'array must be an array');
if (!compare) {
compare = defaultCompare;
- 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
if (base.match(/-\d+\.\d+(\.\d+)?/) || name === '.npm') {
// Exclude versioned names that 'npm' installs.
continue;
}
Avoid deeply nested control flow statements. Open
if (util.isBuffer(s))
s = s.toString('utf-8');
Function processCmdLineArgs
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function processCmdLineArgs() {
var cmdLineOpts = {};
var cmdLineArgs = process.argv.splice(2);
for (var i = 0; i < cmdLineArgs.length; ++i) {
- 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
if (line.length === 0) {
filter = '';
expr = '';
} else if (line[line.length - 1] === '.') {
filter = '';
Avoid deeply nested control flow statements. Open
if (tmp < 0) {
//more to go, recurse
depth += curr.depth;
workIt();
} else if (tmp > 0) {
Avoid deeply nested control flow statements. Open
for (var subexpression = 0; subexpression < newStyle.length; subexpression++) {
matchedString = bestMatch[subexpression + 1];
output(matchedString, newStyle[subexpression]);
}
Avoid deeply nested control flow statements. Open
if (exts.indexOf(ext) !== -1) {
if (!subdir || base !== 'index') {
group.push(subdir + base);
}
} else {
Avoid deeply nested control flow statements. Open
if (!expr) {
// If context is instance of vm.ScriptContext
// Get global vars synchronously
if (this.useGlobal ||
this.context.constructor &&