Showing 259 of 259 total issues
Function init
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
init: function(parser, reporter){
var rule = this,
lastProperty,
propertiesToCheck = {
color: 1,
Function _simple_selector_sequence
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
_simple_selector_sequence: function(){
/*
* simple_selector_sequence
* : [ type_selector | universal ]
* [ HASH | class | attrib | pseudo | negation ]*
Function init
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
init: function(parser, reporter){
var rule = this,
prop, i, len,
propertiesToCheck = {},
properties,
Function _term
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
_term: function(){
/*
* term
* : unary_operator?
Function advance
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
function advance(id, t) {
switch (token.id) {
case '(number)':
if (nexttoken.id === '.') {
warning(
Function init
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
init: function(parser, reporter){
var rule = this;
var headings = {
h1: 0,
Function init
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
init: function(parser, reporter){
var rule = this,
lastRule;
function startRule(event){
Function get
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
get: function(channel){
var tokenInfo = this._tokenData,
reader = this._reader,
value,
Function statement
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
function statement(noindent) {
var i = indent, r, s = scope, t = nexttoken;
// We don't like the empty statement.
Function cssCounter
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
function cssCounter() {
if (nexttoken.identifier && nexttoken.value === 'counter') {
advance();
advance('(');
if (!nexttoken.identifier) {
Function _selector
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
_selector: function(){
/*
* selector
* : simple_selector_sequence [ combinator simple_selector_sequence ]*
* ;
Function verify
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
api.verify = function(text, ruleset){
var i = 0,
len = rules.length,
reporter,
Function calculate
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Specificity.calculate = function(selector){
var i, len,
part,
b=0, c=0, d=0;
Function parse
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
function parse(rbp, initial) {
var left;
if (nexttoken.id === '(end)') {
error("Unexpected early end of program.", token);
}
Function _readDeclarations
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
_readDeclarations: function(checkStart, readMargins){
/*
* Reads the pattern
* S* '{' S* declaration [ ';' S* declaration ]* '}' S*
* or
Function _ruleset
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
_ruleset: function(){
/*
* ruleset
* : selectors_group
* '{' S* declaration? [ ';' S* declaration? ]* '}' S*
Similar blocks of code found in 2 locations. Consider refactoring. Open
if (!nexttoken.identifier &&
nexttoken.id !== '"' &&
nexttoken.id !== '\'' &&
nexttoken.type !== '(string)' &&
nexttoken.type !== '(number)' &&
- 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
if (!left.identifier && left.id !== '.' && left.id !== '[' &&
left.id !== '(' && left.id !== '&&' && left.id !== '||' &&
- 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 _declaration
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
_declaration: function(){
/*
* declaration
* : property ':' S* expr prio?
Function _media_query
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
_media_query: function(){
/*
* media_query
* : [ONLY | NOT]? S* media_type S* [ AND S* expression ]*
* | expression [ AND S* expression ]*