SUSE/stratos

View on GitHub
src/frontend/packages/store/src/normalizr/normalizr.js

Summary

Maintainability
F
3 days
Test Coverage

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;
Severity: Minor
Found in src/frontend/packages/store/src/normalizr/normalizr.js - About 6 hrs to fix

    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 = {};
        }
    Severity: Major
    Found in src/frontend/packages/store/src/normalizr/normalizr.js - About 4 hrs to fix

      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];
      Severity: Minor
      Found in src/frontend/packages/store/src/normalizr/normalizr.js - About 3 hrs to fix

      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 = {};
          }
      Severity: Minor
      Found in src/frontend/packages/store/src/normalizr/normalizr.js - About 3 hrs to fix

      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')) {
      Severity: Minor
      Found in src/frontend/packages/store/src/normalizr/normalizr.js - About 2 hrs to fix

      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];
      Severity: Minor
      Found in src/frontend/packages/store/src/normalizr/normalizr.js - About 1 hr to fix

        Function EntitySchema has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          function EntitySchema(key, definition, options) {
            if (definition === void 0) {
              definition = {};
            }
        
        
        Severity: Minor
        Found in src/frontend/packages/store/src/normalizr/normalizr.js - About 1 hr to fix

          Function _normalize has 7 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          var _normalize = function normalize(schema, input, parent, key, visit, addEntity, visitedEntities) {
          Severity: Major
          Found in src/frontend/packages/store/src/normalizr/normalizr.js - About 50 mins to fix

            Function normalize has 7 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            var normalize = function normalize(schema, input, parent, key, visit, addEntity, visitedEntities) {
            Severity: Major
            Found in src/frontend/packages/store/src/normalizr/normalizr.js - About 50 mins to fix

              Function normalize has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                _proto.normalize = function normalize(input, parent, key, visit, addEntity, visitedEntities) {
              Severity: Minor
              Found in src/frontend/packages/store/src/normalizr/normalizr.js - About 45 mins to fix

                Function visit has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                var visit = function visit(value, parent, key, schema, addEntity, visitedEntities) {
                Severity: Minor
                Found in src/frontend/packages/store/src/normalizr/normalizr.js - About 45 mins to fix

                  Function normalizeValue has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                    _proto.normalizeValue = function normalizeValue(value, parent, key, visit, addEntity, visitedEntities) {
                  Severity: Minor
                  Found in src/frontend/packages/store/src/normalizr/normalizr.js - About 45 mins to fix

                    Function normalize has 6 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                      _proto.normalize = function normalize(input, parent, key, visit, addEntity, visitedEntities) {
                    Severity: Minor
                    Found in src/frontend/packages/store/src/normalizr/normalizr.js - About 45 mins to fix

                      Function normalize has 6 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                        _proto.normalize = function normalize(input, parent, key, visit, addEntity, visitedEntities) {
                      Severity: Minor
                      Found in src/frontend/packages/store/src/normalizr/normalizr.js - About 45 mins to fix

                        Function normalize has 6 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                          _proto.normalize = function normalize(input, parent, key, visit, addEntity, visitedEntities) {
                        Severity: Minor
                        Found in src/frontend/packages/store/src/normalizr/normalizr.js - About 45 mins to fix

                          Function unvisitEntity has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                          var unvisitEntity = function unvisitEntity(id, schema, unvisit, getEntity, cache) {
                          Severity: Minor
                          Found in src/frontend/packages/store/src/normalizr/normalizr.js - About 35 mins to fix

                            There are no issues that match your filters.

                            Category
                            Status