Showing 7 of 7 total issues
Function middlewareFor
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
function middlewareFor(ctx, key) {
return function* contextSetupMiddleware(next) {
if (typeof ctx === 'function') {
if (!key) {
throw new TypeError('Cannot set function context for route witout key name');
- 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 connectionString
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
set connectionString (conStr) {
if (conStr) {
try {
var uri = url.parse(conStr);
} catch(err) {
- 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 loadFrom
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
loadFrom (folder) {
var modulesDir = fs.existsSync(`${folder}/node_modules`) ? `${folder}/node_modules` : folder;
var usePrefix = this.prefix && folder !== modulesDir;
for (let node of new FsNode(modulesDir)) {
if (!node.isDirectory || /^\./.test(node.basename)) {
- 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 constructor
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor (config) {
super();
var homeDir = process.env.HOME;
var dir = process.cwd();
var descriptor = new this.ModuleDescriptor(process.cwd());
Function setupTransports
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
static setupTransports (config, transports) {
transports = transports || Logger.transports;
if (typeof config !== 'object') {
return transports;
- 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 serverErrorHandlerMiddleware
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function * serverErrorHandlerMiddleware(next) {
Object.defineProperty(this, 'errors', {value: []});
try {
yield next;
- 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 constructor
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
constructor (options, prefix) {
if (typeof options === 'string') {
prefix = options;
options = null;
}
- 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"