Showing 9 of 15 total issues
Function ST__CREATE_CONTEXT_P
has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function ST__CREATE_CONTEXT_P(context, type) {
if (type === ST_NONE) return context;
switch(type) {
case ST_RESTRICTED:
// Allow stream module
- 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 _next
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
_next() {
// Allow _next_ to be called
this._busy_ = false;
/* At this point the source is fully compiled
- 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 apply
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
apply(name, context, args, callback) {
// Check for mapped task
if (!this.map.has(name)) {
callback(new Error('Task not found!'));
- 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 apply
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
apply(name, context, args, callback) {
// Check for mapped task
if (!this.map.has(name)) {
callback(new Error('Task not found!'));
Function ST__CREATE_CONTEXT_P
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function ST__CREATE_CONTEXT_P(context, type) {
if (type === ST_NONE) return context;
switch(type) {
case ST_RESTRICTED:
// Allow stream module
Function _next
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
_next() {
// Allow _next_ to be called
this._busy_ = false;
/* At this point the source is fully compiled
Function _compile
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
_compile(task, context) {
// Check if script is not compiled
if (typeof task.func === 'string') {
// Compile script using VM
task.func = new vm.Script(task.func);
- 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 too many return
statements within this function. Open
else return callback(new Error("Unknown error occurred. Failed to compile and execution was halted."));
Avoid too many return
statements within this function. Open
return callback(e);