Showing 5,566 of 7,504 total issues
Avoid deeply nested control flow statements. Open
Open
if (data.end == data.size - 1) {
// finished
_this.end(xhr.status);
} else {
// next chunk
Function shouldSkipReload
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function shouldSkipReload(to, toParams, from, fromParams, locals, options) {
Avoid deeply nested control flow statements. Open
Open
if( !wrapper ){
api.log('[err] FlashAPI.mouseover: js-fileapi-wrapper not found');
return;
}
Avoid deeply nested control flow statements. Open
Open
if (angular.isDate(val)) {
val = val.toISOString();
}
Avoid deeply nested control flow statements. Open
Open
if (angular.isString(val)) {
formData.append(key, val);
} else {
if (config.sendObjectsAsJsonBlob && angular.isObject(val)) {
formData.append(key, new Blob([val], {type: 'application/json'}));
Function reportController
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
var reportController = function ($scope, $http, $q, $location, modalFactory, dataService) {
Function loadGallery
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function loadGallery(folioGallerydir,targetdiv,album,numperpage,pagenum,fullalbum) {
Avoid deeply nested control flow statements. Open
Open
if ( type == 'image' && !current.big ) {
current.big = current.image;
}
Function scoreEntryController
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
var scoreEntryController = function ($scope, $http, $q, $location, modalFactory, dataService) {
Function Metric
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function Metric(name, value, count, min, max, properties) {
Function arrivalsController
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
var arrivalsController = function ($scope, $http, $q, $location, modalFactory, dataService) {
Function participantController
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
var participantController = function ($scope, $http, $q, $location, modalFactory, dataService) {
Avoid deeply nested control flow statements. Open
Open
if (value === undefined) {
output[field] = "undefined";
}
else if (value === null) {
output[field] = "null";
Function contingentController
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
var contingentController = function ($scope, $http, $q, $location, modalFactory, dataService) {
Function schedule
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
function schedule() {
var now = new Date();
var date = now.getDate();
var month = now.getMonth();
var month = month + 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 trackMetric
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
AppInsights.prototype.trackMetric = function (name, average, sampleCount, min, max, properties) {
Function setHash
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
setHash : function(n, v, e, p, d, s) {
Function Methods
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
Event.Methods = (function() {
var isButton;
if (Prototype.Browser.IE) {
var buttonMap = { 0: 1, 1: 4, 2: 2 };
- 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
Open
if (element.offsetParent == document.body)
if (Element.getStyle(element, 'position') == 'absolute') break;
Avoid deeply nested control flow statements. Open
Open
if ( typeof elem.getElementsByTagName !== "undefined" ) {
// handleScript alters the DOM, so use jQuery.merge to ensure snapshot iteration
jsTags = jQuery.grep( jQuery.merge( [], elem.getElementsByTagName("script") ), handleScript );
// Splice the scripts into ret after their former ancestor and advance our index beyond them