Showing 566 of 915 total issues
Function getLink
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
getLink: function(oembed, options) {
var $container = $('<div>');
try {
$container.html(oembed.html);
- 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 9 (exceeds 5 allowed). Consider refactoring. Open
getLinks: function(urlMatch, meta, oembed, options) {
var src = 'http://instagram.com/p/' + urlMatch[1] + '/media/?size=';
var aspect = oembed.thumbnail_width && oembed.thumbnail_height ? oembed.thumbnail_width / oembed.thumbnail_height : 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
Function _onreset
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
CollectingHandlerForMutliTarget.prototype._onreset = function(cbs) {
if (cbs) {
if (cbs.onreset) {
- 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 unifyDate
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
exports.unifyDate = function(date) {
if (typeof date === "string" && date.match(/^\d+$/)) {
date = parseInt(date);
}
- 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 WallCtrl
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
function WallCtrl($scope, $rootScope, $window, $timeout, AppsService, HelloService, SearchService) {
Function $get
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
function($interval, $log, $rootScope, $document, Keepalive, LocalStorage, $window) {
Function useResult
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
function useResult(usedMethods, context, pluginsContexts, allResults, result, options, asyncMethodCb) {
Function domInstance
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
domInstance: function(type, data) {
var test = 'HTML' + (type || '').replace(
/^[a-z]/,
function(m) {
return m.toUpperCase();
- 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 ( ctrl.search.length > 0 ) {
tagged = true;
}
Function post
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
post: function(url, data, options, callback, callbackID, timeout) {
Function isEmpty
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
isEmpty: function(obj) {
// Scalar
if (!obj)
return true;
- 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 (vm.wallOptions.cycle) {
if (!contains(vm.statuses, data.statuses[i])) {
console.log("triggered");
removeLeastRecentTweet();
$interval.cancel(cycleInterval);
Avoid deeply nested control flow statements. Open
if ( ctrl.activeIndex === 0 ) {
// ctrl.tagging pushes items to ctrl.items, so we only have empty val
// for `item` if it is a detected duplicate
if ( item === undefined ) return;
Avoid deeply nested control flow statements. Open
if ( ctrl.activeIndex < 0 ) {
item = ctrl.tagging.fct !== undefined ? ctrl.tagging.fct(ctrl.search) : ctrl.search;
if (!item || angular.equals( ctrl.items[0], item ) ) {
return;
}
Avoid deeply nested control flow statements. Open
if (this.events[name][i]) {
// Emit on the local instance of this
callback.call(this, name, i);
}
Avoid deeply nested control flow statements. Open
if(uiElement.onInit) {
uiElement.onInit(item);
}
Function parseMetaLinks
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
parseMetaLinks: function(key, value, whitelistRecord) {
if (typeof value !== "object" || typeof value === "string") {
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
Function getLink
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
getLink: function(url, meta, options, cb) {
var canonical = (meta.canonical && meta.canonical.href) || meta.canonical || (meta.og && meta.og.url);
// Redirect to canonical from mobile url.
- 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(__promoUri, promo) {
var hasGoodLinks = false;
var links = promo.links.filter(function(link) {
var match = _.intersection(link.rel, CONFIG.PROMO_RELS);
- 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 ('files' in data[x] && data[x].files.length > 0) {
f.append(x, data[x].files[0]);
}