Showing 17 of 21 total issues
File discrepances.js
has 298 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
"use strict";
(function codenautasModuleDefinition(root, name, factory) {
/* global define */
/* istanbul ignore next */
Function keying
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function keying(falto, object, prefix){
var isContainer=false;
[{
name:'array',
left:"[",
Function compareDates
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function compareDates(a, b) {
if(a.getTime()===b.getTime()){
var co = compareObjects(a,b,{unordered:true});
if(co){
return {date:co.object};
Function nestedObject
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function nestedObject(a, b, opts){
opts = changing(defaultOpts, opts||{});
if(a === b){ return null; }
/*eslint-disable eqeqeq */
if(opts.autoTypeCast && a == b){ return null; }
Function compareObjects
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function compareObjects(a, b, opts, hiddenAttrs) {
var rv = {};
var isOfClassError = !!hiddenAttrs;
hiddenAttrs=hiddenAttrs||[];
var aKeys = hiddenAttrs.concat(Object.keys(a));
Function exports
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(config, preConfig) {
config.set({
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '',
Consider simplifying this complex logical expression. Open
Open
if(opts.unordered) {
aKeys.forEach(function(key) {
setPropertyIf(rv, key, !(key in b) && !isOfClassError && (!opts.notMemberAsUndefined || a[key] != undefined) ? {onlyLeft:a[key]} : nestedObject(a[key], b[key], opts));
});
bKeys.forEach(function(key) {
Consider simplifying this complex logical expression. Open
Open
if(opts.deltaNumber && (typeA === 'number' && typeB === 'number' || typeA === 'number' && !isNaN(b) || typeB === 'number' && !isNaN(a))){
if(opts.deltaNumber && Math.abs(a-b)<opts.deltaNumber){
return null;
}
}
Function compareArrayElem
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function compareArrayElem(resultArray, a, b, index, opts) {
Function compare
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function compare(typeOfObjects, keyA, keyB, valA, valB) {
Function codenautasModuleDefinition
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
(function codenautasModuleDefinition(root, name, factory) {
/* global define */
/* istanbul ignore next */
if(typeof root.globalModuleName !== 'string'){
root.globalModuleName = name;
- 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
Open
return compareClasses(classA, a, b, opts);
Avoid too many return
statements within this function. Open
Open
return compare('classes',nameA,nameB,a,b);
Avoid too many return
statements within this function. Open
Open
return compare('types',typeA,typeB,a,b);
Avoid too many return
statements within this function. Open
Open
if(variable instanceof Object) { return 'Object'; }
Avoid too many return
statements within this function. Open
Open
return {classes:[nameA,nameB]};
Avoid too many return
statements within this function. Open
Open
return opts.duckTyping?'Object':'#null__proto__';