kachkaev/humane-math

View on GitHub

Showing 71 of 138 total issues

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

Function validateNode has a Cognitive Complexity of 92 (exceeds 5 allowed). Consider refactoring.
Open

  validateNode(treeNode, symbols, rules) {
    var symbolId;
    var possibleMessageParams;

    switch (treeNode.type) {
Severity: Minor
Found in src/core/analysis/3-semantic/validator.js - About 1 day 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 calculateValueOfTheNode has a Cognitive Complexity of 64 (exceeds 5 allowed). Consider refactoring.
    Open

      calculateValueOfTheNode(treeNode, variables, symbols, calculateCacheMode) {
    
        //FIXME revise
        //// Do nothing if the value is already calculated or this node is a number (it has already got a value).
        // if ((treeNode.value !== null && !calculateCacheMode) || treeNode.type == TreeNodeType.NUMBER)
    Severity: Minor
    Found in src/core/calculator.js - About 1 day 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 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 validateNode has 202 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        validateNode(treeNode, symbols, rules) {
          var symbolId;
          var possibleMessageParams;
      
          switch (treeNode.type) {
      Severity: Major
      Found in src/core/analysis/3-semantic/validator.js - About 1 day to fix

        Function tokenize has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring.
        Open

          tokenize(newRaw) {
            // Basic check for changes
            if (newRaw === this.raw) {
              return false;
            }
        Severity: Minor
        Found in src/core/analysis/1-lexical/token-stream.js - About 7 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 tokenize has 170 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          tokenize(newRaw) {
            // Basic check for changes
            if (newRaw === this.raw) {
              return false;
            }
        Severity: Major
        Found in src/core/analysis/1-lexical/token-stream.js - About 6 hrs to fix

          File standard-symbols.js has 421 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import {HumaneMath} from '../core/core';
          
          /* eslint-disable indent, spellcheck/spell-checker */
          /* See http://github.com/eslint/eslint/issues/4696 */
          
          
          Severity: Minor
          Found in src/extra/standard-symbols.js - About 6 hrs to fix

            Function calculateValueOfTheNode has 103 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              calculateValueOfTheNode(treeNode, variables, symbols, calculateCacheMode) {
            
                //FIXME revise
                //// Do nothing if the value is already calculated or this node is a number (it has already got a value).
                // if ((treeNode.value !== null && !calculateCacheMode) || treeNode.type == TreeNodeType.NUMBER)
            Severity: Major
            Found in src/core/calculator.js - About 4 hrs 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

              File token-stream.js has 307 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import _ from 'underscore';
              import ltrim from 'underscore.string/ltrim';
              import rtrim from 'underscore.string/rtrim';
              import {Message}     from '../message';
              import {MessageList} from '../message-list';
              Severity: Minor
              Found in src/core/analysis/1-lexical/token-stream.js - About 3 hrs to fix

                `` has 28 functions (exceeds 20 allowed). Consider refactoring.
                Open

                  messages: {
                
                    //################################
                    // Lexical errors
                
                
                Severity: Minor
                Found in src/i18n/en.js - About 3 hrs to fix

                  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 findNextTokenAtTheSameLevel has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                  Open

                    findNextTokenAtTheSameLevel(tokenTypes, moveCursor) {
                      if (!_.isArray(tokenTypes)) {
                        tokenTypes = [tokenTypes];
                      }
                  
                  
                  Severity: Minor
                  Found in src/core/analysis/1-lexical/token-stream.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

                  File validator.js has 283 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: Minor
                  Found in src/core/analysis/3-semantic/validator.js - About 2 hrs to fix

                    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 addInvolutionFunctions has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        addInvolutionFunctions() {
                      
                          // Power
                          this.addFunction({
                              'pow':     HumaneMath.Dialect.WEST,
                      Severity: Major
                      Found in src/extra/standard-symbols.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
                            Severity
                            Category
                            Status
                            Source
                            Language