File perl.js
has 800 lines of code (exceeds 250 allowed). Consider refactoring. Open
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: https://codemirror.net/LICENSE
// CodeMirror2 mode/perl/perl.js (text/x-perl) beta 0.10 (2011-11-08)
// This is a part of CodeMirror from https://github.com/sabaca/CodeMirror_mode_perl (mail@sabaca.com)
- Create a ticketCreate a ticket
Function tokenPerl
has 270 lines of code (exceeds 25 allowed). Consider refactoring. Open
function tokenPerl(stream,state){
if(stream.eatSpace())
return null;
if(state.chain)
return tokenChain(stream,state,state.chain,state.style,state.tail);
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if(c=="<")
return tokenChain(stream,state,[">",">"],RXstyle,RXmodifiers);
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if(c=="[")
return tokenChain(stream,state,["]","]"],RXstyle,RXmodifiers);
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if(c=="<"){
eatSuffix(stream, 2);
return tokenChain(stream,state,[">"],"string");}
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
else if(c=="w"){
c=look(stream, 1);
if(c=="("){
eatSuffix(stream, 2);
return tokenChain(stream,state,[")"],"bracket");}
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if(c=="("){
eatSuffix(stream, 2);
return tokenChain(stream,state,[")"],"string");}
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if(c=="{"){
eatSuffix(stream, 2);
return tokenChain(stream,state,["}"],"string");}
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if(c=="(")
return tokenChain(stream,state,[")",")"],RXstyle,RXmodifiers);
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if(/[\^'"!~\/]/.test(c)){
eatSuffix(stream, 1);
return tokenChain(stream,state,[stream.eat(c)],"string");}}
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if(c=="["){
eatSuffix(stream, 2);
return tokenChain(stream,state,["]"],"string");}
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if(c=="{")
return tokenChain(stream,state,["}","}"],RXstyle,RXmodifiers);
- Create a ticketCreate a ticket
Function tokenChain
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function tokenChain(stream,state,chain,style,tail){ // NOTE: chain.length > 2 is not working now (it's for s[...][...]geos;)
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return tokenChain(stream,state,["}"],"bracket");}
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return tokenChain(stream,state,["}"],"string");}
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return tokenChain(stream,state,[">"],RXstyle,RXmodifiers);}}}}
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return tokenChain(stream,state,['\0'],"variable-2");}
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return tokenChain(stream,state,[")"],"string");}
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return tokenChain(stream,state,["]"],"string");}
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return "keyword";
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return tokenChain(stream,state,[")"],RXstyle,RXmodifiers);}
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return tokenChain(stream,state,[">"],RXstyle,RXmodifiers);}
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return tokenChain(stream,state,["]","]"],RXstyle,RXmodifiers);
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return tokenChain(stream,state,[")",")"],RXstyle,RXmodifiers);
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return tokenChain(stream,state,["]","]"],RXstyle,RXmodifiers);
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return tokenChain(stream,state,[">",">"],RXstyle,RXmodifiers);
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return "variable-2";
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return tokenSOMETHING(stream,state,n);
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return tokenChain(stream,state,["]"],RXstyle,RXmodifiers);}
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return tokenChain(stream,state,["}"],RXstyle,RXmodifiers);}
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return tokenChain(stream,state,[ch],RXstyle,RXmodifiers);}
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return "operator";
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return tokenChain(stream,state,[ch],"string");}
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return tokenChain(stream,state,[c],RXstyle,RXmodifiers);}
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return tokenChain(stream,state,[">",">"],RXstyle,RXmodifiers);
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return tokenChain(stream,state,[c,c],RXstyle,RXmodifiers);}}}
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return tokenChain(stream,state,[")",")"],RXstyle,RXmodifiers);
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return "string";
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return "keyword";
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return tokenChain(stream,state,["}","}"],RXstyle,RXmodifiers);
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return "meta";
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return "meta";}
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return tokenChain(stream,state,["}","}"],RXstyle,RXmodifiers);
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return tokenChain(stream,state,[c,c],RXstyle,RXmodifiers);}}}}
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return "meta";
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return tokenChain(stream,state,["]"],RXstyle,RXmodifiers);}
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return tokenChain(stream,state,["]"],"string");}
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return tokenChain(stream,state,['\0'],"string");}}}
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return tokenChain(stream,state,[stream.eat(c)],RXstyle,RXmodifiers);}}
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return tokenChain(stream,state,[")",")"],RXstyle,RXmodifiers);
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return "variable-2";}
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return "def";
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return tokenChain(stream,state,["]"],RXstyle,RXmodifiers);}
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return tokenChain(stream,state,["]"],"bracket");}
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return "operator";
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return "variable-2";
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return "operator";
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return tokenSOMETHING(stream,state,'=cut');}
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return tokenChain(stream,state,["}"],RXstyle,RXmodifiers);}
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return tokenChain(stream,state,[">",">"],RXstyle,RXmodifiers);
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return "variable";}}
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return "comment";}}
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return "def";
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return "meta";}}
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return "meta";}
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return tokenChain(stream,state,[stream.eat(c)],RXstyle,RXmodifiers);}}
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return tokenChain(stream,state,[stream.eat(c)],"string");}}
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return tokenChain(stream,state,[">"],"bracket");}
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return tokenChain(stream,state,[")"],RXstyle,RXmodifiers);}
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return tokenChain(stream,state,[">"],RXstyle,RXmodifiers);}
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return tokenChain(stream,state,[">"],"string");}
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return tokenChain(stream,state,[c,c],RXstyle,RXmodifiers);}}}
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return "variable-2";
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return "atom";
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return tokenChain(stream,state,[stream.eat(c)],"bracket");}}
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return tokenChain(stream,state,[")"],"string");}
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return tokenChain(stream,state,[")"],RXstyle,RXmodifiers);}
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return tokenChain(stream,state,["}"],RXstyle,RXmodifiers);}
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return tokenChain(stream,state,[stream.eat(c)],"string");}}}}
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return tokenChain(stream,state,["]","]"],RXstyle,RXmodifiers);
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return tokenChain(stream,state,[ch],"variable-2");}
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return "variable-2";
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return tokenChain(stream,state,["}"],"string");}
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return tokenChain(stream,state,[">"],"string");}
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return tokenChain(stream,state,[")"],"bracket");}
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return tokenChain(stream,state,["}","}"],RXstyle,RXmodifiers);
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return "operator";
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return tokenChain(stream,state,['\0'],"comment");}
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return "atom";
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return "meta";}
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return null;}
- Create a ticketCreate a ticket
Identical blocks of code found in 2 locations. Consider refactoring. Open
if(c=="x"){
c=look(stream, 1);
if(c=="("){
eatSuffix(stream, 2);
return tokenChain(stream,state,[")"],RXstyle,RXmodifiers);}
- Read upRead up
- Create a ticketCreate a ticket
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 188.
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
Identical blocks of code found in 2 locations. Consider refactoring. Open
else if(c=="r"){
c=look(stream, 1);
if(c=="("){
eatSuffix(stream, 2);
return tokenChain(stream,state,[")"],RXstyle,RXmodifiers);}
- Read upRead up
- Create a ticketCreate a ticket
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 188.
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
else if(c=="w"){
c=look(stream, 1);
if(c=="("){
eatSuffix(stream, 2);
return tokenChain(stream,state,[")"],"bracket");}
- Read upRead up
- Create a ticketCreate a ticket
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 183.
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
else if(c=="q"){
c=look(stream, 1);
if(c=="("){
eatSuffix(stream, 2);
return tokenChain(stream,state,[")"],"string");}
- Read upRead up
- Create a ticketCreate a ticket
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 183.
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
if(ch=="s"){
var c=/[\/>\]})\w]/.test(look(stream, -2));
if(!c){
c=stream.eat(/[(\[{<\^'"!~\/]/);
if(c){
- Read upRead up
- Create a ticketCreate a ticket
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 166.
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
if(ch=="y"){
var c=/[\/>\]})\w]/.test(look(stream, -2));
if(!c){
c=stream.eat(/[(\[{<\^'"!~\/]/);
if(c){
- Read upRead up
- Create a ticketCreate a ticket
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 166.
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
Identical blocks of code found in 2 locations. Consider refactoring. Open
if(l!=":"){
if(c==1)
return "keyword";
else if(c==2)
return "def";
- Read upRead up
- Create a ticketCreate a ticket
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 78.
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
Identical blocks of code found in 2 locations. Consider refactoring. Open
if(l!=":"){
if(c==1)
return "keyword";
else if(c==2)
return "def";
- Read upRead up
- Create a ticketCreate a ticket
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 78.
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
if(stream.eatWhile(/\d/)||stream.eat("{")&&stream.eatWhile(/\d/)&&stream.eat("}"))
return "variable-2";
else
stream.pos=p;}
- Read upRead up
- Create a ticketCreate a ticket
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 46.
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
if(stream.eatWhile(/[\w$\[\]]/)||stream.eat("{")&&stream.eatWhile(/[\w$\[\]]/)&&stream.eat("}")){
var c=stream.current();
if(PERL[c])
return "variable-2";
else
- Read upRead up
- Create a ticketCreate a ticket
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 46.
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