Showing 161 of 426 total issues
Function _open
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_open: function( event, target, content ) {
var tooltip, events, delayedShow,
positionOption = $.extend( {}, this.options.position );
if ( !content ) {
Function _showDatepicker
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_showDatepicker: function(input) {
input = input.target || input;
if (input.nodeName.toLowerCase() != 'input') // find from button/image trigger
input = $('input', input.parentNode)[0];
if ($.datepicker._isDisabledDatepicker(input) || $.datepicker._lastInput == input) // already here
Function bounce
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$.effects.effect.bounce = function( o, done ) {
var el = $( this ),
props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
// defaults:
Function drag
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
drag: function(event, ui) {
var inst = $(this).data("draggable"), that = this;
var checkPos = function(o) {
Function _mouseStart
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_mouseStart: function(event, overrideHandle, noActivation) {
var o = this.options;
this.currentContainer = this;
Function _create
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_create: function() {
var that = this,
options = this.options,
active = options.active,
locationHash = location.hash.substring( 1 );
Function explode
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$.effects.effect.explode = function( o, done ) {
var rows = o.pieces ? Math.round( Math.sqrt( o.pieces ) ) : 3,
cells = rows,
el = $( this ),
Class TranslationKey
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class TranslationKey < ActiveRecord::Base
# Constants
ACCEPTED = "accepted"
PENDING = "pending"
TRANSLATED = "translated"
Function keydown
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
keydown: function( event ) {
var allowed, curVal, newVal, step,
index = $( event.target ).data( "ui-slider-handle-index" );
switch ( event.keyCode ) {
Function _mouseDrag
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_mouseDrag: function(event) {
//Compute the helpers position
this.position = this._generatePosition(event);
this.positionAbs = this._convertPositionTo("absolute");
Function createWrapper
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
createWrapper: function( element ) {
// if the element is already wrapped, return it
if ( element.parent().is( ".ui-effects-wrapper" )) {
return element.parent();
Function parse
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
parse: function( red, green, blue, alpha ) {
if ( red === undefined ) {
this._rgba = [ null, null, null, null ];
return this;
}
Function _generateMonthYearHeader
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_generateMonthYearHeader: function(inst, drawMonth, drawYear, minDate, maxDate,
secondary, monthNames, monthNamesShort) {
var changeMonth = this._get(inst, 'changeMonth');
var changeYear = this._get(inst, 'changeYear');
var showMonthAfterYear = this._get(inst, 'showMonthAfterYear');
Method translate_with_adding
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
Open
def translate_with_adding(locale, key, options = {})
# handle calling translation with a blank key
# or translation center tables don't exist
return translate_without_adding(locale, key, options) if key.blank? || !ActiveRecord::Base.connection.table_exists?('translation_center_translation_keys')
- 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 _mouseStart
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_mouseStart: function(event) {
var that = this;
this.opos = [event.pageX, event.pageY];
Function _refreshValue
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_refreshValue: function() {
var lastValPercent, valPercent, value, valueMin, valueMax,
oRange = this.options.range,
o = this.options,
that = this,
Function keydown
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
keydown: function( event ) {
if ( this.element.prop( "readOnly" ) ) {
suppressKeyPress = true;
suppressInput = true;
suppressKeyPressRepeat = true;
Function _processTabs
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_processTabs: function() {
var that = this;
this.tablist = this._getList()
.addClass( "ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all" )
Function _setOption
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_setOption: function( key, value ) {
var isDraggable, isResizable,
uiDialog = this.uiDialog;
switch ( key ) {
Function animateClass
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$.effects.animateClass = function( value, duration, easing, callback ) {
var o = $.speed( duration, easing, callback );
return this.queue( function() {
var animated = $( this ),