Showing 6 of 18 total issues
Function ofAnyCase
has 96 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function ofAnyCase(callable, config = {}) {
{
const { args, defaults, error, retries, timeout } = { ...config };
config = { args, defaults, error, retries, timeout };
}
Function ofAny
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function ofAny(callable, args, defaultResult, overrideError) {
let call;
switch (callable.constructor.name || Object.prototype.toString.call(callable)) {
case PROMISE:
call = callable;
Function ofAnyCase
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
export function ofAnyCase(callable, config = {}) {
{
const { args, defaults, error, retries, timeout } = { ...config };
config = { args, defaults, error, retries, timeout };
}
- 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 ofCase
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function ofCase(promise, config = {}) {
{
const { args, defaults, error, timeout } = { ...config };
config = { args, defaults, error, timeout };
}
Function ofCase
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export function ofCase(promise, config = {}) {
{
const { args, defaults, error, timeout } = { ...config };
config = { args, defaults, error, timeout };
}
- 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 ofSync
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export function ofSync(callable, args, defaultResult, overrideError) {
if (!isFunction(callable)) {
return [undefined, new Error(ERR_UNKNOWN)];
}
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"