Showing 7 of 11 total issues
Function guard
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
const guard = (...args) => {
/**
* Name of the action that should be guarded.
*/
const action = args[0];
- 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 exports
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (config) {
config.set({
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '',
Function guard
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
const guard = (...args) => {
/**
* Name of the action that should be guarded.
*/
const action = args[0];
Function sandbox
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
const sandbox = (...sandboxArgs) => (Target) => {
const sandboxInstance = new Sandbox(...sandboxArgs);
const addMethod = (obj, key, value) => {
if (obj[key]) {
Function _loadPerimeter
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
_loadPerimeter(perimeter) {
if (!isPerimeter(perimeter)) {
throw new ArgumentError(
'Cannot load perimeter. Is it an instance of perimeter?'
);
Function constructor
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
constructor(purpose, opts = {}) {
if (isObject(purpose) && isString(purpose.purpose)) {
opts = purpose;
this.purpose = purpose.purpose;
}
- 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 governess
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
set governess(value) {
// if governess is null perimeter will use the governess of it's sandbox
this._governess = (isGoverness(value)) ?
value : (() => (
isSandbox(this.sandbox) ? this.sandbox.governess : 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"