fiedl/wingolfsplattform

View on GitHub

Showing 180 of 222 total issues

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

        Avoid too many return statements within this function.
        Open

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

          Avoid too many return statements within this function.
          Open

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

            Avoid too many return statements within this function.
            Open

                      return $.get(path, function (response) {
                        el.html(response);
                        el.data(self.data_attr + '-last-path', path);
                        trigger();
                      });
            Severity: Major
            Found in public/commander/foundation-5/js/foundation.min.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

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

                Avoid too many return statements within this method.
                Open

                    return self.find_by_token("BV 00")
                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/foundation.tooltip.js - 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

                      Avoid too many return statements within this function.
                      Open

                             return false;
                      Severity: Major
                      Found in public/commander/foundation-5/js/foundation/foundation.topbar.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                  return $.get(path, function (response) {
                                    el.html(response);
                                    el.data(self.data_attr + '-last-path', path);
                                    trigger();
                                  });
                        Severity: Major
                        Found in public/commander/foundation-5/js/foundation/foundation.interchange.js - About 30 mins to fix

                          Method change_group_id_according_to_aktive_and_philister has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                            def change_group_id_according_to_aktive_and_philister
                              if group_id && (corporation = group.corporation) && @scope_has_changed
                                @scope_has_changed = false
                                if aktive and philister
                                  self.move_to corporation
                          Severity: Minor
                          Found in app/models/event.rb - About 25 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_local_admins has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                            def rights_for_local_admins
                              can :index, PublicActivity::Activity
                              can :index, Issue
                          
                              if not read_only_mode?
                          Severity: Minor
                          Found in app/models/ability.rb - About 25 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 status_export_string has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                            def status_export_string
                              self.corporations.collect do |corporation|
                                if membership = self.current_status_membership_in(corporation)
                                  "#{membership.group.name.singularize} im #{corporation.name} seit #{I18n.localize(membership.valid_from.to_date) if membership.valid_from}"
                                else
                          Severity: Minor
                          Found in app/models/user.rb - About 25 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 to_datetime has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                            def to_datetime
                              self.replace_flaws!
                              
                              if self.blank?
                                return nil
                          Severity: Minor
                          Found in lib/importers/models/string.rb - About 25 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 type_of_study has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                            def type_of_study
                              # "Bachelor/Master", "Diplom", "Kirchliche Prüfung", "Magister", "Promotion", "Staatsprüfung"
                              type = data_hash_value :epdwingolfedustudystatus
                              type = "Bachelor-Master-Studium"         if type == "Bachelor/Master"
                              type = "Diplom-Studium"                  if type == "Diplom"
                          Severity: Minor
                          Found in lib/importers/models/netenv_user.rb - About 25 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