fiedl/wingolfsplattform

View on GitHub

Showing 222 of 222 total issues

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

  def fix_netenv_aktivitätszahl_format(str)
    if str
      str = remove_brackets(str)
      str = str.gsub(";", ",")
      str = str.gsub(/^,/, "").gsub(/,$/, "")
Severity: Minor
Found in lib/importers/models/netenv_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

Avoid deeply nested control flow statements.
Open

            if (this.settings.timer > 0) {

              this.settings.$next_tip
                .fadeIn(this.settings.tip_animation_fade_speed)
                .show();
Severity: Major
Found in public/commander/foundation-5/js/foundation.min.js - About 45 mins to fix

    Method in_allen_verbindungen_philistrieren! has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

      def in_allen_verbindungen_philistrieren!
        raise "Noch kein Philister. Das geht nur, wenn er schon in einer Verbindung Philister ist." unless philistrationsdatum
        self.current_corporations.each do |corporation|
          unless self.member_of? corporation.philisterschaft
            status_group_ids_in_this_corporation = StatusGroup.find_all_by_group(corporation.aktivitas).map(&:id)
    Severity: Minor
    Found in app/models/user.rb - About 45 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

    Avoid deeply nested control flow statements.
    Open

                if (self.S(klass).hasClass('fixed')) {
                  self.S(klass).removeClass('fixed');
                  self.S('body').removeClass('f-topbar-fixed');
                }
    Severity: Major
    Found in public/commander/foundation-5/js/foundation.min.js - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                  if (this.settings.timer > 0) {
      
                    this.settings.$next_tip
                      .fadeIn(this.settings.tip_animation_fade_speed)
                      .show();
      Severity: Major
      Found in public/commander/foundation-5/js/foundation/foundation.joyride.js - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                    if (self.S(klass).hasClass('fixed')) {
                      self.S(klass).removeClass('fixed');
                      self.S('body').removeClass('f-topbar-fixed');
                    }
        Severity: Major
        Found in public/commander/foundation-5/js/foundation/foundation.topbar.js - About 45 mins to fix

          Method add_profile_field has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

            def add_profile_field( label, args )
              raise 'no :type argument given' unless args[:type].present?
              args[:type] = "ProfileFieldTypes::#{args[:type]}" unless args[:type].start_with? "ProfileFieldTypes::"
              if (args[:force] or one_argument_present?(args))
                args.delete(:force)
          Severity: Minor
          Found in lib/importers/models/user.rb - About 45 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 import_contact_profile_fields_from has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

            def import_contact_profile_fields_from( netenv_user )
              add_profile_field :home_email, value: netenv_user.home_email, type: 'Email' unless netenv_user.home_email == netenv_user.email
              add_profile_field :work_email, value: netenv_user.work_email, type: 'Email' unless netenv_user.work_email == netenv_user.email
              
              home_address_field = add_profile_field netenv_user.home_address_label, value: netenv_user.home_address, type: 'Address'
          Severity: Minor
          Found in lib/importers/models/user.rb - About 45 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

          Function normalized_value has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              normalized_value : function (val, start, end, step, precision) {
          Severity: Minor
          Found in public/commander/foundation-5/js/foundation/foundation.slider.js - About 35 mins to fix

            Function init has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                init : function (scope, libraries, method, options, response) {
            Severity: Minor
            Found in public/commander/foundation-5/js/foundation.min.js - About 35 mins to fix

              Function init has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  init : function (scope, libraries, method, options, response) {
              Severity: Minor
              Found in public/commander/foundation-5/js/foundation/foundation.js - About 35 mins to fix

                Function normalized_value has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    normalized_value : function (val, start, end, step, precision) {
                Severity: Minor
                Found in public/commander/foundation-5/js/foundation.min.js - About 35 mins to fix

                  Method create has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                    def create
                      authorize! :create, User
                      authorize! :update, corporation
                      raise 'no corporation given' unless corporation
                  
                  
                  Severity: Minor
                  Found in app/controllers/aktivmeldungen_controller.rb - About 35 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 personal_greeting has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                    def personal_greeting(options = {})
                      if self.wingolfit?
                        bbr = if self.aktiver?
                          "Bundesbruder"
                        else
                  Severity: Minor
                  Found in app/models/user.rb - About 35 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_early_access_restrictions has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                    def check_early_access_restrictions
                      if paid_period_expired? && access_to_this_action_restricted?
                        if current_user && true # (not current_user.early_access?)
                          enforce_early_access_restriction
                        end
                  Severity: Minor
                  Found in app/controllers/concerns/current_early_access_restrictions.rb - About 35 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 change_status has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                    def change_status(new_status, options = {})
                      corporation_token = options[:in]
                      corp = if self.current_corporations.count == 1
                        print "Ignoriere :in-Option, da nur ein Band vorliegt.\n" if corporation_token
                        self.current_corporations.first
                  Severity: Minor
                  Found in app/models/user.rb - About 35 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 import_bv_membership_from has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                    def import_bv_membership_from( netenv_user )
                      reset_bv_memberships
                      if netenv_user.bv
                        membership = netenv_user.bv.assign_user self, at: netenv_user.bv_beitrittsdatum
                        membership.needs_review! if netenv_user.bv_beitrittsdatum_geschätzt?
                  Severity: Minor
                  Found in lib/importers/models/user.rb - About 35 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

                  Avoid too many return statements within this function.
                  Open

                        return el.show();
                  Severity: Major
                  Found in public/commander/foundation-5/js/foundation.min.js - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                        return self.find_by_token("BV 46") if country_code.present?
                    Severity: Major
                    Found in app/models/bv.rb - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                            return false;
                      Severity: Major
                      Found in public/commander/foundation-5/js/foundation.min.js - About 30 mins to fix
                        Severity
                        Category
                        Status
                        Source
                        Language