kachkaev/humane-math

View on GitHub

Showing 71 of 138 total issues

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

  addInverseTrigonometricFunctions() {

    // Arcsine
    this.addFunction({
        'arcsin':   HumaneMath.Dialect.WEST,
Severity: Major
Found in src/extra/standard-symbols.js - About 2 hrs to fix

    Function validate has 53 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      validate(tree, symbols, rules, calculator) {
    
        this.errors.clear();
    
        // Check for emptiness
    Severity: Major
    Found in src/core/analysis/3-semantic/validator.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 validate has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
      Open

        validate(tree, symbols, rules, calculator) {
      
          this.errors.clear();
      
          // Check for emptiness
      Severity: Minor
      Found in src/core/analysis/3-semantic/validator.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 addTrigonometricFunctions has 52 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        addTrigonometricFunctions() {
      
          // Sine
          this.addFunction({
              'sin':   HumaneMath.Dialect.WEST,
      Severity: Major
      Found in src/extra/standard-symbols.js - About 2 hrs to fix

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

            addNonMathFunctions() {
          
              // Maximum value
              this.addFunction({
                  'max':      HumaneMath.Dialect.WEST,
          Severity: Minor
          Found in src/extra/standard-symbols.js - About 1 hr to fix

            Function addInverseHyperbolicTrigonometricFunctions has 42 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              addInverseHyperbolicTrigonometricFunctions() {
                // Hyperbolic arcsine
                this.addFunction({
                    'arcsinh': HumaneMath.Dialect.WEST,
                    'arsh':    HumaneMath.Dialect.EAST
            Severity: Minor
            Found in src/extra/standard-symbols.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

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

                  addHyperbolicTrigonometricFunctions() {
                
                    // Hyperbolic sine
                    this.addFunction({
                        'sinh': HumaneMath.Dialect.WEST,
                Severity: Minor
                Found in src/extra/standard-symbols.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 testBrowser has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function testBrowser() {
                      // Our testing bundle is made up of our unit tests, which
                      // should individually load up pieces of our application.
                      // We also include the browser setup file.
                      const testFiles = glob.sync('./test/unit/**/*.js');
                    Severity: Minor
                    Found in gulpfile.babel.js - About 1 hr to fix

                      Function addMiscFunctions has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        addMiscFunctions() {
                          // Abs
                          this.addFunction({
                              'abs':     HumaneMath.Dialect.WEST,
                              'modulus': HumaneMath.Dialect.MISC,
                      Severity: Minor
                      Found in src/extra/standard-symbols.js - About 1 hr to fix

                        Function findNextToken has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                        Open

                          findNextToken(tokenTypes, moveCursor) {
                            if (!_.isArray(tokenTypes)) {
                              tokenTypes = [tokenTypes];
                            }
                        
                        
                        Severity: Minor
                        Found in src/core/analysis/1-lexical/token-stream.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 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 findNextTokenAtTheSameLevel has 27 lines of code (exceeds 25 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 1 hr to fix

                          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 (treeNode.subNodes[argumentCount - 1]) {
                                          errorPos = Pos.unite(
                                              Pos.ending(treeNode.subNodes[argumentCount - 1].pos),
                                              Pos.ending(treeNode.argumentPos)
                                          );
                            Severity: Major
                            Found in src/core/analysis/3-semantic/validator.js - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                          } if (realArgumentCount > argumentCount.max) {
                                            errorPos = Pos.unite(
                                                Pos.ending(treeNode.subNodes[argumentCount.max - 1].pos),
                                                Pos.ending(treeNode.argumentPos)
                                              );
                              Severity: Major
                              Found in src/core/analysis/3-semantic/validator.js - About 45 mins to fix
                                Severity
                                Category
                                Status
                                Source
                                Language