benmarch/spel2js

View on GitHub

Showing 51 of 95 total issues

Function SpelExpressionParser has a Cognitive Complexity of 323 (exceeds 5 allowed). Consider refactoring.
Open

export var SpelExpressionParser = function () {


    var VALID_QUALIFIED_ID_PATTERN = new RegExp('[\\p{L}\\p{N}_$]+');

Severity: Minor
Found in src/SpelExpressionParser.js - About 6 days 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 tokenize has a Cognitive Complexity of 182 (exceeds 5 allowed). Consider refactoring.
Open

function tokenize(inputData) {
    var expressionString = inputData,
        toProcess = inputData + '\0',
        max = toProcess.length,
        pos = 0,
Severity: Minor
Found in src/Tokenizer.js - About 3 days 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 SpelExpressionParser has 738 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export var SpelExpressionParser = function () {


    var VALID_QUALIFIED_ID_PATTERN = new RegExp('[\\p{L}\\p{N}_$]+');

Severity: Major
Found in src/SpelExpressionParser.js - About 3 days to fix

    Function tokenize has 464 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function tokenize(inputData) {
        var expressionString = inputData,
            toProcess = inputData + '\0',
            max = toProcess.length,
            pos = 0,
    Severity: Major
    Found in src/Tokenizer.js - About 2 days to fix

      File SpelExpressionParser.js has 784 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /*
       * Copyright 2002-2015 the original author or authors.
       *
       * Licensed under the Apache License, Version 2.0 (the "License");
       * you may not use this file except in compliance with the License.
      Severity: Major
      Found in src/SpelExpressionParser.js - About 1 day to fix

        File Tokenizer.js has 495 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /*
         * Copyright 2002-2015 the original author or authors.
         *
         * Licensed under the Apache License, Version 2.0 (the "License");
         * you may not use this file except in compliance with the License.
        Severity: Minor
        Found in src/Tokenizer.js - About 7 hrs to fix

          Function process has 192 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function process() {
                  var ch;
          
                  while (pos < max) {
                      ch = toProcess[pos];
          Severity: Major
          Found in src/Tokenizer.js - About 7 hrs to fix

            Function lexNumericLiteral has 96 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function lexNumericLiteral(firstCharIsZero) {
                    var isReal = false,
                        start = pos,
                        ch = toProcess[pos + 1],
                        isHex = ch === 'x' || ch === 'X',
            Severity: Major
            Found in src/Tokenizer.js - About 3 hrs to fix

              Function createNode has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
              Open

              function createNode(nullSafeNavigation, methodName, position, args) {
                  var node = SpelNode.create('method', position);
              
                  node.getRaw = function () {
                      return {
              Severity: Minor
              Found in src/ast/MethodReference.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 createSpelNode has 73 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function createSpelNode(nodeType, position, ...operands) {
                  var node = {},
                      type = nodeType || 'Abstract',
                      children = [],
                      parent = null,
              Severity: Major
              Found in src/ast/SpelNode.js - About 2 hrs to fix

                Function createNode has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function createNode(nullSafeNavigation, methodName, position, args) {
                    var node = SpelNode.create('method', position);
                
                    node.getRaw = function () {
                        return {
                Severity: Major
                Found in src/ast/MethodReference.js - About 2 hrs to fix

                  Function createNode has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function createNode(nullSafeNavigation, propertyName, position) {
                      var node = SpelNode.create('property', position);
                  
                      node.getRaw = function () {
                          return propertyName;
                  Severity: Minor
                  Found in src/ast/PropertyReference.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 createNode has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                  Open

                   function createNode(position, dimensions, nodes) {
                      var isArray = nodes !== undefined;
                      var dimension;
                      if (isArray) {
                          dimension = dimensions.length && dimensions[0] && dimensions[0].getType() === 'number' ? dimensions[0].getValue() : null;
                  Severity: Minor
                  Found in src/ast/ConstructorReference.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 maybeEatInlineListOrMap has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      function maybeEatInlineListOrMap() {
                          var token = peekToken(),
                              listElements = [];
                  
                          if (!peekTokenConsumeIfMatched(TokenKind.LCURLY, true)) {
                  Severity: Minor
                  Found in src/SpelExpressionParser.js - About 1 hr to fix

                    Function getValue has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        node.getValue = function (state) {
                            var context = state.activeContext.peek(),
                                compiledArgs = [],
                                method;
                    
                    
                    Severity: Minor
                    Found in src/ast/MethodReference.js - About 1 hr to fix

                      Function createNode has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function createNode(nullSafeNavigation, propertyName, position) {
                          var node = SpelNode.create('property', position);
                      
                          node.getRaw = function () {
                              return propertyName;
                      Severity: Minor
                      Found in src/ast/PropertyReference.js - About 1 hr to fix

                        Function createNode has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function createNode(position, expressionComponents) {
                            var node = SpelNode.create.apply(null, ['compound', position].concat(expressionComponents));
                        
                            function buildContextStack(state) {
                                var childrenCount = node.getChildren().length,
                        Severity: Minor
                        Found in src/ast/CompoundExpression.js - About 1 hr to fix

                          Function selectFromMap has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function selectFromMap(collection, whichElement, expr, state) {
                              var newCollection = {},
                                  entry,
                                  key,
                                  entries = [],
                          Severity: Minor
                          Found in src/ast/Selection.js - About 1 hr to fix

                            Function eatRelationalExpression has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                function eatRelationalExpression() {
                                    var expr = eatSumExpression();
                                    var relationalOperatorToken = maybeEatRelationalOperator();
                                    if (relationalOperatorToken !== null) {
                                        var token = nextToken();  // consume relational operator token
                            Severity: Minor
                            Found in src/SpelExpressionParser.js - About 1 hr to fix

                              Function createNode has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                               function createNode(position, dimensions, nodes) {
                                  var isArray = nodes !== undefined;
                                  var dimension;
                                  if (isArray) {
                                      dimension = dimensions.length && dimensions[0] && dimensions[0].getType() === 'number' ? dimensions[0].getValue() : null;
                              Severity: Minor
                              Found in src/ast/ConstructorReference.js - About 1 hr to fix
                                Severity
                                Category
                                Status
                                Source
                                Language