Association-Merci-Edgar/Merci-Edgar

View on GitHub

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
Severity: Major
Found in app/assets/javascripts/datetimepicker/bootstrap-datetimepicker.js - About 3 days to fix

    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.
    Severity: Major
    Found in app/assets/javascripts/onepage/bootstrap.js - About 3 days to fix

      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.
      Severity: Major
      Found in app/assets/javascripts/bootstrap.js - About 3 days to fix

        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;
            }
        Severity: Major
        Found in app/assets/javascripts/entypo-ie7.js - About 1 day to fix

          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>
          Severity: Major
          Found in app/assets/javascripts/onepage/jquery.gmap.js - About 1 day to fix

            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
            Severity: Major
            Found in app/assets/javascripts/appli/bootstrap-tour.js - About 1 day to fix

              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) }
              Severity: Minor
              Found in app/models/contact.rb - About 6 hrs to fix

                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) {
                Severity: Major
                Found in app/assets/javascripts/datetimepicker/bootstrap-datetimepicker.js - About 6 hrs to fix

                  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),
                  Severity: Major
                  Found in app/assets/javascripts/datetimepicker/bootstrap-datetimepicker.js - About 6 hrs to fix

                    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";
                    Severity: Major
                    Found in app/assets/javascripts/datetimepicker/bootstrap-datetimepicker.js - About 5 hrs to fix

                      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:
                      Severity: Major
                      Found in app/assets/javascripts/tag-it.js - About 5 hrs to fix

                        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
                         */
                        Severity: Minor
                        Found in app/assets/javascripts/jquery-migrate.js - About 5 hrs to fix

                          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;
                          Severity: Major
                          Found in app/assets/javascripts/datetimepicker/bootstrap-datetimepicker.js - About 4 hrs to fix

                            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...")
                            
                            
                            Severity: Minor
                            Found in app/workers/contacts_import_worker.rb - About 4 hrs to fix

                            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)
                            *
                            Severity: Minor
                            Found in app/assets/javascripts/tag-it.js - About 4 hrs to fix

                              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?
                              Severity: Minor
                              Found in app/models/task.rb - About 4 hrs to fix

                              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;
                              Severity: Major
                              Found in app/assets/javascripts/datetimepicker/bootstrap-datetimepicker.js - About 4 hrs to fix

                                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
                                Severity: Minor
                                Found in app/models/scheduling.rb - About 4 hrs to fix

                                  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) }
                                  Severity: Minor
                                  Found in app/models/contact.rb - About 4 hrs to fix

                                    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
                                    Severity: Minor
                                    Found in app/workers/contacts_import_worker.rb - About 3 hrs to fix

                                    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

                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language