File normalizr.js
has 447 lines of code (exceeds 250 allowed). Consider refactoring. Open
function _defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
Function EntitySchema
has 102 lines of code (exceeds 25 allowed). Consider refactoring. Open
var EntitySchema = /*#__PURE__*/function () {
function EntitySchema(key, definition, options) {
if (definition === void 0) {
definition = {};
}
Function PolymorphicSchema
has a Cognitive Complexity of 26 (exceeds 8 allowed). Consider refactoring. Open
var PolymorphicSchema = /*#__PURE__*/function () {
function PolymorphicSchema(definition, schemaAttribute) {
if (schemaAttribute) {
this._schemaAttribute = typeof schemaAttribute === 'string' ? function (input) {
return input[schemaAttribute];
- 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 EntitySchema
has a Cognitive Complexity of 25 (exceeds 8 allowed). Consider refactoring. Open
var EntitySchema = /*#__PURE__*/function () {
function EntitySchema(key, definition, options) {
if (definition === void 0) {
definition = {};
}
- 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 getUnvisit
has a Cognitive Complexity of 19 (exceeds 8 allowed). Consider refactoring. Open
var getUnvisit = function getUnvisit(entities) {
var cache = {};
var getEntity = getEntities(entities);
return function unvisit(input, schema) {
if (typeof schema === 'object' && (!schema.denormalize || typeof schema.denormalize !== 'function')) {
- 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 PolymorphicSchema
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
var PolymorphicSchema = /*#__PURE__*/function () {
function PolymorphicSchema(definition, schemaAttribute) {
if (schemaAttribute) {
this._schemaAttribute = typeof schemaAttribute === 'string' ? function (input) {
return input[schemaAttribute];
Function EntitySchema
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function EntitySchema(key, definition, options) {
if (definition === void 0) {
definition = {};
}
Function _normalize
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
var _normalize = function normalize(schema, input, parent, key, visit, addEntity, visitedEntities) {
Function normalize
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
var normalize = function normalize(schema, input, parent, key, visit, addEntity, visitedEntities) {
Function normalize
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
_proto.normalize = function normalize(input, parent, key, visit, addEntity, visitedEntities) {
Function visit
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
var visit = function visit(value, parent, key, schema, addEntity, visitedEntities) {
Function normalizeValue
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
_proto.normalizeValue = function normalizeValue(value, parent, key, visit, addEntity, visitedEntities) {
Function normalize
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
_proto.normalize = function normalize(input, parent, key, visit, addEntity, visitedEntities) {
Function normalize
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
_proto.normalize = function normalize(input, parent, key, visit, addEntity, visitedEntities) {
Function normalize
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
_proto.normalize = function normalize(input, parent, key, visit, addEntity, visitedEntities) {
Function unvisitEntity
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
var unvisitEntity = function unvisitEntity(id, schema, unvisit, getEntity, cache) {