Showing 371 of 658 total issues
Function Datepicker
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function Datepicker() {
this._curInst = null; // The current instance in use
this._keyEvent = false; // If the last event was a key event
this._disabledInputs = []; // List of date picker inputs that have been disabled
this._datepickerShowing = false; // True if the popup picker is showing , false if not
Function _mouseDrag
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_mouseDrag: function(event) {
this.dragged = true;
if (this.options.disabled) {
File jquery.maskedinput.js
has 290 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*
Masked Input plugin for jQuery
Copyright (c) 2007-2013 Josh Bush (digitalbush.com)
Licensed under the MIT license (http://digitalbush.com/projects/masked-input-plugin/#license)
Version: 1.3.1
Function _create
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_create: function() {
this.activeMenu = this.element;
// flag used to prevent firing of the click handler
// as the event bubbles up through nested menus
this.mouseHandled = false;
Function buildFragment
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
buildFragment: function( elems, context, scripts, selection ) {
var contains, elem, tag, tmp, wrap, tbody, j,
l = elems.length,
// Ensure a safe fragment
Method parse_and_build
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
Open
def parse_and_build(context, args, original_method, reference_identifier)
# clear context
[ :question,
:dependency,
:dependency_condition,
- 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 widget
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$.widget = function( name, base, prototype ) {
var fullName, existingConstructor, constructor, basePrototype,
// proxiedPrototype allows the provided prototype to remain unmodified
// so that it can be used as a mixin for multiple widgets (#8876)
proxiedPrototype = {},
Class PermittedParams
has 25 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class PermittedParams < Struct.new(:params)
# per http://railscasts.com/episodes/371-strong-parameters
def strong_parameters
ActionController::Parameters.new(params)
end
Function _create
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_create: function() {
var i, handleCount,
o = this.options,
existingHandles = this.element.find( ".ui-slider-handle" ).addClass( "ui-state-default ui-corner-all" ),
handle = "<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>",
Function Timepicker
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var Timepicker = function() {
this.regional = []; // Available regional settings, indexed by language code
this.regional[''] = { // Default regional settings
currentText: 'Now',
closeText: 'Done',
Function add
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
add: function( elem, types, handler, data, selector ) {
var handleObjIn, eventHandle, tmp,
events, t, handleObj,
special, handlers, type, namespaces, origType,
Function domManip
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
domManip: function( args, table, callback ) {
// Flatten any nested arrays
args = core_concat.apply( [], args );
Function matcherFromGroupMatchers
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
// A counter to specify which element is currently being matched
var matcherCachedRuns = 0,
bySet = setMatchers.length > 0,
byElement = elementMatchers.length > 0,
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 setMatcher
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
if ( postFilter && !postFilter[ expando ] ) {
postFilter = setMatcher( postFilter );
}
if ( postFinder && !postFinder[ expando ] ) {
Function done
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function done( status, nativeStatusText, responses, headers ) {
var isSuccess, success, error, response, modified,
statusText = nativeStatusText;
// Called once
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 _contactContainers
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_contactContainers: function(event) {
var i, j, dist, itemWithLeastDistance, posProperty, sizeProperty, base, cur, nearBottom,
innermostContainer = null,
innermostIndex = null;
Function _showDatepicker
has 61 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];
}
Function superMatcher
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
superMatcher = function( seed, context, xml, results, expandContext ) {
var elem, j, matcher,
setMatched = [],
matchedCount = 0,
i = "0",