Showing 205 of 353 total issues
Function updateTracking
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
SWFUpload.prototype.updateTracking = function (file, bytesUploaded) {
var tracking = this.fileSpeedStats[file.id];
if (!tracking) {
this.fileSpeedStats[file.id] = tracking = {};
}
- 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 uploadProgressHandler
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
SWFUpload.proxyDetect.uploadProgressHandler = function (file, bytesComplete, bytesTotal) {
var ex1 = null, time, differenceMS, bps;
try {
if (typeof this.proxyDetectSettings.user_upload_progress_handler === "function") {
this.proxyDetectSettings.user_upload_progress_handler.call(this, file, bytesComplete, bytesTotal);
- 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
File jquery.plupload.queue.js
has 267 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* jquery.plupload.queue.js
*
* Copyright 2009, Moxiecode Systems AB
* Released under GPL License.
Function Html4Runtime
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Html4Runtime(options) {
var I = this
, Test = Runtime.capTest
, True = Runtime.capTrue
;
Function _create
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
_create: function() {
var id = this.element.attr('id');
if (!id) {
id = plupload.guid();
this.element.attr('id', id);
Function createSWF
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createSWF(attObj, parObj, id) {
var r, el = getElementById(id);
if (ua.wk && ua.wk < 312) { return r; }
if (el) {
if (typeof attObj.id == UNDEF) { // if no 'id' is defined for the object element, it will inherit the 'id' from the alternative content
Function PNG
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
function PNG(binstr) {
var _binstr, _br, _hm, _ep, _info;
_binstr = binstr;
Function uploadCompleteHandler
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
SWFUpload.queue.uploadCompleteHandler = function (file) {
var user_upload_complete_handler = this.queueSettings.user_upload_complete_handler;
var continueUpload;
if (file.filestatus === SWFUpload.FILE_STATUS.COMPLETE) {
- 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 _read
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _read(op, blob) {
_fr = new RuntimeTarget();
function error(err) {
self.readyState = FileReader.DONE;
Function _downsize
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _downsize(width, height, crop, preserveHeaders) {
var self = this
, scale
, mathFn
, x = 0
Function createSWF
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createSWF(attObj, parObj, id) {
var r, el = getElementById(id);
if (ua.wk && ua.wk < 312) { return r; }
if (el) {
if (typeof attObj.id == UNDEF) { // if no 'id' is defined for the object element, it will inherit the 'id' from the alternative content
Function onUploadComplete
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
onUploadComplete : function(file) {
// Load the swfupload settings
var settings = this.settings,
swfuploadify = this;
Function swfobject
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
;var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="ShockwaveFlash.ShockwaveFlash",q="application/x-shockwave-flash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=[],N=[],I=[],l,Q,E,B,J=false,a=false,n,G,m=true,M=function(){var aa=typeof j.getElementById!=D&&typeof j.getElementsByTagName!=D&&typeof j.createElement!=D,ah=t.userAgent.toLowerCase(),Y=t.platform.toLowerCase(),ae=Y?/win/.test(Y):/win/.test(ah),ac=Y?/mac/.test(Y):/mac/.test(ah),af=/webkit/.test(ah)?parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,X=!+"\v1",ag=[0,0,0],ab=null;
if(typeof t.plugins!=D&&typeof t.plugins[S]==r){ab=t.plugins[S].description;if(ab&&!(typeof t.mimeTypes!=D&&t.mimeTypes[q]&&!t.mimeTypes[q].enabledPlugin)){T=true;
X=false;ab=ab.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ag[0]=parseInt(ab.replace(/^(.*)\..*$/,"$1"),10);ag[1]=parseInt(ab.replace(/^.*\.(.*)\s.*$/,"$1"),10);
ag[2]=/[a-zA-Z]/.test(ab)?parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0;}}else{if(typeof O.ActiveXObject!=D){try{var ad=new ActiveXObject(W);if(ad){ab=ad.GetVariable("$version");
if(ab){X=true;ab=ab.split(" ")[1].split(",");ag=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)];}}}catch(Z){}}}return{w3:aa,pv:ag,wk:af,ie:X,win:ae,mac:ac};
Function onUploadError
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
onUploadError : function(file, errorCode, errorMsg) {
// Load the swfupload settings
var settings = this.settings;
// Set the error string
Function renderUI
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
function renderUI(obj) {
obj.id = obj.attr('id');
obj.html(
'<div class="plupload_wrapper">' +
Function can
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
var can = (function() {
var caps = {
define_property: (function() {
/* // currently too much extra code required, not exactly worth it
try { // as of IE8, getters/setters are supported only on DOM elements
Function matchVersions
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
function matchVersions() {
var rl = regObjArr.length;
if (rl > 0) {
for (var i = 0; i < rl; i++) { // for each registered object element
var id = regObjArr[i].id;
Function matchVersions
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
function matchVersions() {
var rl = regObjArr.length;
if (rl > 0) {
for (var i = 0; i < rl; i++) { // for each registered object element
var id = regObjArr[i].id;
File MultipleFileUpload.php
has 255 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* MultipleFileUpload (https://github.com/jkuchar/MultipleFileUpload/)
*
Function dispatchEvent
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
dispatchEvent: function(type) {
var uid, list, args, tmpEvt, evt = {}, result = true, undef;
if (Basic.typeOf(type) !== 'string') {
// we can't use original object directly (because of Silverlight)