Showing 566 of 915 total issues
Function getData
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
getData: function(urlMatch, request, cb) {
request({
uri: "http://www.bloomberg.com/api/videos/slug/" + urlMatch[1],
json: 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
Function getLink
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
getLink: function(oembed, whitelistRecord) {
if ((oembed.type === "photo" || oembed.type === "image") && oembed.html && whitelistRecord.isAllowed && whitelistRecord.isAllowed('oembed.photo')) {
var image = {
- 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 $get
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
function($interval, $log, $rootScope, $document, Keepalive, LocalStorage, $window) {
Function WallCtrl
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
function WallCtrl($scope, $rootScope, $window, $timeout, AppsService, HelloService, SearchService) {
Function useResult
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
function useResult(usedMethods, context, pluginsContexts, allResults, result, options, asyncMethodCb) {
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;
}
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);
Function post
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
post: function(url, data, options, callback, callbackID, timeout) {
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;
}
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]) ||
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 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);
}
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];
}}
}
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;
}