Showing 159 of 364 total issues
Method from_csv
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def self.from_csv(row)
scheduling = Scheduling.new
scheduling.name = "Programmation principale"
period_with_integer = row.delete(:cycle_de_programmation)
Consider simplifying this complex logical expression. Open
Open
if (
event.which === $.ui.keyCode.COMMA ||
event.which === $.ui.keyCode.ENTER ||
(
event.which == $.ui.keyCode.TAB &&
Function addMarker
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
addMarker: function (marker) {
var opts = this.data('gmap').opts;
if (opts.log) {console.log("putting marker at " + marker.latitude + ', ' + marker.longitude + " with address " + marker.address + " and html " + marker.html); }
Function attr
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
jQuery.attr = function( elem, name, value, pass ) {
var lowerName = name.toLowerCase(),
nType = elem && elem.nodeType;
if ( pass ) {
Function _attachEvents
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_attachEvents: function(){
this._detachEvents();
if (this.isInput) { // single input
this._events = [
[this.element, {
Function show
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
, show: function () {
var $tip
, inside
, pos
, actualWidth
Function show
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
, show: function () {
var $tip
, inside
, pos
, actualWidth
Function show
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
, show: function () {
var $tip
, inside
, pos
, actualWidth
Function UItoTop
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$.fn.UItoTop = function(options) {
var defaults = {
text: '',
min: 200,
Function multivalues_autocomplete
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
jQuery.fn.multivalues_autocomplete = function(options) {
var settings = $.extend({}, options)
if (settings.available_tags) {
source_fn = function( request, response ) {
response( $.ui.autocomplete.filter(options.available_tags, extractLast( request.term ) ) );
Method only
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def only
@no_paging = false
@contacts = case params[:filter]
when "favorites" then current_user.favorites.page params[:page]
when "contacted" then Contact.with_reportings.page params[:page]
Method create_with_confirmation
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
Open
def create_with_confirmation
build_resource(params[:user])
if resource.save
if resource.active_for_authentication?
- 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 bulk
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
Open
def bulk
@contact_ids = params[:contact_ids]
case params[:bulk_action]
when "delete"
Contact.where(id: params[:contact_ids]).find_each do |contact|
- 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 showStep
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Tour.prototype.showStep = function(i) {
var promise, showStepHelper, skipToPrevious, step,
_this = this;
step = this.getStep(i);
if (!step) {
Method import_spreadsheet_file
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def import_spreadsheet_file(import)
error_messages = []
ActiveRecord::Base.transaction do
at(1,"Conversion du fichier...")
Method from_csv
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def self.from_csv(row)
venue = Venue.new
kind = row["type_lieu".to_sym]
if kind.present?
Method perform
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
Function slide
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
, slide: function (type, next) {
var $active = this.$element.find('.item.active')
, $next = next || $active[type]()
, isCycling = this.interval
, direction = type == 'next' ? 'left' : 'right'
Function slide
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
, slide: function (type, next) {
var $active = this.$element.find('.item.active')
, $next = next || $active[type]()
, isCycling = this.interval
, direction = type == 'next' ? 'left' : 'right'
Function slide
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
, slide: function (type, next) {
var $active = this.$element.find('.item.active')
, $next = next || $active[type]()
, isCycling = this.interval
, direction = type == 'next' ? 'left' : 'right'