Function getType
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
static getType(object) {
var type = typeof object;
if (type === 'object') {
if (object === 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"
Further reading
Function getType
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
static getType(object) {
var type = typeof object;
if (type === 'object') {
if (object === null) {
Function findInOptions
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
static findInOptions(option, options, path, recursive = false) {
let min = 1e9;
let closestMatch = '';
let closestMatchPath = [];
let lowerCaseOption = option.toLowerCase();
- 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 levenshteinDistance
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
static levenshteinDistance(a, b) {
if (a.length === 0) return b.length;
if (b.length === 0) return a.length;
var matrix = [];
- 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 findInOptions
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
static findInOptions(option, options, path, recursive = false) {
let min = 1e9;
let closestMatch = '';
let closestMatchPath = [];
let lowerCaseOption = option.toLowerCase();
Function printLocation
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
static printLocation(path, option, prefix = 'Problem value found at: \n') {
let str = '\n\n' + prefix + 'options = {\n';
for (let i = 0; i < path.length; i++) {
for (let j = 0; j < i + 1; j++) {
str += ' ';
- 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
return 'string';
Avoid too many return
statements within this function. Open
return 'number';
Avoid too many return
statements within this function. Open
return type;
Avoid too many return
statements within this function. Open
return 'date';
Avoid too many return
statements within this function. Open
return 'object';
Avoid too many return
statements within this function. Open
return 'array';
Avoid too many return
statements within this function. Open
return 'moment';
Avoid too many return
statements within this function. Open
return 'boolean';
Avoid too many return
statements within this function. Open
return 'undefined';
Avoid too many return
statements within this function. Open
return 'dom';
Function check
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
static check(option, options, referenceOptions, path) {
if (referenceOptions[option] === undefined && referenceOptions.__any__ === undefined) {
Validator.getSuggestion(option, referenceOptions, path);
return;
}
- 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
TODO found Open
// TODO: Examine if needed, remove if possible
- Exclude checks