Showing 30 of 45 total issues
Function name
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$.fn[ name ] = function( options ) {
var isMethodCall = typeof options === "string",
args = slice.call( arguments, 1 ),
returnValue = this;
Function send
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
send: function (headers, completeCallback) {
var addParamChar = /\?/.test(s.url) ? '&' : '?';
function callback(status, statusText, responses, responseHeaders) {
xdr.onload = xdr.onerror = xdr.ontimeout = $.noop;
xdr = null;
Function _onProgress
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_onProgress: function (e, data) {
if (e.lengthComputable) {
var now = ((Date.now) ? Date.now() : (new Date()).getTime()),
loaded;
if (data._time && data.progressInterval &&
Function _handleFileTreeEntry
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_handleFileTreeEntry: function (entry, path) {
var that = this,
dfd = $.Deferred(),
errorHandler = function (e) {
if (e && !e.entry) {
Function option
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
option: function( key, value ) {
var options = key,
parts,
curOption,
i;
Method after_enqueue_scale_up
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def after_enqueue_scale_up(*args)
[
{
:workers => 1, # This many workers
:job_count => 1 # For this many jobs or more, until the next level
Function _createWidget
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_createWidget: function( options, element ) {
element = $( element || this.defaultElement || this )[ 0 ];
this.element = $( element );
this.uuid = uuid++;
this.eventNamespace = "." + this.widgetName + this.uuid;
Avoid deeply nested control flow statements. Open
Open
if (!paramNameSlice.length) {
paramNameSlice = paramName;
}
Method after_enqueue_scale_up
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
def after_enqueue_scale_up(*args)
[
{
:workers => 1, # This many workers
:job_count => 1 # For this many jobs or more, until the next level
- 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
Method img
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
def img(source, options={})
if source.respond_to?(:url) and source.respond_to?(:width) and source.respond_to?(:height)
if source.processing?
data = {
processing: source.processing?,
- 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"