maksim-chekrishov/redux-rest-adapter

View on GitHub

Showing 5 of 5 total issues

Function hasCyclicReferences has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

export function hasCyclicReferences(obj) {
  var seenObjects = [];

  function detect(obj) {
    if (obj && typeof obj === 'object') {
Severity: Minor
Found in src/utils.js - About 1 hr 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 buildCRUDExtensionsForList has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  static buildCRUDExtensionsForList({createSuccess, updateSuccess, deleteSuccess}, resourceKey, idKey) {
    resourceKey = resourceKey || 'data';
    idKey = idKey || 'id';

    const opt = arguments[0];
Severity: Minor
Found in src/reducers-builder.js - About 1 hr to fix

    Function actionsTypes has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

      get actionsTypes() {
        const _this = this;
    
        // Private property for lazy getter
        if (!this._actionsTypes) {
    Severity: Minor
    Found in src/entity-api.js - About 1 hr 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 _parseLoadOptions has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      _parseLoadOptions(options) {
        let queryString = '';
        let params = {};
    
        const paramsType = typeof options;
    Severity: Minor
    Found in src/entity-api.js - About 1 hr to fix

      Function _parseLoadOptions has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

        _parseLoadOptions(options) {
          let queryString = '';
          let params = {};
      
          const paramsType = typeof options;
      Severity: Minor
      Found in src/entity-api.js - About 1 hr 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

      Severity
      Category
      Status
      Source
      Language