Showing 95 of 95 total issues
Function createNode
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createNode(position, expressionComponents) {
var node = SpelNode.create.apply(null, ['compound', position].concat(expressionComponents));
function buildContextStack(state) {
var childrenCount = node.getChildren().length,
Similar blocks of code found in 2 locations. Consider refactoring. Open
function pushRealToken(data, isFloat, start, end) {
if (isFloat) {
tokens.push(new Token(TokenKind.LITERAL_REAL_FLOAT, data, start, end));
}
else {
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
function pushIntToken(data, isLong, start, end) {
if (isLong) {
tokens.push(new Token(TokenKind.LITERAL_LONG, data, start, end));
}
else {
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function selectFromMap
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
function selectFromMap(collection, whichElement, expr, state) {
var newCollection = {},
entry,
key,
entries = [],
Function eatRelationalExpression
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
function eatRelationalExpression() {
var expr = eatSumExpression();
var relationalOperatorToken = maybeEatRelationalOperator();
if (relationalOperatorToken !== null) {
var token = nextToken(); // consume relational operator token
Function createNode
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createNode(position, dimensions, nodes) {
var isArray = nodes !== undefined;
var dimension;
if (isArray) {
dimension = dimensions.length && dimensions[0] && dimensions[0].getType() === 'number' ? dimensions[0].getValue() : null;
Function eatExpression
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
function eatExpression() {
var expr = eatLogicalOrExpression();
if (moreTokens()) {
var token = peekToken();
if (token.getKind() === TokenKind.ASSIGN) { // a=b
Function maybeEatConstructorReference
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
function maybeEatConstructorReference() {
if (peekIdentifierToken('new')) {
var newToken = nextToken();
// It looks like a constructor reference but is NEW being used as a map key?
if (peekTokenOne(TokenKind.RSQUARE)) {
Function selectFromMap
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function selectFromMap(collection, whichElement, expr, state) {
var newCollection = {},
entry,
key,
entries = [],
- 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 createNode
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function createNode(position, expressionComponents) {
var node = SpelNode.create.apply(null, ['compound', position].concat(expressionComponents));
function buildContextStack(state) {
var childrenCount = node.getChildren().length,
- 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 maybeEatLiteral
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
function maybeEatLiteral() {
var token = peekToken();
if (token === null) {
return false;
}
Similar blocks of code found in 2 locations. Consider refactoring. Open
case '&':
if (!isTwoCharToken(TokenKind.SYMBOLIC_AND)) {
throw {
name: 'SpelParseException',
message: 'Missing character \'&\' in expression (' + expressionString + ') at position ' + pos
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
case '|':
if (!isTwoCharToken(TokenKind.SYMBOLIC_OR)) {
throw {
name: 'SpelParseException',
message: 'Missing character \'|\' in expression (' + expressionString + ') at position ' + pos
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function createSpelNode
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function createSpelNode(nodeType, position, ...operands) {
var node = {},
type = nodeType || 'Abstract',
children = [],
parent = null,
- 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 createNode
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function createNode(nullSafeNavigation, position, expr) {
var node = SpelNode.create('projection', position, expr);
node.getValue = function (state) {
var collection = state.activeContext.peek(),
- 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 createNode
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createNode(position, expressionComponents) {
var node = SpelNode.create.apply(null, ['indexer', position].concat(expressionComponents));
node.getValue = function (state) {
var activeContext = state.activeContext,
Function createNode
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createNode(functionName, position, args) {
var node = SpelNode.create('function', position);
node.getRaw = function () {
return {
Function createNode
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createNode(variableName, position) {
var node = SpelNode.create('variable', position);
node.getRaw = function () {
return variableName;
Similar blocks of code found in 3 locations. Consider refactoring. Open
function isAlphabetic(ch) {
if (ch.charCodeAt(0) > 255) {
return false;
}
return (FLAGS[ch.charCodeAt(0)] & IS_ALPHA) !== 0;
- Read upRead up
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 54.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Open
function isHexadecimalDigit(ch) {
if (ch.charCodeAt(0) > 255) {
return false;
}
return (FLAGS[ch.charCodeAt(0)] & IS_HEXDIGIT) !== 0;
- Read upRead up
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 54.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76