Showing 171 of 259 total issues
Avoid deeply nested control flow statements. Open
if (nexttoken.id === '(end)' || nexttoken.id === '(error)') {
error("Missing '>'.", nexttoken);
}
Avoid deeply nested control flow statements. Open
if (ValidationTypes.isAny(expression, xDir + " | " + yDir)) {
result = true;
ValidationTypes.isAny(expression, numeric);
}
Avoid deeply nested control flow statements. Open
if (!(prop == "padding" && value.parts.length === 2 && value.parts[0].value === 0)){
reporter.report("Using height with " + prop + " can sometimes make elements larger than you expect.", properties[prop].line, properties[prop].col, rule);
}
Avoid deeply nested control flow statements. Open
if (CSSLint.Util.indexOf(actual, item) === -1) {
propertiesSpecified = (actual.length === 1) ? actual[0] : (actual.length == 2) ? actual.join(" and ") : actual.join(", ");
reporter.report("The property " + item + " is compatible with " + propertiesSpecified + " and should be included as well.", value.actualNodes[0].line, value.actualNodes[0].col, rule);
}
Avoid deeply nested control flow statements. Open
switch (s[v]) {
case 'function':
case 'var':
case 'unused':
s[v] = 'closure';
Avoid deeply nested control flow statements. Open
if (data.member[k] === 1) {
n = '<i>' + n + '</i>';
}
Method location_from
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def location_from(location, show_usage = false)
if location && !location.empty?
if File.exist?(location)
location
else
- 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
Avoid deeply nested control flow statements. Open
if (i < a.length - 1) {
n += ', ';
}
Avoid deeply nested control flow statements. Open
if (nexttoken.id !== ',') {
break;
}
Avoid deeply nested control flow statements. Open
if (v === 'unused') {
unused.push({
name: n,
line: f['(line)'],
'function': f['(name)']
Avoid deeply nested control flow statements. Open
if (l + n.length > 72) {
o.push(m + '<br>');
m = ' ';
l = 1;
}
Consider simplifying this complex logical expression. Open
if (nexttoken.id === '=' || nexttoken.value === '~=' ||
nexttoken.value === '$=' ||
nexttoken.value === '|=' ||
nexttoken.id === '*=' ||
nexttoken.id === '^=') {
Consider simplifying this complex logical expression. Open
} else if (a === 'href' || a === 'background' ||
a === 'content' || a === 'data' ||
a.indexOf('src') >= 0 || a.indexOf('url') >= 0) {
if (option.safe && ux.test(v)) {
error("ADsafe URL violation.");
Consider simplifying this complex logical expression. Open
if (!nexttoken.identifier &&
nexttoken.id !== '"' &&
nexttoken.id !== '\'' &&
nexttoken.type !== '(string)' &&
nexttoken.type !== '(number)' &&
Consider simplifying this complex logical expression. Open
if ((c < '0' || c > '9') &&
(c < 'a' || c > 'f') &&
(c < 'A' || c > 'F')) {
break;
}
Function createToken
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
createToken: function(tt, value, startLine, startCol, options){
Function SelectorPart
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function SelectorPart(elementName, modifiers, text, line, col){
Function MediaQuery
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function MediaQuery(modifier, mediaType, features, line, col){
Method validate_params
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def validate_params
raise ArgumentError, "Missing name" if name.nil? || name.empty?
raise ArgumentError, "Missing author" if author.nil? || author.empty?
raise ArgumentError, "Missing email" if email.nil? || email.empty?
raise ArgumentError, "Missing description" if description.nil? || description.empty?
- 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
Method call
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def call(staged_files)
migration_files = versioned_migration_files(staged_files)
schema_files = versioned_schema_files(staged_files)
if migration_files.any? && schema_files.none?
- 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"