Function extend
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
exports.extend = function(obj, $extend, registry) {
'use strict';
var ref = $extend || obj.$extend || false;
- 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 mergeObjects
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
exports.mergeObjects = function(obj1, obj2) {
return _.merge(obj1, obj2, function(objectValue, sourceValue, key) {
if (_.isArray(objectValue)) {
- 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 extend
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.extend = function(obj, $extend, registry) {
'use strict';
var ref = $extend || obj.$extend || false;
Function postProcessing
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
exports.postProcessing = function(modelPart) {
'use strict';
for (var key in modelPart) {
- 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 inherit
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
exports.inherit = function(obj, registry) {
'use strict';
if (obj.$path) {
exports.inheritanceStack.push(obj.$path);
- 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 orderObjectProperties
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
exports.orderObjectProperties = function(obj) {
'use strict';
if (obj.properties) {
- 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 mergeObjects
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.mergeObjects = function(obj1, obj2) {
return _.merge(obj1, obj2, function(objectValue, sourceValue, key) {
if (_.isArray(objectValue)) {
Function inherit
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.inherit = function(obj, registry) {
'use strict';
if (obj.$path) {
exports.inheritanceStack.push(obj.$path);
Avoid deeply nested control flow statements. Open
if (obj.properties[obj.$remove[k]]) {
delete obj.properties[obj.$remove[k]];
} else {
log('[W] Cannot remove non existent property "' + obj.$remove[k] + '"');
}