Showing 17 of 31 total issues
File jquery-cron.js
has 458 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*
* jQuery gentleSelect plugin (version 0.1.4.1)
* http://shawnchin.github.com/jquery-cron
*
* Copyright (c) 2010-2013 Shawn Chin.
Function init
has 110 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
init: function(opts) {
// init options
var options = opts ? opts : {}; /* default to empty obj */
var o = $.extend([], defaults, options);
Function init
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
init: function(options) {
var o = $.extend({}, defaults, options);
if (hasError(this, o)) { return this; } // check for errors
optionOverrides(this, o); //
Function value
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
value: function(cron_str) {
// when no args, act as getter
if (!cron_str) { return getCurrentValue(this); }
var o = this.data('options');
Function getCronType
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function getCronType(cron_str, opts) {
// if customValues defined, check for matches there first
if (defined(opts.customValues)) {
for (key in opts.customValues) {
if (cron_str === opts.customValues[key]) { return key; }
Function hasError
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function hasError(c, o) {
if (defined(o.columns) && defined(o.rows)) {
$.error("gentleSelect: You cannot supply both 'rows' and 'columns'");
return true;
}
Function getCurrentValue
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function getCurrentValue(c) {
var b = c.data('block');
var min = '*', hour = '*', day = '*', month = '*', dow = '*';
var selectedPeriod = b['period'].find('select').val();
switch (selectedPeriod) {
Function cron_field
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$.fn.cron_field = function(options) {
var cron_id = this.attr('id') + '-cron';
if ($('#' + cron_id).exists()) {
if (window.cron_objs[cron_id] !== undefined) {
return window.cron_objs[cron_id];
Function dialogClick
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
dialogClick: function(e) {
var clicked = $(e.target);
var $this = $(this);
var root = $this.data('root');
var opts = root.data('options');
Function check_html
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def check_html(self, widget, name, value, html='', attrs=None, **kwargs):
Avoid too many return
statements within this function. Open
Open
return true;
Avoid too many return
statements within this function. Open
Open
return true;
Avoid too many return
statements within this function. Open
Open
return true;
Avoid too many return
statements within this function. Open
Open
return true;
Avoid too many return
statements within this function. Open
Open
return false;
Avoid too many return
statements within this function. Open
Open
return undefined;
Function __init__
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
def __init__(self, attrs=None, options=None):
options = options or {}
self.options = {
'use_gentle_select': True,
'allow_multiple_all': False,
- 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"