Function normalizeArgs
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
function normalizeArgs(ownArgs, cmnArgs, cmnArgsIndex = 0, ownArgsIndex = 0) {
if (cmnArgs == null && ownArgs == null) {
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
Function buildInstanceByKey
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export function buildInstanceByKey(context, key, buildOptions = {}) {
if (!buildOptions.ctorArgs) {
let { keyToCamelCase, defaultOptions, options, optionsKey } = buildOptions;
if (!optionsKey) {
optionsKey = keyToCamelCase ? camelCase(key, 'options') : key + 'Options';
- 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 buildItem
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export function buildItem(arg, buildOptions = {}) {
if (arg == null) return;
let { BaseClass, ctorArgs, ctorArgsIndex, context } = buildOptions;
- 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 merge
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function merge(v1, v2) {
if (v1 != null && v2 != null) {
if (_.isObject(v1) && _.isObject(v2)) {
return _.extend({}, v1, v2);
} else {
- 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 create(arg.class, args);
Avoid too many return
statements within this function. Open
return buildOptions.buildFromText(arg, ...buildOptions.ctorArgs);
Avoid too many return
statements within this function. Open
return ownArgs || cmnArgs;
Avoid too many return
statements within this function. Open
return merge(ownArgs, cmnArgs);
Avoid too many return
statements within this function. Open
return arg.buid.call(context, arg, ctorArgs, buildOptions, context);
Function buildByKey
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function buildByKey(context, key, buildOptions = {}) {
let getOptions = extractGetOptions(buildOptions);
let arg;
if (isClass(key, buildOptions.BaseClass)) {
arg = key;
- 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"