Showing 171 of 259 total issues
Avoid deeply nested control flow statements. Open
if (!nextLine()) {
errorAt("Unclosed HTML comment.", l, c);
}
Avoid deeply nested control flow statements. Open
if (typeof b !== 'number' || !isFinite(b) || b <= 0 ||
Math.floor(b) !== b) {
error("Expected a small integer and instead saw '{a}'.",
v, v.value);
}
Avoid deeply nested control flow statements. Open
} else if (a === 'name') {
if (option.adsafe && v.indexOf('_') >= 0) {
warning("ADsafe name violation.");
}
}
Avoid deeply nested control flow statements. Open
if (classCount > 1){
reporter.report("Don't use adjoining classes.", part.line, part.col, rule);
}
Avoid deeply nested control flow statements. Open
for (;;) {
c = s.charAt(0);
if ((c < '0' || c > '9') &&
(c < 'a' || c > 'f') &&
(c < 'A' || c > 'F')) {
Avoid deeply nested control flow statements. Open
if (l + n.length > 72) {
o.push(m + '<br>');
m = ' ';
l = 1;
}
Avoid deeply nested control flow statements. Open
if (nexttoken.id !== ',') {
break;
}
Avoid deeply nested control flow statements. Open
if (i < a.length - 1) {
n += ', ';
}
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 (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
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
} 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 ((c < '0' || c > '9') &&
(c < 'a' || c > 'f') &&
(c < 'A' || c > 'F')) {
break;
}
Consider simplifying this complex logical expression. Open
if (nexttoken.id === '=' || nexttoken.value === '~=' ||
nexttoken.value === '$=' ||
nexttoken.value === '|=' ||
nexttoken.id === '*=' ||
nexttoken.id === '^=') {
Function MediaQuery
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function MediaQuery(modifier, mediaType, features, line, col){
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){
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"