Showing 419 of 859 total issues
Function str
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
function str(key, holder) {
// Produce a string from holder[key].
var i, // The loop counter.
Function _contactContainers
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
_contactContainers: function(event) {
var i, j, dist, itemWithLeastDistance, posProperty, sizeProperty, base, cur, nearBottom, floating,
innermostContainer = null,
innermostIndex = null;
Function FastClick
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
function FastClick(layer) {
'use strict';
var oldOnClick, self = this;
- 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 FastClick
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
function FastClick(layer) {
'use strict';
var oldOnClick, self = this;
- 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 apply_filters
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def apply_filters(anime)
anime = anime.full_search(name) unless name.nil?
anime = anime.where(slug: id) unless id.nil?
anime = anime.where(show_type: show_type) unless show_type.nil?
anime = anime.by_genres(genres) unless genres.nil?
- 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 present_story
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def present_story(story, current_user, title_language_preference)
json = {
id: story.id,
story_type: story.story_type,
user: present_miniuser(story.user),
- 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 _open
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
_open: function( event, target, content ) {
var tooltip, events, delayedShow,
positionOption = $.extend( {}, this.options.position );
if ( !content ) {
Consider simplifying this complex logical expression. Open
} else if (typeof options == 'object' || !options) {
// Check if any options were passed
var settings = $.extend({
checkedClass: _checked,
Function AwesomeRating
has a Cognitive Complexity of 19 (exceeds 5 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");
- 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 notNeeded
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
FastClick.notNeeded = function(layer) {
'use strict';
var metaViewport;
var chromeVersion;
- 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 notNeeded
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
FastClick.notNeeded = function(layer) {
'use strict';
var metaViewport;
var chromeVersion;
- 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 filter_old
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
def filter_old
hide_cover_image
@filter_years = %w(Upcoming 2010s 2000s 1990s 1980s 1970s Older)
if params[:g]
Method sanitize_review
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
def sanitize_review(html)
allow_youtube_transformer = lambda do |env|
node = env[:node]
node_name = env[:node_name]
Function _init
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _init(){
/* Check if browser supports localStorage */
var localStorageReallyWorks = false;
if("localStorage" in window){
try {
Function _showDatepicker
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
_showDatepicker: function(input) {
input = input.target || input;
if (input.nodeName.toLowerCase() !== "input") { // find from button/image trigger
input = $("input", input.parentNode)[0];
}
Function FastClick
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
function FastClick(layer) {
'use strict';
var oldOnClick, self = this;
Function FastClick
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
function FastClick(layer) {
'use strict';
var oldOnClick, self = this;
Function drag
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
drag: function(event, ui) {
var inst = $(this).data("ui-draggable"), that = this;
$.each(inst.sortables, function() {
Function drag
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
drag: function(event, ui) {
var ts, bs, ls, rs, l, r, t, b, i, first,
inst = $(this).data("ui-draggable"),
o = inst.options,
Method create_or_update_from_hash
has 60 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
anime = Anime.find_by(mal_id: hash[:external_id])
if anime.nil? && Anime.where(title: hash[:title][:canonical]).count > 1