Showing 566 of 915 total issues
Function setResponseToCache
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function setResponseToCache(code, content_type, req, res, body, ttl) {
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
Function getLink
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
getLink: function(urlMatch, options) {
var content = {
'album': 'album',
'app': 'software',
- 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 getLink
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
getLink: function(htmlparser, cb) {
var end = false;
var parser = {
- 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 (items instanceof Array) {
if (items.length > 0) {
return items[0];
}
}
Function getData
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
getData: function(urlMatch, request, options, cb) {
var consumer_key = options.getProviderOptions('tumblr.consumer_key');
if (!consumer_key) {
- 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 getLinks
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
getLinks: function(urlMatch, oembed, twitter, options) {
var links = [];
if (twitter.image && twitter.image.indexOf && twitter.image.indexOf(urlMatch[1]) > -1) {
- 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 (cb(item)) {
result.push(item);
}
Avoid deeply nested control flow statements. Open
if (cb(item)) {
result.push(item);
}
Function showEmbeds
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function showEmbeds($embeds, data, filterByRel) {
$embeds.html('');
var plugins = [];
- 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 getLink
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
getLink: function(oembed, meta) {
var site = (meta.og && meta.og.site_name) || (meta.twitter && meta.twitter.site) || oembed.provider_name;
if (!site || !/behance/i.test(site)) {
- 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 runPostPlugins
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function runPostPlugins(link, dataRecord, usedMethods, context, pluginsContexts, asyncMethodCb) {
Avoid deeply nested control flow statements. Open
if (sizes) {
property.sizes = sizes;
}
Function moveMediaAttrs
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function moveMediaAttrs(link) {
if (!link.media) {
var m = {};
// TODO: make for()
- 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 (oembedLink.href.indexOf(SHOPIFY_OEMBED_URLS[i]) > -1) {
isShopify = true;
}
Avoid deeply nested control flow statements. Open
if (rel !== options.exclusiveRel) {
// Remove all rels except exclusiveRel.
delete record[rel];
}
Avoid deeply nested control flow statements. Open
if (match) {
registerDomainPlugin(plugin, null);
}
Avoid deeply nested control flow statements. Open
if (!recordProtocol) {
recordProtocol = record[protocolId] = {};
} else {
recordProtocol = _.extend({}, recordProtocol);
}
Avoid deeply nested control flow statements. Open
if (match) {
// Store match for plugin.
registerDomainPlugin(plugin, match);
pluginsUrlMatches[plugin.id] = match;
continue;
Avoid deeply nested control flow statements. Open
if (title) {
property.title = title;
}