Showing 3,976 of 3,976 total issues
Function fold
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
var effectFold = $.effects.effect.fold = function( o, done ) {
// Create element
var el = $( this ),
props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
Function _generatePosition
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
_generatePosition: function(event) {
var top, left,
o = this.options,
pageX = event.pageX,
Function _toggle
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
_toggle: function( event, eventData ) {
var that = this,
toShow = eventData.newPanel,
toHide = eventData.oldPanel;
Function filter
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
filter: function(searchTerm) {
var
$results = $(),
escapedTerm = module.escape.regExp(searchTerm),
exactRegExp = new RegExp('^' + escapedTerm, 'igm'),
Function isSpanAllowed
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Calendar.prototype.isSpanAllowed = function(span, constraint, overlap, event) {
var constraintEvents;
var anyContainment;
var peerEvents;
var i, peerEvent;
Function hideModal
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
hideModal: function(callback) {
callback = $.isFunction(callback)
? callback
: function(){}
;
Function compileWithDeclarations
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Block.prototype.compileWithDeclarations = function(o) {
var assigns, declars, exp, fragments, i, j, len1, post, ref3, ref4, ref5, rest, scope, spaced;
fragments = [];
post = [];
ref3 = this.expressions;
Function val
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
val: function( value ) {
var hooks, ret, isFunction,
elem = this[ 0 ];
if ( !arguments.length ) {
Function configFromStringAndFormat
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
function configFromStringAndFormat(config) {
// TODO: Move this to another part of the creation flow to prevent circular deps
if (config._f === utils_hooks__hooks.ISO_8601) {
configFromISO(config);
return;
Function data_options
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
data_options : function (el, data_attr_name) {
data_attr_name = data_attr_name || 'options';
var opts = {}, ii, p, opts_arr,
data_options = function (el) {
var namespace = Foundation.global.namespace;
Function _destroy
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
_destroy: function() {
if ( this.xhr ) {
this.xhr.abort();
}
Function _tabKeydown
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
_tabKeydown: function( event ) {
var focusedTab = $( this.document[0].activeElement ).closest( "li" ),
selectedIndex = this.tabs.index( focusedTab ),
goingForward = true;
Function _tabKeydown
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
_tabKeydown: function( event ) {
var focusedTab = $( this.document[0].activeElement ).closest( "li" ),
selectedIndex = this.tabs.index( focusedTab ),
goingForward = true;
Function _destroy
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
_destroy: function() {
if ( this.xhr ) {
this.xhr.abort();
}
Perceived complexity for valid_start_end_dates? is too high. [8/7] Open
def valid_start_end_dates?
errors.add(:start_date, "Start date has passed") if start_date.present? and Date.today > start_date
errors.add(:end_date, "End date has passed") if end_date.present? and Date.today > end_date
if start_date.present? and end_date.present?
errors.add(:start_end_date, "Start date must be before end date") if start_date > end_date
- Read upRead up
- Exclude checks
This cop tries to produce a complexity score that's a measure of the
complexity the reader experiences when looking at a method. For that
reason it considers when
nodes as something that doesn't add as much
complexity as an if
or a &&
. Except if it's one of those special
case
/when
constructs where there's no expression after case
. Then
the cop treats it as an if
/elsif
/elsif
... and lets all the when
nodes count. In contrast to the CyclomaticComplexity cop, this cop
considers else
nodes as adding complexity.
Example:
def my_method # 1
if cond # 1
case var # 2 (0.8 + 4 * 0.2, rounded)
when 1 then func_one
when 2 then func_two
when 3 then func_three
when 4..10 then func_other
end
else # 1
do_something until a && b # 2
end # ===
end # 7 complexity points
Method has too many lines. [11/10] Open
def to_form_hash
form_hash = {
:start_date => self.start_date,
:end_date => self.end_date,
:location_id => self.location_id,
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Method has too many lines. [11/10] Open
def destroy
star_to_remove = Star.where(dog_id: @dog.id, user_id: current_user.id).first
if star_to_remove && star_to_remove.destroy
if !request.xhr?
redirect_to :back
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Assignment Branch Condition size for dogs is too high. [16.61/15] Open
def dogs
if !@current_user.nil? and @current_user.id != params[:id].to_i
redirect_to(dogs_user_path(@current_user.id))
end
@dogs = User.find_by_id(params[:id]).dogs
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Method has too many lines. [11/10] Open
def info
id = params[:id]
if !User.exists?(id)
render :json => { "success" => false, "message" => "User not found"}
else
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Assignment Branch Condition size for index is too high. [16.67/15] Open
def index
ip_zipcode = get_ip_address_zipcode
@form_filler = DogViewHelper.new(current_user, ip_zipcode, true)
@form_filler.update_values(params, ip_zipcode, current_user)
@dogs = Dog.filter_by(@form_filler.values).uniq
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric