Showing 159 of 364 total issues
File bootstrap-datetimepicker.js
has 1439 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* =========================================================
* bootstrap-datetimepicker.js
* =========================================================
* Copyright 2012 Stefan Petre
* Improvements by Andrew Rowls
File bootstrap.js
has 1311 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* ===================================================
* bootstrap-transition.js v2.2.2
* http://twitter.github.com/bootstrap/javascript.html#transitions
* ===================================================
* Copyright 2012 Twitter, Inc.
File bootstrap.js
has 1311 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* ===================================================
* bootstrap-transition.js v2.2.2
* http://twitter.github.com/bootstrap/javascript.html#transitions
* ===================================================
* Copyright 2012 Twitter, Inc.
Function onload
has 293 lines of code (exceeds 25 allowed). Consider refactoring. Open
window.onload = function() {
function addIcon(el, entity) {
var html = el.innerHTML;
el.innerHTML = '<span style="font-family: \'entypo\'">' + entity + '</span>' + html;
}
File jquery.gmap.js
has 637 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* jQuery gMap v3
*
* @url http://www.smashinglabs.pl/gmap
* @author Sebastian Poreba <sebastian.poreba@gmail.com>
File bootstrap-tour.js
has 514 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* ===========================================================
# bootstrap-tour - v0.6.1
# http://bootstraptour.com
# ==============================================================
# Copyright 2012-2013 Ulrich Sossou
Class Contact
has 49 methods (exceeds 20 allowed). Consider refactoring. Open
class Contact < ActiveRecord::Base
extend ContactsHelper
include MyAttributes
default_scope { where(:account_id => Account.current_id) }
Function click
has 169 lines of code (exceeds 25 allowed). Consider refactoring. Open
click: function(e) {
e.stopPropagation();
e.preventDefault();
var target = $(e.target).closest('span, td, th, legend');
if (target.length == 1) {
Function fill
has 168 lines of code (exceeds 25 allowed). Consider refactoring. Open
fill: function() {
if (this.date == null || this.viewDate == null) {
return;
}
var d = new Date(this.viewDate),
Function Datetimepicker
has 142 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Datetimepicker = function(element, options) {
var that = this;
this.element = $(element);
this.language = options.language || this.element.data('date-language') || "en";
Function _create
has 139 lines of code (exceeds 25 allowed). Consider refactoring. Open
_create: function() {
// for handling static scoping inside callbacks
var that = this;
// There are 2 kinds of DOM nodes this widget can be instantiated on:
File jquery-migrate.js
has 379 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*!
* jQuery Migrate - v1.2.1 - 2013-05-08
* https://github.com/jquery/jquery-migrate
* Copyright 2005, 2013 jQuery Foundation, Inc. and other contributors; Licensed MIT
*/
Function keydown
has 123 lines of code (exceeds 25 allowed). Consider refactoring. Open
keydown: function(e){
if (this.picker.is(':not(:visible)')){
if (e.keyCode == 27) // allow escape to hide and re-show picker
this.show();
return;
Method import_spreadsheet_file
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
def import_spreadsheet_file(import)
error_messages = []
ActiveRecord::Base.transaction do
at(1,"Conversion du fichier...")
- 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 tag-it.js
has 355 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*
* jQuery UI Tag-it!
*
* @version v2.0 (06/2011)
*
Method friendly_date
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
def friendly_date
date = self.completed_at.present? ? completed_at : self.due_at
if date
case
when date < Time.zone.now && completed_at.present?
- 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 parseDate
has 108 lines of code (exceeds 25 allowed). Consider refactoring. Open
parseDate: function(date, format, language, type) {
if (date instanceof Date) {
var dateUTC = new Date(date.valueOf() - date.getTimezoneOffset() * 60000);
dateUTC.setMilliseconds(0);
return dateUTC;
Class Scheduling
has 33 methods (exceeds 20 allowed). Consider refactoring. Open
class Scheduling < ActiveRecord::Base
belongs_to :show_host, polymorphic: true, autosave: true
belongs_to :show_buyer, autosave: true
belongs_to :scheduler, class_name: "Person", touch: true, autosave: true
has_many :prospectings, dependent: :destroy
File contact.rb
has 332 lines of code (exceeds 250 allowed). Consider refactoring. Open
class Contact < ActiveRecord::Base
extend ContactsHelper
include MyAttributes
default_scope { where(:account_id => Account.current_id) }
Method perform
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def perform(import_id)
import = ContactsImport.find(import_id.to_i)
Account.current_id = import.account_id
current_account = import.account
raise "Un autre import est déjà en cours. Merci d'attendre qu'il soit terminé" if current_account.importing_now
- 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"