Showing 205 of 353 total issues
Function XMLHttpRequest
has 164 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function XMLHttpRequest() {
var _status, _response, _iframe;
function cleanup(cb) {
var target = this, uid, form, inputs, i, hasFile = false;
Function _initUploader
has 162 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_initUploader: function() {
var self = this
, id = this.id
, uploader
, options = {
Function FileInput
has 152 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function FileInput() {
var _uid, _files = [], _mimes = [], _options;
function addInput() {
var comp = this, I = comp.getRuntime(), shimContainer, browseButton, currForm, form, input, uid;
Function init
has 148 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
init : function(options, swfUploadOptions) {
return this.each(function() {
// Create a reference to the jQuery DOM object
Function Runtime
has 146 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function Runtime(options, type, caps, modeCaps, preferredMode) {
/**
Dispatched when runtime is initialized and ready.
Results in RuntimeInit on a connected component.
Function onUploadFile
has 146 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function onUploadFile(up, file) {
var url = up.settings.url
, chunkSize = up.settings.chunk_size
, retries = up.settings.max_retries
, features = up.features
Function EventTarget
has 137 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function EventTarget() {
// hash of event listeners by object uid
var eventpool = {};
Basic.extend(this, {
Function FlashRuntime
has 137 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function FlashRuntime(options) {
var I = this, initTimer;
options = Basic.extend({ swf_url: Env.swf_url }, options);
Function formatUnits
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
Open
SWFUpload.speed.formatUnits = function (baseNumber, unitDivisors, unitLabels, singleFractional) {
var i, unit, unitDivisor, unitLabel;
if (baseNumber === 0) {
return "0 " + unitLabels[unitLabels.length - 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 FileDrop
has 135 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function FileDrop() {
var _files = [], _allowedExts = [], _options;
Basic.extend(this, {
init: function(options) {
Function send
has 120 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
send: function(meta, data) {
var target = this
, isGecko2_5_6 = (Env.browser === 'Mozilla' && Env.version >= 4 && Env.version < 7)
, isAndroidBrowser = Env.browser === 'Android Browser'
, mustSendAsBinary = false
Function setOption
has 113 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function setOption(option, value, init) {
var self = this, reinitRequired = false;
function _setOption(option, value, init) {
var oldValue = settings[option];
Function _doXHR
has 109 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function _doXHR(data) {
var self = this;
_start_time = new Date().getTime();
Function uploadNextChunk
has 109 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function uploadNextChunk() {
var chunkBlob, formData, args = {}, curChunkSize;
// make sure that file wasn't cancelled and upload is not stopped in general
if (file.status !== plupload.UPLOADING || up.state === plupload.STOPPED) {
Function FileInput
has 107 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function FileInput(options) {
var self = this,
container, browseButton, defaults;
// if flat argument passed it should be browse_button id
Function FileInput
has 99 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function FileInput() {
var _files = [], _options;
Basic.extend(this, {
init: function(options) {
Method handleUploads
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function handleUploads()
{
/* @var $token string */
$token = $this->httpRequest->getQuery("token");
Function FileReader
has 94 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function FileReader() {
var self = this, _fr;
Basic.extend(this, {
/**
Function initControls
has 94 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function initControls(settings, cb) {
var self = this, inited = 0, queue = [];
// common settings
var options = {
Function SilverlightRuntime
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function SilverlightRuntime(options) {
var I = this, initTimer;
options = Basic.extend({ xap_url: Env.xap_url }, options);