Showing 16 of 25 total issues

Function forEach has a Cognitive Complexity of 60 (exceeds 20 allowed). Consider refactoring.
Open

    forEach(options) {
        if ( options.value !== undefined ) {
            for ( let i in this ) {
                switch ( options.action ) {
                    case 'attr':    this[i].setAttribute(options.name, options.value);  break;
Severity: Minor
Found in src/EventeSelector.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 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 dealias has a Cognitive Complexity of 32 (exceeds 20 allowed). Consider refactoring.
      Open

          dealias(node, alias, base) {
              let value,
                  regexp = new RegExp('(^|[^a-z])' + alias.replace(/\./g, '\\.') + '([^a-z]|$)', 'gim'),
                  test = new RegExp('{{');
              if ( node instanceof Text ) {
      Severity: Minor
      Found in src/EventeAttributeBase.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 forEach has 78 lines of code (exceeds 50 allowed). Consider refactoring.
      Open

          forEach(options) {
              if ( options.value !== undefined ) {
                  for ( let i in this ) {
                      switch ( options.action ) {
                          case 'attr':    this[i].setAttribute(options.name, options.value);  break;
      Severity: Major
      Found in src/EventeSelector.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

          Function dealias has 56 lines of code (exceeds 50 allowed). Consider refactoring.
          Open

              dealias(node, alias, base) {
                  let value,
                      regexp = new RegExp('(^|[^a-z])' + alias.replace(/\./g, '\\.') + '([^a-z]|$)', 'gim'),
                      test = new RegExp('{{');
                  if ( node instanceof Text ) {
          Severity: Major
          Found in src/EventeAttributeBase.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

                                      if ( !tmp ) return false;
              Severity: Major
              Found in src/EventeSelector.js - About 30 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

                  Avoid too many return statements within this function.
                  Open

                                          if ( !tmp ) return false;
                  Severity: Major
                  Found in src/EventeSelector.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                                            if ( tmp ) return true;
                    Severity: Major
                    Found in src/EventeSelector.js - About 30 mins to fix

                      Function handle has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring.
                      Open

                          handle(route, push) {
                              route = this.normalize(route);
                              if ( this.routes[route] !== undefined ) {
                                  if ( push )
                                      window.history.pushState({}, '', '/' + route);
                      Severity: Minor
                      Found in src/EventeRouter.js - About 25 mins 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 unlink has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring.
                      Open

                          unlink(node, property) {
                              if ( property === undefined ) {
                                  if ( node.e_links !== undefined ) {
                                      for ( let link of node.e_links )
                                          this.unlink(node, link);
                      Severity: Minor
                      Found in src/EventeModel.js - About 25 mins 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