kachkaev/humane-math

View on GitHub
src/core/analysis/2-syntactic/tree.js

Summary

Maintainability
F
1 wk
Test Coverage

Function subparseFactor has a Cognitive Complexity of 100 (exceeds 5 allowed). Consider refactoring.
Open

  subparseFactor() {
    var currentNode = this.createEmptyTreeNode();
    var firstNodeToken = this.tokenStream.currentToken();

    // Depending on the type of a token, parse a factor differently
Severity: Minor
Found in src/core/analysis/2-syntactic/tree.js - About 2 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

File tree.js has 601 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import _ from 'underscore';
import {Message}      from '../message';
import {MessageList}  from '../message-list';
import {Pos}          from '../pos';
import {TokenType}    from '../1-lexical/token-type';
Severity: Major
Found in src/core/analysis/2-syntactic/tree.js - About 1 day to fix

    Function subparseFactor has 230 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      subparseFactor() {
        var currentNode = this.createEmptyTreeNode();
        var firstNodeToken = this.tokenStream.currentToken();
    
        // Depending on the type of a token, parse a factor differently
    Severity: Major
    Found in src/core/analysis/2-syntactic/tree.js - About 1 day to fix

      Function subparseStatementSequence has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
      Open

        subparseStatementSequence() {
      
          var currentNode = this.createEmptyTreeNode();
          var firstNodeToken = this.tokenStream.currentToken();
      
      
      Severity: Minor
      Found in src/core/analysis/2-syntactic/tree.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 subparseTerm has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
      Open

        subparseTerm() {
          var currentNode = this.createEmptyTreeNode();
          var firstNodeToken = this.tokenStream.currentToken();
          currentNode.type = TreeNodeType.TERM;
      
      
      Severity: Minor
      Found in src/core/analysis/2-syntactic/tree.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 subparseTerm has 69 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        subparseTerm() {
          var currentNode = this.createEmptyTreeNode();
          var firstNodeToken = this.tokenStream.currentToken();
          currentNode.type = TreeNodeType.TERM;
      
      
      Severity: Major
      Found in src/core/analysis/2-syntactic/tree.js - About 2 hrs to fix

        Function subparseStatementSequence has 65 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          subparseStatementSequence() {
        
            var currentNode = this.createEmptyTreeNode();
            var firstNodeToken = this.tokenStream.currentToken();
        
        
        Severity: Major
        Found in src/core/analysis/2-syntactic/tree.js - About 2 hrs to fix

          Function subparseStatement has 58 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            subparseStatement() {
              var currentNode = this.createEmptyTreeNode();
              var firstNodeToken = this.tokenStream.currentToken();
          
              var leftPart = this.subparseExpression();
          Severity: Major
          Found in src/core/analysis/2-syntactic/tree.js - About 2 hrs to fix

            Function checkForMissedOperands has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
            Open

              checkForMissedOperands() {
                this.tokenStream.firstToken(true);
                var previousToken;
                var currentToken;
                var nextToken;
            Severity: Minor
            Found in src/core/analysis/2-syntactic/tree.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 checkForMissedOperands has 44 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              checkForMissedOperands() {
                this.tokenStream.firstToken(true);
                var previousToken;
                var currentToken;
                var nextToken;
            Severity: Minor
            Found in src/core/analysis/2-syntactic/tree.js - About 1 hr to fix

              Function subparseExpression has 37 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                subparseExpression() {
                  var currentNode = this.createEmptyTreeNode();
                  var firstNodeToken = this.tokenStream.currentToken();
              
                  // Extract the first possible sub-node (term)
              Severity: Minor
              Found in src/core/analysis/2-syntactic/tree.js - About 1 hr to fix

                Consider simplifying this complex logical expression.
                Open

                    if (this.tokenStream.currentToken().isErrorToken()
                        && !this.tokenStream.currentToken().isMathOperator()
                        && !this.tokenStream.currentToken().isRightBracket()) {
                      currentNode.type = TreeNodeType.UNPARSED;
                      while ((
                Severity: Critical
                Found in src/core/analysis/2-syntactic/tree.js - About 1 hr to fix

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

                    subparseStatement() {
                      var currentNode = this.createEmptyTreeNode();
                      var firstNodeToken = this.tokenStream.currentToken();
                  
                      var leftPart = this.subparseExpression();
                  Severity: Minor
                  Found in src/core/analysis/2-syntactic/tree.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 subparsePower has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    subparsePower() {
                      var currentNode = this.createEmptyTreeNode();
                      var firstNodeToken = this.tokenStream.currentToken();
                  
                      // Extract the first possible sub-node (power)
                  Severity: Minor
                  Found in src/core/analysis/2-syntactic/tree.js - About 1 hr to fix

                    Function subparseExpression has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                    Open

                      subparseExpression() {
                        var currentNode = this.createEmptyTreeNode();
                        var firstNodeToken = this.tokenStream.currentToken();
                    
                        // Extract the first possible sub-node (term)
                    Severity: Minor
                    Found in src/core/analysis/2-syntactic/tree.js - About 55 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

                    Avoid deeply nested control flow statements.
                    Open

                                if (stopSymbol) {
                                  currentArgument.pos = Pos.unite(
                                      currentArgument.pos,
                                      this.tokenStream.previousToken().pos
                                    );
                    Severity: Major
                    Found in src/core/analysis/2-syntactic/tree.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                  if (this.tokenStream.currentToken().type == TokenType.COMMA
                                      || this.tokenStream.currentToken().type == TokenType.SEMICOLON) {
                                    // It is an error if it is a semicolon
                                    if (this.tokenStream.currentToken().type == TokenType.SEMICOLON) {
                                      this.errors.add(new Message(
                      Severity: Major
                      Found in src/core/analysis/2-syntactic/tree.js - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                  if (!(this.tokenStream.previousToken().isErrorToken() && !this.tokenStream.previousToken().isMathOperator())
                                      || this.tokenStream.previousToken().isNumber()) {
                                    this.errors.add(new Message('e_syn_missing_multiply',
                                        Pos.between(
                                          this.tokenStream.previousToken().pos,
                        Severity: Major
                        Found in src/core/analysis/2-syntactic/tree.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                      if (!this.tokenStream.currentToken().isEOF()) {
                                        // If the content of the parsed part of the expression
                                        // is a single factor, add it as the sub-node for this expression.
                                        // This is made for further semantic check of it.
                                        if (currentArgument.type == TreeNodeType.SYMBOL
                          Severity: Major
                          Found in src/core/analysis/2-syntactic/tree.js - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                        if (this.tokenStream.currentToken().isRightBracket()) {
                                          // Get the position of the current node
                                          currentNode.pos = Pos.unite(
                                              firstNodeToken.pos,
                                              this.tokenStream.currentToken().pos
                            Severity: Major
                            Found in src/core/analysis/2-syntactic/tree.js - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                        if (stopSymbol.isRightBracket()) {
                                          currentNode.pos = Pos.unite(
                                              firstNodeToken.pos,
                                              this.tokenStream.currentToken().pos
                                            );
                              Severity: Major
                              Found in src/core/analysis/2-syntactic/tree.js - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                            if (this.tokenStream.currentToken().isRightBracket()
                                                || this.tokenStream.currentToken().type == TokenType.COMMA
                                                || this.tokenStream.currentToken().type == TokenType.SEMICOLON) {
                                              // Check if an argument is empty and add an error if so
                                              if (currentArgument.type == TreeNodeType.EMPTY) {
                                Severity: Major
                                Found in src/core/analysis/2-syntactic/tree.js - About 45 mins to fix

                                  Consider simplifying this complex logical expression.
                                  Open

                                        if (this.tokenStream.currentToken().isTermSign()
                                            || (this.tokenStream.currentToken().isErrorToken()
                                                && !this.tokenStream.currentToken().isStatementSign()
                                                && !this.tokenStream.currentToken().isNumber()
                                                && !this.tokenStream.currentToken().isLeftBracket() && !this.tokenStream
                                  Severity: Major
                                  Found in src/core/analysis/2-syntactic/tree.js - About 40 mins to fix

                                    Consider simplifying this complex logical expression.
                                    Open

                                            if (!nextToken
                                                || !(nextToken.isMathOperator() || nextToken.isNumber()
                                                    || nextToken.isSymbol() || nextToken
                                                    .isLeftBracket())
                                                && nextToken.type !== TokenType.E_REST) {
                                    Severity: Major
                                    Found in src/core/analysis/2-syntactic/tree.js - About 40 mins to fix

                                      Consider simplifying this complex logical expression.
                                      Open

                                              if (currentToken.type != TokenType.SUBTRACT
                                                  && (!previousToken || !(previousToken.isMathOperator()
                                                      || previousToken.isRightBracket()
                                                      || previousToken.isNumber() || previousToken
                                                      .isSymbol()))) {
                                      Severity: Major
                                      Found in src/core/analysis/2-syntactic/tree.js - About 40 mins to fix

                                        Avoid too many return statements within this function.
                                        Open

                                                return currentNode;
                                        Severity: Major
                                        Found in src/core/analysis/2-syntactic/tree.js - About 30 mins to fix

                                          Avoid too many return statements within this function.
                                          Open

                                              return currentNode;
                                          Severity: Major
                                          Found in src/core/analysis/2-syntactic/tree.js - About 30 mins to fix

                                            Avoid too many return statements within this function.
                                            Open

                                                    return currentNode;
                                            Severity: Major
                                            Found in src/core/analysis/2-syntactic/tree.js - About 30 mins to fix

                                              Similar blocks of code found in 2 locations. Consider refactoring.
                                              Open

                                                  _.each(currentNode.subNodes, function(subNode) {
                                                    if (subNode.hasErrors || subNode.type == TreeNodeType.EMPTY) {
                                                      currentNode.hasErrors = true;
                                                      _.breakLoop();
                                                    }
                                              Severity: Major
                                              Found in src/core/analysis/2-syntactic/tree.js and 1 other location - About 2 hrs to fix
                                              src/core/analysis/2-syntactic/tree.js on lines 508..513

                                              Duplicated Code

                                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                              Tuning

                                              This issue has a mass of 75.

                                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                              Refactorings

                                              Further Reading

                                              Similar blocks of code found in 2 locations. Consider refactoring.
                                              Open

                                                  _.each(currentNode.subNodes, function(subNode) {
                                                    if (subNode.hasErrors || subNode.type == TreeNodeType.EMPTY) {
                                                      currentNode.hasErrors = true;
                                                      _.breakLoop();
                                                    }
                                              Severity: Major
                                              Found in src/core/analysis/2-syntactic/tree.js and 1 other location - About 2 hrs to fix
                                              src/core/analysis/2-syntactic/tree.js on lines 455..460

                                              Duplicated Code

                                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                              Tuning

                                              This issue has a mass of 75.

                                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                              Refactorings

                                              Further Reading

                                              Similar blocks of code found in 2 locations. Consider refactoring.
                                              Open

                                                      if (currentSubNode.type == TreeNodeType.SYMBOL
                                                          || currentSubNode.type == TreeNodeType.NUMBER
                                                          || currentSubNode.type == TreeNodeType.FUNCTION) {
                                                        currentSubNode = this.wrapNode(currentSubNode);
                                                      }
                                              Severity: Major
                                              Found in src/core/analysis/2-syntactic/tree.js and 1 other location - About 1 hr to fix
                                              src/core/analysis/2-syntactic/tree.js on lines 789..793

                                              Duplicated Code

                                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                              Tuning

                                              This issue has a mass of 70.

                                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                              Refactorings

                                              Further Reading

                                              Similar blocks of code found in 2 locations. Consider refactoring.
                                              Open

                                                      if (currentNode.type == TreeNodeType.SYMBOL
                                                          || currentNode.type == TreeNodeType.NUMBER
                                                          || currentNode.type == TreeNodeType.FUNCTION) {
                                                        currentNode = this.wrapNode(currentNode);
                                                      }
                                              Severity: Major
                                              Found in src/core/analysis/2-syntactic/tree.js and 1 other location - About 1 hr to fix
                                              src/core/analysis/2-syntactic/tree.js on lines 149..153

                                              Duplicated Code

                                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                              Tuning

                                              This issue has a mass of 70.

                                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                              Refactorings

                                              Further Reading

                                              Similar blocks of code found in 2 locations. Consider refactoring.
                                              Open

                                                  if (this.tokenStream.currentToken().type != TokenType.EOF) {
                                                    this.errors.add(new Message(
                                                      'e_syn_unknown',
                                                      this.tokenStream.currentToken().pos
                                                    ));
                                              Severity: Major
                                              Found in src/core/analysis/2-syntactic/tree.js and 1 other location - About 1 hr to fix
                                              src/core/analysis/2-syntactic/tree.js on lines 105..110

                                              Duplicated Code

                                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                              Tuning

                                              This issue has a mass of 69.

                                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                              Refactorings

                                              Further Reading

                                              Similar blocks of code found in 2 locations. Consider refactoring.
                                              Open

                                                      if (this.tokenStream.currentToken().type == TokenType.COMMA) {
                                                        this.errors.add(new Message(
                                                            'e_syn_statements_comma',
                                                            this.tokenStream.currentToken().pos
                                                          ));
                                              Severity: Major
                                              Found in src/core/analysis/2-syntactic/tree.js and 1 other location - About 1 hr to fix
                                              src/core/analysis/2-syntactic/tree.js on lines 63..68

                                              Duplicated Code

                                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                              Tuning

                                              This issue has a mass of 69.

                                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                              Refactorings

                                              Further Reading

                                              Similar blocks of code found in 2 locations. Consider refactoring.
                                              Open

                                                  if (this.tokenStream.currentToken().isErrorToken()
                                                      && !this.tokenStream.currentToken().isMathOperator()
                                                      && !this.tokenStream.currentToken().isRightBracket()) {
                                              Severity: Major
                                              Found in src/core/analysis/2-syntactic/tree.js and 1 other location - About 1 hr to fix
                                              src/core/analysis/2-syntactic/tree.js on lines 385..387

                                              Duplicated Code

                                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                              Tuning

                                              This issue has a mass of 67.

                                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                              Refactorings

                                              Further Reading

                                              Similar blocks of code found in 2 locations. Consider refactoring.
                                              Open

                                                        || (this.tokenStream.currentToken().isErrorToken()
                                                            && !this.tokenStream.currentToken().isStatementSign()
                                                            && !this.tokenStream.currentToken().isNumber()
                                              Severity: Major
                                              Found in src/core/analysis/2-syntactic/tree.js and 1 other location - About 1 hr to fix
                                              src/core/analysis/2-syntactic/tree.js on lines 857..859

                                              Duplicated Code

                                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                              Tuning

                                              This issue has a mass of 67.

                                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                              Refactorings

                                              Further Reading

                                              Similar blocks of code found in 2 locations. Consider refactoring.
                                              Open

                                                          (this.tokenStream.currentToken().isNumber() || this.tokenStream.currentToken().isSymbol())
                                                          && this.tokenStream.nextToken().isErrorToken() && !this.tokenStream.nextToken().isMathOperator()
                                              Severity: Major
                                              Found in src/core/analysis/2-syntactic/tree.js and 1 other location - About 1 hr to fix
                                              src/core/analysis/2-syntactic/tree.js on lines 401..403

                                              Duplicated Code

                                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                              Tuning

                                              This issue has a mass of 63.

                                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                              Refactorings

                                              Further Reading

                                              Similar blocks of code found in 2 locations. Consider refactoring.
                                              Open

                                                    } else if (this.tokenStream.currentToken().isNumber()
                                                        || this.tokenStream.currentToken().isLeftBracket()
                                                        || this.tokenStream.currentToken().isSymbol()) {
                                              Severity: Major
                                              Found in src/core/analysis/2-syntactic/tree.js and 1 other location - About 1 hr to fix
                                              src/core/analysis/2-syntactic/tree.js on lines 865..866

                                              Duplicated Code

                                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                              Tuning

                                              This issue has a mass of 63.

                                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                              Refactorings

                                              Further Reading

                                              Similar blocks of code found in 2 locations. Consider refactoring.
                                              Open

                                                      if (this.tokenStream.currentToken().isRightBracket()) {
                                                        this.errors.add(new Message(
                                                            'e_syn_extra_rb',
                                                            this.tokenStream.currentToken().pos,
                                                            {currentToken: this.tokenStream.currentToken()}
                                              Severity: Major
                                              Found in src/core/analysis/2-syntactic/tree.js and 1 other location - About 1 hr to fix
                                              src/core/analysis/2-syntactic/tree.js on lines 126..135

                                              Duplicated Code

                                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                              Tuning

                                              This issue has a mass of 59.

                                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                              Refactorings

                                              Further Reading

                                              Similar blocks of code found in 2 locations. Consider refactoring.
                                              Open

                                                      } else if (!this.tokenStream.currentToken().isErrorToken()) {
                                                        this.errors.add(new Message(
                                                            'e_syn_statements_wrong_symbol',
                                                            this.tokenStream.currentToken().pos,
                                                            {currentToken: this.tokenStream.currentToken()}
                                              Severity: Major
                                              Found in src/core/analysis/2-syntactic/tree.js and 1 other location - About 1 hr to fix
                                              src/core/analysis/2-syntactic/tree.js on lines 119..135

                                              Duplicated Code

                                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                              Tuning

                                              This issue has a mass of 59.

                                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                              Refactorings

                                              Further Reading

                                              Similar blocks of code found in 2 locations. Consider refactoring.
                                              Open

                                                            if (!this.tokenStream.currentToken().isErrorToken()) {
                                                              this.errors.add(new Message(
                                                                  'e_syn_function_argument_wrong_symbol',
                                                                  this.tokenStream.currentToken().pos,
                                                                  {currentToken: this.tokenStream.currentToken()}
                                              Severity: Major
                                              Found in src/core/analysis/2-syntactic/tree.js and 1 other location - About 1 hr to fix
                                              src/core/analysis/2-syntactic/tree.js on lines 798..806

                                              Duplicated Code

                                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                              Tuning

                                              This issue has a mass of 57.

                                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                              Refactorings

                                              Further Reading

                                              Similar blocks of code found in 2 locations. Consider refactoring.
                                              Open

                                                      if (!this.tokenStream.currentToken().isErrorToken()
                                                          && !this.tokenStream.currentToken().isEOF()
                                                          && this.tokenStream.currentToken().type != TokenType.SEMICOLON) {
                                                        this.errors.add(new Message(
                                                          'e_syn_brackets_wrong_symbol',
                                              Severity: Major
                                              Found in src/core/analysis/2-syntactic/tree.js and 1 other location - About 1 hr to fix
                                              src/core/analysis/2-syntactic/tree.js on lines 680..686

                                              Duplicated Code

                                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                              Tuning

                                              This issue has a mass of 57.

                                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                              Refactorings

                                              Further Reading

                                              Similar blocks of code found in 2 locations. Consider refactoring.
                                              Open

                                                    if (this.tokenStream.currentToken().type == TokenType.SEMICOLON
                                                        || this.tokenStream.currentToken().type == TokenType.COMMA) {
                                              
                                                      // Add sub-action (semicolon or comma position must be kept)
                                                      currentNode.subActions.push(this.tokenStream.currentToken());
                                              Severity: Minor
                                              Found in src/core/analysis/2-syntactic/tree.js and 1 other location - About 50 mins to fix
                                              src/core/analysis/2-syntactic/tree.js on lines 648..661

                                              Duplicated Code

                                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                              Tuning

                                              This issue has a mass of 52.

                                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                              Refactorings

                                              Further Reading

                                              Similar blocks of code found in 2 locations. Consider refactoring.
                                              Open

                                                          if (this.tokenStream.currentToken().type == TokenType.COMMA
                                                              || this.tokenStream.currentToken().type == TokenType.SEMICOLON) {
                                                            // It is an error if it is a semicolon
                                                            if (this.tokenStream.currentToken().type == TokenType.SEMICOLON) {
                                                              this.errors.add(new Message(
                                              Severity: Minor
                                              Found in src/core/analysis/2-syntactic/tree.js and 1 other location - About 50 mins to fix
                                              src/core/analysis/2-syntactic/tree.js on lines 98..162

                                              Duplicated Code

                                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                              Tuning

                                              This issue has a mass of 52.

                                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                              Refactorings

                                              Further Reading

                                              Similar blocks of code found in 3 locations. Consider refactoring.
                                              Open

                                                              currentArgument.pos = Pos.between(
                                                                  this.tokenStream.previousToken().pos,
                                                                  this.tokenStream.currentToken().pos
                                                                );
                                              Severity: Major
                                              Found in src/core/analysis/2-syntactic/tree.js and 2 other locations - About 45 mins to fix
                                              src/core/analysis/2-syntactic/tree.js on lines 430..433
                                              src/core/analysis/2-syntactic/tree.js on lines 895..898

                                              Duplicated Code

                                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                              Tuning

                                              This issue has a mass of 50.

                                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                              Refactorings

                                              Further Reading

                                              Similar blocks of code found in 3 locations. Consider refactoring.
                                              Open

                                                    result.pos = Pos.between(
                                                        this.tokenStream.previousToken().pos,
                                                        this.tokenStream.currentToken().pos
                                                      );
                                              Severity: Major
                                              Found in src/core/analysis/2-syntactic/tree.js and 2 other locations - About 45 mins to fix
                                              src/core/analysis/2-syntactic/tree.js on lines 430..433
                                              src/core/analysis/2-syntactic/tree.js on lines 616..619

                                              Duplicated Code

                                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                              Tuning

                                              This issue has a mass of 50.

                                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                              Refactorings

                                              Further Reading

                                              Similar blocks of code found in 3 locations. Consider refactoring.
                                              Open

                                                      pseudoMultiplyToken.pos = Pos.between(
                                                          this.tokenStream.previousToken().pos,
                                                          this.tokenStream.currentToken().pos
                                                        );
                                              Severity: Major
                                              Found in src/core/analysis/2-syntactic/tree.js and 2 other locations - About 45 mins to fix
                                              src/core/analysis/2-syntactic/tree.js on lines 616..619
                                              src/core/analysis/2-syntactic/tree.js on lines 895..898

                                              Duplicated Code

                                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                              Tuning

                                              This issue has a mass of 50.

                                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                              Refactorings

                                              Further Reading

                                              There are no issues that match your filters.

                                              Category
                                              Status