Showing 419 of 859 total issues
Function _on
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
_on: function( suppressDisabledCheck, element, handlers ) {
var delegateElement,
instance = this;
// no suppressDisabledCheck flag, shuffle arguments
Function _setOption
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
_setOption: function(key, value) {
var menu = this.menu;
switch(key) {
case 'header':
Function on
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
function on(input, state, keep) {
var node = input[0],
parent = input.parent(),
checked = state == _checked,
indeterminate = state == _indeterminate,
Function sync
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Backbone.sync = function(method, model, options) {
var type = methodMap[method];
// Default options, unless specified.
_.defaults(options || (options = {}), {
Function createFunctionContext
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
createFunctionContext: function(asObject) {
var locals = this.stackVars.concat(this.registers.list);
if(locals.length > 0) {
this.source[1] = this.source[1] + ", " + locals.join(", ");
Method create
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create
params.permit(:token, :plan_id, :gift, :gift_to, :gift_message)
if params[:token].blank?
return render(text: "Didn't get credit card details from Stripe", status: 400)
Function _mouseDown
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
_mouseDown: function(event) {
// don't let more than one widget handle mouseStart
if( mouseHandled ) { return; }
// we may have missed mouseup (out of window)
Function drag
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
drag: function(draggable, event) {
//If you have a highly dynamic page, you might try this option. It renders positions every time you move the mouse.
if(draggable.options.refreshPositions) {
$.ui.ddmanager.prepareOffsets(draggable, event);
Function _respectSize
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
_respectSize: function( data ) {
var o = this._vBoundaries,
a = this.axis,
ismaxw = isNumber(data.width) && o.maxWidth && (o.maxWidth < data.width), ismaxh = isNumber(data.height) && o.maxHeight && (o.maxHeight < data.height),
Function _createPlaceholder
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
_createPlaceholder: function(that) {
that = that || this;
var className,
o = that.options;
Function _possibleChars
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
_possibleChars: function (format) {
var iFormat,
chars = "",
literal = false,
// Check whether a format character is doubled
Method create_or_update_from_hash
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.create_or_update_from_hash hash
# First the creation logic
# TODO: stop hard-coding the ID column
manga = Manga.find_by(mal_id: hash[:external_id])
if manga.nil? && Manga.where(romaji_title: hash[:romaji_title]).count > 1
Function name
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.fn[ name ] = function( options ) {
var isMethodCall = typeof options === "string",
args = slice.call( arguments, 1 ),
returnValue = this;
Function getPath
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
, getPath: function ( elem ) {
if ( 'undefined' === typeof elem ) {
elem = this.$element;
}
Function load
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
load: function( index, event ) {
index = this._getIndex( index );
var that = this,
tab = this.tabs.eq( index ),
anchor = tab.find( ".ui-tabs-anchor" ),
Method similar
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def similar(limit = 20, options = {})
# FIXME
return [] if Rails.env.development?
exclude = options[:exclude] ? options[:exclude] : []
- 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 upcoming
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def upcoming
hide_cover_image
season_months = {
'winter' => [12, 1, 2],
- 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 index
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def index
respond_to do |format|
format.json do
manga = Manga
manga = Manga.where(slug: params[:ids]) if params[:ids]
- 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 index
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def index
respond_to do |format|
format.html do
hide_cover_image
@filter_years = %w(Upcoming 2010s 2000s 1990s 1980s 1970s Older)
- 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 parse
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
JSON.parse = function (text, reviver) {
// The parse method takes a text and an optional reviver function, and returns
// a JavaScript value if the text is a valid JSON text.