fiedl/wingolfsplattform

View on GitHub

Showing 222 of 222 total issues

Function offsets has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    offsets : function (expedition, window_offset) {
      var self = this,
          settings = expedition.data(self.attr_name(true) + '-init'),
          viewport_offset = window_offset;

Severity: Minor
Found in public/commander/foundation-5/js/foundation/foundation.magellan.js - About 1 hr to fix

    Method leibfamilie has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

      def leibfamilie
        familie = []
        familie << {description: "", user: self}
        if leibbursch
          relationship = Relationship.where(user1: leibbursch, name: "Leibbursch", user2: self).first
    Severity: Minor
    Found in app/models/concerns/user_leibverhaeltnisse.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 import_death_from has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

      def import_death_from( netenv_user )
        if netenv_user.verstorben?
          
          date_of_death = netenv_user.netenv_org_membership_end_date
          date_of_death ||= self.memberships.order(:valid_from).last.valid_from + 1.day
    Severity: Minor
    Found in lib/importers/models/user.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 matchMedia has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      window.matchMedia || (window.matchMedia = function() {
          "use strict";
    
          // For browsers that support matchMedium api such as IE 9 and webkit
          var styleMedia = (window.styleMedia || window.media);
    Severity: Minor
    Found in public/commander/foundation-5/js/foundation/foundation.js - About 1 hr to fix

      Function matchMedia has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        window.matchMedia || (window.matchMedia = function() {
            "use strict";
      
            // For browsers that support matchMedium api such as IE 9 and webkit
            var styleMedia = (window.styleMedia || window.media);
      Severity: Minor
      Found in public/commander/foundation-5/js/foundation.min.js - About 1 hr to fix

        Method adapt_bv_to_primary_address has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def adapt_bv_to_primary_address
            self.groups.reload
            new_bv = correct_bv
        
            # Wenn der Philister einen Wunsch-BV hat, wird die automatische Zuordnung
        Severity: Minor
        Found in app/models/user.rb - About 1 hr to fix

          Method import_secondary_corporations_from has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def import_secondary_corporations_from( netenv_user )
          
              last_date_of_joining = netenv_user.aktivmeldungsdatum
              
              netenv_user.secondary_corporations.each do |corporation|
          Severity: Minor
          Found in lib/importers/models/user.rb - About 1 hr to fix

            Function init has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                init : function (scope, libraries, method, options, response) {
                  var args = [scope, method, options, response],
                      responses = [];
            
                  // check RTL
            Severity: Minor
            Found in public/commander/foundation-5/js/foundation/foundation.js - About 1 hr to fix

              Function init has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  init : function (scope, libraries, method, options, response) {
                    var args = [scope, method, options, response],
                        responses = [];
              
                    // check RTL
              Severity: Minor
              Found in public/commander/foundation-5/js/foundation.min.js - About 1 hr to fix

                Function assemble has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    assemble : function (topbar) {
                      var self = this,
                          settings = topbar.data(this.attr_name(true) + '-init'),
                          section = self.S('section, .top-bar-section', topbar);
                
                
                Severity: Minor
                Found in public/commander/foundation-5/js/foundation/foundation.topbar.js - About 1 hr to fix

                  Function assemble has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      assemble : function (topbar) {
                        var self = this,
                            settings = topbar.data(this.attr_name(true) + '-init'),
                            section = self.S('section, .top-bar-section', topbar);
                  
                  
                  Severity: Minor
                  Found in public/commander/foundation-5/js/foundation.min.js - About 1 hr to fix

                    Function css has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        css : function (dropdown, target) {
                          var left_offset = Math.max((target.width() - dropdown.width()) / 2, 8),
                              settings = target.data(this.attr_name(true) + '-init') || this.settings,
                              parentOverflow = dropdown.parent().css('overflow-y') || dropdown.parent().css('overflow');
                    
                    
                    Severity: Minor
                    Found in public/commander/foundation-5/js/foundation.min.js - About 1 hr to fix

                      Function css has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          css : function (dropdown, target) {
                            var left_offset = Math.max((target.width() - dropdown.width()) / 2, 8),
                                settings = target.data(this.attr_name(true) + '-init') || this.settings,
                                parentOverflow = dropdown.parent().css('overflow-y') || dropdown.parent().css('overflow');
                      
                      
                      Severity: Minor
                      Found in public/commander/foundation-5/js/foundation/foundation.dropdown.js - About 1 hr to fix

                        Method fill_in_template_profile_information has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          def fill_in_template_profile_information
                            self.profile_fields.create(label: :personal_title, type: "ProfileFields::General")
                            self.profile_fields.create(label: :academic_degree, type: "ProfileFields::AcademicDegree")
                            self.profile_fields.create(label: :cognomen, type: "ProfileFields::General")
                            self.profile_fields.create(label: :klammerung, type: "ProfileFields::Klammerung")
                        Severity: Minor
                        Found in app/models/user.rb - About 1 hr to fix

                          Method create_from_aktivmeldung has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            def create_from_aktivmeldung
                              raise 'Kein Auftrag zur Datenverarbeitung erteilt.' unless params[:privacy].present?
                              new_user = User.create first_name: params[:first_name], last_name: params[:last_name]
                              new_user.date_of_birth = params[:date_of_birth].to_date
                              new_user.mobile = params[:phone]
                          Severity: Minor
                          Found in app/controllers/aktivmeldungen_controller.rb - About 1 hr to fix

                            Method fill_in_template_profile_information has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                            Open

                              def fill_in_template_profile_information
                                self.profile_fields.create(label: :personal_title, type: "ProfileFields::General")
                                self.profile_fields.create(label: :academic_degree, type: "ProfileFields::AcademicDegree")
                                self.profile_fields.create(label: :cognomen, type: "ProfileFields::General")
                                self.profile_fields.create(label: :klammerung, type: "ProfileFields::Klammerung")
                            Severity: Minor
                            Found in app/models/user.rb - About 55 mins 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 rights_for_signed_in_users has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                            Open

                              def rights_for_signed_in_users
                                #
                                # Inherited from your_platform:
                                # - terms of use
                                # - users
                            Severity: Minor
                            Found in app/models/ability.rb - About 55 mins 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 access_to_this_action_restricted? has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                            Open

                              def access_to_this_action_restricted?
                                if kind_of?(PagesController) && (action_name == "show")
                                  page = Page.find(params[:id])
                                  if page.public?
                                    false
                            Severity: Minor
                            Found in app/controllers/concerns/current_early_access_restrictions.rb - About 55 mins 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 check_corporation_memberships_consistency_for has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                            Open

                              def check_corporation_memberships_consistency_for(netenv_user)
                                
                                # Aktivmeldungsdatum?
                                if not netenv_user.aktivmeldungsdatum
                                  warning = { message: 'Kein Aktivmeldungsdatum angegeben.',
                            Severity: Minor
                            Found in lib/importers/user_importer.rb - About 55 mins 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 create_from_keilgast has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                            Open

                              def create_from_keilgast
                                raise 'Kein Auftrag zur Datenverarbeitung erteilt.' unless params[:privacy].present?
                                keilgast_group = corporation.sub_group("Keilgäste") || raise("Für die Verbindung #{corporation.name} ist keine Gruppe 'Keilgäste' vorhanden.")
                            
                                new_user = User.create first_name: params[:first_name], last_name: params[:last_name]
                            Severity: Minor
                            Found in app/controllers/aktivmeldungen_controller.rb - About 55 mins 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