Showing 371 of 8,201 total issues
File prototype.js
has 4971 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* Prototype JavaScript framework, version 1.7
* (c) 2005-2010 Sam Stephenson
*
* Prototype is freely distributable under the terms of an MIT-style license.
* For details, see the Prototype web site: http://www.prototypejs.org/
Method format_change
has a Cognitive Complexity of 127 (exceeds 5 allowed). Consider refactoring. Open
def format_change(_history, change, options, table_options)
html = ""
classes = []
if !table_options[:never_obsolete][change.column_name.to_sym] && change.is_obsolete?
- 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
File effects.js
has 1014 lines of code (exceeds 250 allowed). Consider refactoring. Open
// script.aculo.us effects.js v1.9.0, Thu Dec 23 16:54:48 -0500 2010
// Copyright (c) 2005-2010 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
// Contributors:
// Justin Palmer (http://encytemedia.com/)
Method parse_query
has a Cognitive Complexity of 99 (exceeds 5 allowed). Consider refactoring. Open
def parse_query(query, options = {})
q = Hash.new { |h, k| h[k] = [] }
scan_query(query).each do |token|
if token =~ /^([qse])$/
- 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 generate_sql
has a Cognitive Complexity of 97 (exceeds 5 allowed). Consider refactoring. Open
def generate_sql(q, options = {})
if q.is_a?(Hash)
original_query = options[:original_query]
else
original_query = q
- 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
File controls.js
has 804 lines of code (exceeds 250 allowed). Consider refactoring. Open
// script.aculo.us controls.js v1.9.0, Thu Dec 23 16:54:48 -0500 2010
// Copyright (c) 2005-2010 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
// (c) 2005-2010 Ivan Krstic (http://blogs.law.harvard.edu/ivan)
// (c) 2005-2010 Jon Tirsen (http://www.tirsen.com)
File dragdrop.js
has 786 lines of code (exceeds 250 allowed). Consider refactoring. Open
// script.aculo.us dragdrop.js v1.9.0, Thu Dec 23 16:54:48 -0500 2010
// Copyright (c) 2005-2010 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
//
// script.aculo.us is freely distributable under the terms of an MIT-style license.
Method commit_tags
has a Cognitive Complexity of 77 (exceeds 5 allowed). Consider refactoring. Open
def commit_tags
return if new_tags.nil?
if old_tags
# If someone else committed changes to this post before we did,
- 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
File post_controller.rb
has 663 lines of code (exceeds 250 allowed). Consider refactoring. Open
class PostController < ApplicationController
layout "default"
helper :avatar
before_action :member_only, :only => [:create, :destroy, :delete, :flag, :revert_tags, :activate, :update_batch, :vote]
Method similar_images
has a Cognitive Complexity of 74 (exceeds 5 allowed). Consider refactoring. Open
def similar_images(options = {})
errors = {}
local_service = CONFIG["local_image_service"]
- 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 generate_sql
has 259 lines of code (exceeds 25 allowed). Consider refactoring. Open
def generate_sql(q, options = {})
if q.is_a?(Hash)
original_query = options[:original_query]
else
original_query = q
Method similar
has a Cognitive Complexity of 64 (exceeds 5 allowed). Consider refactoring. Open
def similar
@params = params
unless params[:file].is_a?(ActionDispatch::Http::UploadedFile) then params.delete(:file) end
if params[:url].blank? then params.delete(:url) end
if params[:id].blank? then params.delete(:id) end
- 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
File user.rb
has 549 lines of code (exceeds 250 allowed). Consider refactoring. Open
class User < ApplicationRecord
has_many :user_logs
has_many :post_votes
attr_accessor :current_email
File unittest.js
has 524 lines of code (exceeds 250 allowed). Consider refactoring. Open
// script.aculo.us unittest.js v1.9.0, Thu Dec 23 16:54:48 -0500 2010
// Copyright (c) 2005-2010 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
// (c) 2005-2010 Jon Tirsen (http://www.tirsen.com)
// (c) 2005-2010 Michael Schuerig (http://www.schuerig.de/michael/)
Function Enumerable
has 209 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Enumerable = (function() {
function each(iterator, context) {
var index = 0;
try {
this._each(function(value) {
Class User
has 58 methods (exceeds 20 allowed). Consider refactoring. Open
class User < ApplicationRecord
has_many :user_logs
has_many :post_votes
attr_accessor :current_email
Method http_get_streaming
has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring. Open
def http_get_streaming(source, options = {}, &_block)
max_size = options[:max_size] || CONFIG["max_image_size"]
max_size = nil if max_size == 0 # unlimited
# Decode data: URLs.
- 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 similar
has 184 lines of code (exceeds 25 allowed). Consider refactoring. Open
def similar
@params = params
unless params[:file].is_a?(ActionDispatch::Http::UploadedFile) then params.delete(:file) end
if params[:url].blank? then params.delete(:url) end
if params[:id].blank? then params.delete(:id) end
Method format_change
has 179 lines of code (exceeds 25 allowed). Consider refactoring. Open
def format_change(_history, change, options, table_options)
html = ""
classes = []
if !table_options[:never_obsolete][change.column_name.to_sym] && change.is_obsolete?
Method format_changes
has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring. Open
def format_changes(history, options = {})
changes = history.history_changes
# Group the changes by class and field.
change_groups = {}
- 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"