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
- Read upRead up
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) {
- Read upRead up
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';
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)
- Read upRead up
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
Function validateNode
has 202 lines of code (exceeds 25 allowed). Consider refactoring. Open
validateNode(treeNode, symbols, rules) {
var symbolId;
var possibleMessageParams;
switch (treeNode.type) {
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;
}
- Read upRead up
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;
}
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 */
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)
Function subparseStatementSequence
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
subparseStatementSequence() {
var currentNode = this.createEmptyTreeNode();
var firstNodeToken = this.tokenStream.currentToken();
- Read upRead up
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';
`` has 28 functions (exceeds 20 allowed). Consider refactoring. Open
messages: {
//################################
// Lexical errors
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;
- Read upRead up
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];
}
- Read upRead up
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';
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;
Function addInvolutionFunctions
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
addInvolutionFunctions() {
// Power
this.addFunction({
'pow': HumaneMath.Dialect.WEST,
Function subparseStatementSequence
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
subparseStatementSequence() {
var currentNode = this.createEmptyTreeNode();
var firstNodeToken = this.tokenStream.currentToken();
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();