Showing 205 of 353 total issues
Function open
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
open: function(method, url, async, user, password) {
var urlp;
// first two arguments are required
if (!method || !url) {
Function init
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
init: function() {
var html, el, container;
container = this.getShimContainer();
Function onReadyStateChange
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_xhr.onreadystatechange = function onReadyStateChange() {
// fake Level 2 events
switch (_xhr.readyState) {
Function File
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
plupload.File = (function() {
var filepool = {};
function PluploadFile(file) {
Function onUploadStart
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
onUploadStart : function(file) {
// Load the swfupload settings
var settings = this.settings;
var timer = new Date();
Function addEvent
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var addEvent = function(obj, name, callback, key) {
var func, events;
name = name.toLowerCase();
Function calculateMovingAverage
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
SWFUpload.speed.calculateMovingAverage = function (history) {
var vals = [], size, sum = 0.0, mean = 0.0, varianceTemp = 0.0, variance = 0.0, standardDev = 0.0;
var i;
var mSum = 0, mCount = 0;
Function embedSWF
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
w(ab,false);}else{if(Z){Z({success:false,id:ab});}}},getObjectById:function(X){if(M.w3){return z(X);}},embedSWF:function(ab,ah,ae,ag,Y,aa,Z,ad,af,ac){var X={success:false,id:ah};
Function indexOf
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Open
Array.prototype.indexOf = function(elt /*, from*/)
{
var len = this.length;
var from = Number(arguments[1]) || 0;
- 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 embedSWF
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
embedSWF: function(swfUrlStr, replaceElemIdStr, widthStr, heightStr, swfVersionStr, xiSwfUrlStr, flashvarsObj, parObj, attObj, callbackFn) {
Function embedSWF
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
embedSWF: function(swfUrlStr, replaceElemIdStr, widthStr, heightStr, swfVersionStr, xiSwfUrlStr, flashvarsObj, parObj, attObj, callbackFn) {
Function handleUploads
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Open
public static function handleUploads()
{
if (self::$handleUploadsCalled === true) {
return;
} else {
- 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 renderImageToCanvas
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function renderImageToCanvas(img, canvas, options) {
var iw = img.naturalWidth, ih = img.naturalHeight;
var width = options.width, height = options.height;
var x = options.x || 0, y = options.y || 0;
var ctx = canvas.getContext('2d');
Function atob
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var atob = function(data, utf8) {
if (typeof(window.atob) === 'function') {
return utf8 ? utf8_decode(window.atob(data)) : window.atob(data);
}
Function fileQueueError
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
fileQueueError: function(event, file, errorCode, message) {
try {
if (errorCode === SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED) {
alert("You have attempted to queue too many files.\n" + (message === 0 ? "You have reached the upload limit." : "You may select " + (message > 1 ? "up to " + message + " files." : "one file.")));
return;
Function getResponse
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
getResponse: function(responseType) {
var I = this.getRuntime();
try {
switch (responseType) {
Function initialize
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function initialize(items) {
var type, constructor;
// if we ran out of runtimes
if (!items.length) {
Function swfupload
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$.fn.swfupload = function(){
var args = $.makeArray(arguments);
return this.each(function(){
var swfu;
if (args.length == 1 && typeof(args[0]) == 'object') {
Function PluploadFile
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function PluploadFile(file) {
plupload.extend(this, {
/**
Function createCSS
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function createCSS(sel, decl, media, newStyle) {
if (ua.ie && ua.mac) { return; }
var h = doc.getElementsByTagName("head")[0];
if (!h) { return; } // to also support badly authored HTML pages that lack a head element
var m = (media && typeof media == "string") ? media : "screen";