Association-Merci-Edgar/Merci-Edgar

View on GitHub

Showing 159 of 364 total issues

Method from_csv has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def self.from_csv(row)
    scheduling = Scheduling.new
    scheduling.name = "Programmation principale"

    period_with_integer = row.delete(:cycle_de_programmation)
Severity: Major
Found in app/models/scheduling.rb - About 2 hrs to fix

    Consider simplifying this complex logical expression.
    Open

                        if (
                            event.which === $.ui.keyCode.COMMA ||
                            event.which === $.ui.keyCode.ENTER ||
                            (
                                event.which == $.ui.keyCode.TAB &&
    Severity: Critical
    Found in app/assets/javascripts/tag-it.js - About 2 hrs to fix

      Function addMarker has 46 lines of code (exceeds 25 allowed). Consider refactoring.
      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); }
      
      
      Severity: Minor
      Found in app/assets/javascripts/onepage/jquery.gmap.js - About 1 hr to fix

        Function attr has 43 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        jQuery.attr = function( elem, name, value, pass ) {
            var lowerName = name.toLowerCase(),
                nType = elem && elem.nodeType;
        
            if ( pass ) {
        Severity: Minor
        Found in app/assets/javascripts/jquery-migrate.js - About 1 hr to fix

          Function _attachEvents has 43 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  _attachEvents: function(){
                      this._detachEvents();
                      if (this.isInput) { // single input
                          this._events = [
                              [this.element, {
          Severity: Minor
          Found in app/assets/javascripts/datetimepicker/bootstrap-datetimepicker.js - About 1 hr to fix

            Function show has 43 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              , show: function () {
                  var $tip
                    , inside
                    , pos
                    , actualWidth
            Severity: Minor
            Found in app/assets/javascripts/onepage/bootstrap-tooltip.js - About 1 hr to fix

              Function show has 43 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                , show: function () {
                    var $tip
                      , inside
                      , pos
                      , actualWidth
              Severity: Minor
              Found in app/assets/javascripts/onepage/bootstrap.js - About 1 hr to fix

                Function show has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  , show: function () {
                      var $tip
                        , inside
                        , pos
                        , actualWidth
                Severity: Minor
                Found in app/assets/javascripts/bootstrap.js - About 1 hr to fix

                  Function UItoTop has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      $.fn.UItoTop = function(options) {
                  
                           var defaults = {
                                  text: '',
                                  min: 200,
                  Severity: Minor
                  Found in app/assets/javascripts/onepage/jquery.ui.totop.js - About 1 hr to fix

                    Function multivalues_autocomplete has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                    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 ) ) );
                    Severity: Minor
                    Found in app/assets/javascripts/tag.js - About 1 hr to fix

                      Method only has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                      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]
                      Severity: Minor
                      Found in app/controllers/contacts_controller.rb - About 1 hr to fix

                        Method create_with_confirmation has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                        Open

                          def create_with_confirmation
                            build_resource(params[:user])
                        
                            if resource.save
                              if resource.active_for_authentication?
                        Severity: Minor
                        Found in app/controllers/registrations_controller.rb - About 1 hr 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

                        Method bulk has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                        Open

                          def bulk
                            @contact_ids = params[:contact_ids]
                            case params[:bulk_action]
                            when "delete"
                              Contact.where(id: params[:contact_ids]).find_each do |contact|
                        Severity: Minor
                        Found in app/controllers/contacts_controller.rb - About 1 hr 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 showStep has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                              Tour.prototype.showStep = function(i) {
                                var promise, showStepHelper, skipToPrevious, step,
                                  _this = this;
                                step = this.getStep(i);
                                if (!step) {
                        Severity: Minor
                        Found in app/assets/javascripts/appli/bootstrap-tour.js - About 1 hr to fix

                          Method import_spreadsheet_file has 39 lines of code (exceeds 25 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 1 hr to fix

                            Method from_csv has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              def self.from_csv(row)
                                venue = Venue.new
                                kind = row["type_lieu".to_sym]
                            
                                if kind.present?
                            Severity: Minor
                            Found in app/models/venue.rb - About 1 hr to fix

                              Method perform has 38 lines of code (exceeds 25 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 1 hr to fix

                                Function slide has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  , slide: function (type, next) {
                                      var $active = this.$element.find('.item.active')
                                        , $next = next || $active[type]()
                                        , isCycling = this.interval
                                        , direction = type == 'next' ? 'left' : 'right'
                                Severity: Minor
                                Found in app/assets/javascripts/onepage/bootstrap.js - About 1 hr to fix

                                  Function slide has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    , slide: function (type, next) {
                                        var $active = this.$element.find('.item.active')
                                          , $next = next || $active[type]()
                                          , isCycling = this.interval
                                          , direction = type == 'next' ? 'left' : 'right'
                                  Severity: Minor
                                  Found in app/assets/javascripts/bootstrap.js - About 1 hr to fix

                                    Function slide has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                      , slide: function (type, next) {
                                          var $active = this.$element.find('.item.active')
                                            , $next = next || $active[type]()
                                            , isCycling = this.interval
                                            , direction = type == 'next' ? 'left' : 'right'
                                    Severity: Minor
                                    Found in app/assets/javascripts/onepage/bootstrap-carousel.js - About 1 hr to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language