Showing 72 of 568 total issues
Function writeFileSync
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
module.exports.sync = function writeFileSync (filename, data, options) {
if (!options) options = {}
var tmpfile = getTmpname(filename)
try {
- 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 chain
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
function chain (things, cb) {
var res = []
;(function LOOP (i, len) {
if (i >= len) return cb(null,res)
if (Array.isArray(things[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
Function requestAsEventEmitter
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
function requestAsEventEmitter(opts) {
opts = opts || {};
const ee = new EventEmitter();
const requestUrl = opts.href || urlLib.resolve(urlLib.format(opts), opts.path);
Function ReadStream
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
function ReadStream (path, options) {
if (!(this instanceof ReadStream)) return new ReadStream(path, options);
Stream.call(this);
Function hash
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
MurmurHash3.prototype.hash = function(key) {
var h1, k1, i, top, len;
len = key.length;
this.len += len;
Method check_params
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def check_params(lang)
if lang == 'esp'
self.info = "Haga clic en el texto para editar." if self.info.blank?
self.motivations = "Haga clic en el texto para editar." if self.motivations.blank?
self.priorities = "Haga clic en el texto para editar." if self.priorities.blank?
- 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 v1
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
function v1(options, buf, offset) {
var i = buf && offset || 0;
var b = buf || [];
options = options || {};
- 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 sync
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
mkdirP.sync = function sync (p, opts, made) {
if (!opts || typeof opts !== 'object') {
opts = { mode: opts };
}
- 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 asStream
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
function asStream(opts) {
const input = new PassThrough();
const output = new PassThrough();
const proxy = duplexer3(input, output);
Function get
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
module.exports.get = function (obj, path) {
if (!isObj(obj) || typeof path !== 'string') {
return obj;
}
- 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 determine_op_and_update
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def determine_op_and_update(op)
if op == 'add'
self.update({:amount => self.amount + 1})
if self.amount >= 1 and self.amount < 3 and self.level != 1
self.update({:level => 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 v1
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
function v1(options, buf, offset) {
var i = buf && offset || 0;
var b = buf || [];
options = options || {};
Function asPromise
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
function asPromise(opts) {
return new Promise((resolve, reject) => {
const ee = requestAsEventEmitter(opts);
ee.on('request', req => {
Function exports
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (opts) {
opts = objectAssign({}, opts);
var array = opts.array;
var encoding = opts.encoding;
Function get
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
const get = opts => {
const fn = opts.protocol === 'https:' ? https : http;
const req = fn.request(opts, res => {
const statusCode = res.statusCode;
Function DuplexWrapper
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
function DuplexWrapper(options, writable, readable) {
if (typeof readable === "undefined") {
readable = writable;
writable = options;
options = null;
Function patchLutimes
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
function patchLutimes (fs) {
if (constants.hasOwnProperty("O_SYMLINK")) {
fs.lutimes = function (path, at, mt, cb) {
fs.open(path, constants.O_SYMLINK, function (er, fd) {
if (er) {
Function homedir
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function homedir() {
var env = process.env;
var home = env.HOME;
var user = env.LOGNAME || env.USER || env.LNAME || env.USERNAME;
- 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 mkdirP
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
function mkdirP (p, opts, f, made) {
if (typeof opts === 'function') {
f = opts;
opts = {};
}
Function sM
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
function sM(a) {
var b;
if (null !== yr)
b = yr;
else {