Showing 419 of 859 total issues
Method filter_old
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def filter_old
hide_cover_image
@filter_years = %w(Upcoming 2010s 2000s 1990s 1980s 1970s Older)
if params[:g]
- 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 _keydown
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
_keydown: function( event ) {
/*jshint maxcomplexity:20*/
var match, prev, character, skip, regex,
preventDefault = true;
Function formatDate
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
formatDate: function (format, date, settings) {
if (!date) {
return "";
}
File user.rb
has 297 lines of code (exceeds 250 allowed). Consider refactoring. Open
class User < ActiveRecord::Base
# Friendly ID.
def to_param
name
end
Function _clear
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
_clear: function(event, noPropagation) {
this.reverting = false;
// We delay all events that have to be triggered to after the point where the placeholder has been removed and
// everything else normalized again
Function addTimeToArrayFromToken
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
function addTimeToArrayFromToken(token, input, config) {
var a, b,
datePartArray = config._a;
switch (token) {
File jquery.icheck.js
has 293 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*!
* iCheck v0.9.1, http://git.io/uhUPMA
* =================================
* Powerful jQuery plugin for checkboxes and radio buttons customization
*
Function _mouseStart
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
_mouseStart: function(event, overrideHandle, noActivation) {
var i, body,
o = this.options;
Function _mouseDrag
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
_mouseDrag: function(event) {
var i, item, itemElement, intersection,
o = this.options,
scrolled = false;
File foundation.js
has 291 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*
* Foundation Responsive Library
* http://foundation.zurb.com
* Copyright 2013, ZURB
* Free to use under the MIT license.
File foundation.js
has 291 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*
* Foundation Responsive Library
* http://foundation.zurb.com
* Copyright 2013, ZURB
* Free to use under the MIT license.
Function _mouseDrag
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
_mouseDrag: function(event) {
this.dragged = true;
if (this.options.disabled) {
Function Datepicker
has 74 lines of code (exceeds 25 allowed). Consider refactoring. 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 _create
has 73 lines of code (exceeds 25 allowed). Consider refactoring. 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 onTouchEnd
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
FastClick.prototype.onTouchEnd = function(event) {
'use strict';
var forElement, trackingClickStart, targetTagName, scrollParent, touch, targetElement = this.targetElement;
if (!this.trackingClick) {
- 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 onTouchEnd
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
FastClick.prototype.onTouchEnd = function(event) {
'use strict';
var forElement, trackingClickStart, targetTagName, scrollParent, touch, targetElement = this.targetElement;
if (!this.trackingClick) {
- 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
$.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 = {},
Function AwesomeRating
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.fn.AwesomeRating = function(options) {
return this.each(function() {
var i, icon, rating, widget, _i, _len, _ref, _results;
widget = this;
rating = $(widget).attr("data-rating");
Function anonymous
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
lexer.performAction = function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {
var YYSTATE=YY_START
switch($avoiding_name_collisions) {
case 0: yy_.yytext = "\\"; return 14;
Method filter_new
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
def filter_new
@filter_years = %w(Upcoming 2010s 2000s 1990s 1980s 1970s Older)
respond_to do |format|
format.html do