Showing 566 of 915 total issues
Avoid deeply nested control flow statements. Open
if (el) {
input.value = data[x].value;
}
else if (_this.domInstance(null, data[x])) {
input.value = data[x].innerHTML || data[x].innerText;
Avoid deeply nested control flow statements. Open
if (input) {
// Remove it.
if (!(inputs instanceof NodeList)) {
inputs = [inputs];
}
Function _animateZoom
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
_animateZoom: function(t, e, i, n, s, a) {
Avoid deeply nested control flow statements. Open
if (data[x].length === 1) {
data[x] = data[x][0];
}
Avoid deeply nested control flow statements. Open
else if (_this.domInstance('input', data[x]) && data[x].type === 'file') {
continue;
}
else if (_this.domInstance('input', data[x]) ||
_this.domInstance('select', data[x]) ||
Avoid deeply nested control flow statements. Open
if (!loose) loose = next;
Function _createButton
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
_createButton: function(t, e, i, n, s, a) {
Avoid deeply nested control flow statements. Open
if (link[attr]) {
hasMedia = true;
}
Function getData
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
getData: function(url, twitter, whitelistRecord) {
// do not process if there is a whitelist record for this domain as processing will take longer
if (!whitelistRecord.isDefault && whitelistRecord.isAllowed && whitelistRecord.isAllowed('twitter.player')) {return;}
- 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
else if (data[x] instanceof Blob) {
f.append(x, data[x], data.name);
}
else {
f.append(x, data[x]);
Avoid deeply nested control flow statements. Open
if (bull !== b && !(bull.length > 1 && b.length > 1)) {
src = cap.slice(i + 1).join('\n') + src;
i = l - 1;
}
Avoid deeply nested control flow statements. Open
else if (el && data[x].name !== x) {
data[x].setAttribute('name', x);
data[x].name = x;
}
Function getMeta
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
getMeta: function(meta) {
function getAuthor(value) {
if (typeof value === "string") {
if (/^https?:\/\//i.test(value)) {
- 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 (!media) {
media = {};
}
Avoid deeply nested control flow statements. Open
if (moreDetailedData) {
tagToAppend = generateArticleParts(moreDetailedData);
}
Avoid deeply nested control flow statements. Open
if (detailedData.indexOf('playerType=facebook') > -1 && detailedData.indexOf('auto_play=false') === -1) {
detailedData = detailedData.replace('playerType=facebook', 'playerType=facebook&auto_play=false');
}
Function getMeta
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
getMeta: function(meta, url) {
var date = meta.date || meta.pubdate || meta.lastmod || (meta.article && meta.article.published_time) || meta['last-modified'] || meta.timestamp;
// Can be multiple dates.
- 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 (typeof (attr[x]) === 'object') {
for (var y in attr[x]) {if (attr[x].hasOwnProperty(y)) {
n[x][y] = attr[x][y];
}}
}
Function JsonFieldAccessorService
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function JsonFieldAccessorService() {
var service = {};
// support "deep" field accessing : field is location.lat => result = json[location][lat]
service.accessField = function(json, field) {
- 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 (moreDetailedData) {
tagToAppend = generateArticleParts(moreDetailedData);
}