Showing 171 of 259 total issues
Function warning
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function warning(m, t, a, b, c, d) {
var ch, l, w;
t = t || nexttoken;
if (t.id === '(end)') { // `~
t = token;
Function styles
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function styles() {
var i;
while (nexttoken.id === '@') {
i = peek();
if (i.identifier && i.value === 'import') {
Function _attrib
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_attrib: function(){
/*
* attrib
* : '[' S* [ namespace_prefix ]? IDENT S*
* [ [ PREFIXMATCH |
Function endRule
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function endRule(){
var display = properties.display ? properties.display.value : null;
if (display){
switch(display){
Function border-radius
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
"border-radius" : function(expression) {
var valid = false,
simple = "<length> | <percentage> | inherit",
slash = false,
Function formatResults
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
formatResults: function(results, filename, options) {
var messages = results.messages,
output = "";
options = options || {};
Function _namespace
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_namespace: function(emit){
/*
* namespace
* : NAMESPACE_SYM S* [namespace_prefix S*]? [STRING|URI] S* ';' S*
*/
Function unicodeRangeToken
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
unicodeRangeToken: function(first, startLine, startCol){
var reader = this._reader,
value = first,
temp,
tt = Tokens.CHAR;
Function init
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
init: function(parser, reporter){
var rule = this;
parser.addListener("startrule", function(event){
var selectors = event.selectors,
selector,
Function numberToken
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
numberToken: function(first, startLine, startCol){
var reader = this._reader,
value = this.readNumber(first),
ident,
tt = Tokens.NUMBER,
Function cssUrl
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function cssUrl() {
var c, url;
if (nexttoken.identifier && nexttoken.value === 'url') {
nexttoken = lex.range('(', ')');
url = nexttoken.value;
Function <shadow></shadow>
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
"<shadow>": function(expression) {
//inset? && [ <length>{2,4} && <color>? ]
var result = false,
count = 0,
inset = false,
Function readURI
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
readURI: function(first){
var reader = this._reader,
uri = first,
inner = "",
c = reader.peek();
Consider simplifying this complex logical expression. Open
Open
if (!left.identifier && left.id !== '.' && left.id !== '[' &&
left.id !== '(' && left.id !== '&&' && left.id !== '||' &&
left.id !== '?') {
warning("Bad invocation.", left);
}
Method call
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Open
def call(staged_files)
staged_files = files_filter(staged_files)
return if staged_files.empty?
result =
- 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 warningAt
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function warningAt(m, l, ch, a, b, c, d) {
Function errorAt
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function errorAt(m, l, ch, a, b, c, d) {
Avoid deeply nested control flow statements. Open
Open
if (modifier.type == "class"){
classCount++;
}
Avoid deeply nested control flow statements. Open
Open
if (part.elementName && modifier.type == "id"){
reporter.report("Element (" + part + ") is overqualified, just use " + modifier + " without element name.", part.line, part.col, rule);
} else if (modifier.type == "class"){
if (!classes[modifier]){
Function warning
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function warning(m, t, a, b, c, d) {