src/EventeExpression.js

Summary

Maintainability
D
2 days
Test Coverage

Function eval has a Cognitive Complexity of 58 (exceeds 20 allowed). Consider refactoring.
Open

    eval(model, item, property) {
        if ( item === undefined )
            item = this.tree;
        let value, tmp, number, type = typeof item;
        switch ( type ) {
Severity: Minor
Found in src/EventeExpression.js - About 6 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 parse_tree has a Cognitive Complexity of 57 (exceeds 20 allowed). Consider refactoring.
Open

    parse_tree(tokens, item) {
        if ( item === undefined )
            item = {};
        if ( item.params === undefined )
            item.params = [];
Severity: Minor
Found in src/EventeExpression.js - About 6 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

File EventeExpression.js has 320 lines of code (exceeds 250 allowed). Consider refactoring.
Open

const EventeModel = require('./EventeModel');
const EventePipes = require('./EventePipes');
const EventeStrings = require('./EventeStrings');

/**
Severity: Minor
Found in src/EventeExpression.js - About 3 hrs to fix

    Function parse_tree has 88 lines of code (exceeds 50 allowed). Consider refactoring.
    Open

        parse_tree(tokens, item) {
            if ( item === undefined )
                item = {};
            if ( item.params === undefined )
                item.params = [];
    Severity: Major
    Found in src/EventeExpression.js - About 2 hrs to fix

      Function eval has 67 lines of code (exceeds 50 allowed). Consider refactoring.
      Open

          eval(model, item, property) {
              if ( item === undefined )
                  item = this.tree;
              let value, tmp, number, type = typeof item;
              switch ( type ) {
      Severity: Major
      Found in src/EventeExpression.js - About 1 hr to fix

        Avoid deeply nested control flow statements.
        Open

                                    if ( EventeExpression.operations[item.type].priority >= EventeExpression.operations['.'].priority )
                                        item = {type: '.', params: [item, token]};
                                    else
                                        item.params.push({type: '.', params: [item.params.pop(), token]});
        Severity: Major
        Found in src/EventeExpression.js - About 45 mins to fix

          Avoid too many return statements within this function.
          Open

                  return item;
          Severity: Major
          Found in src/EventeExpression.js - About 30 mins to fix

            There are no issues that match your filters.

            Category
            Status