fiedl/wingolfsplattform

View on GitHub

Showing 222 of 222 total issues

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

                    Similar blocks of code found in 2 locations. Consider refactoring.
                    Open

                      def dummy_user?(netenv_user)
                        if netenv_user.dummy_user?
                          warning = { message: "Der Test-Benutzer #{netenv_user.w_nummer} wird nicht importiert. Kein Handlungsbedarf.",
                            w_nummer: netenv_user.w_nummer, name: netenv_user.name,
                            netenv_aktivitätszahl: netenv_user.netenv_aktivitätszahl
                    Severity: Minor
                    Found in lib/importers/user_importer.rb and 1 other location - About 20 mins to fix
                    lib/importers/user_importer.rb on lines 146..153

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 28.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Similar blocks of code found in 2 locations. Consider refactoring.
                    Open

                      def duplicate_or_mistaken_user?(netenv_user)
                        if netenv_user.duplicate_or_mistaken_user?
                          warning = { message: "Der fälschlicherweise angelegte Duplikat-Benutzer #{netenv_user.w_nummer} wird nicht importiert. Kein Handlungsbedarf.",
                            w_nummer: netenv_user.w_nummer, name: netenv_user.name,
                            netenv_aktivitätszahl: netenv_user.netenv_aktivitätszahl
                    Severity: Minor
                    Found in lib/importers/user_importer.rb and 1 other location - About 20 mins to fix
                    lib/importers/user_importer.rb on lines 135..142

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 28.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Identical blocks of code found in 2 locations. Consider refactoring.
                    Open

                        if params[:subject].present?
                          new_user.profile_fields.create(
                            type: "ProfileFields::Study", label: params[:study],
                            from: params[:study_from], university: params[:university], subject: params[:subject]
                          )
                    Severity: Minor
                    Found in app/controllers/aktivmeldungen_controller.rb and 1 other location - About 20 mins to fix
                    app/controllers/aktivmeldungen_controller.rb on lines 117..121

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 27.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Identical blocks of code found in 2 locations. Consider refactoring.
                    Open

                        if params[:subject].present?
                          new_user.profile_fields.create(
                            type: "ProfileFields::Study", label: params[:study],
                            from: params[:study_from], university: params[:university], subject: params[:subject]
                          )
                    Severity: Minor
                    Found in app/controllers/aktivmeldungen_controller.rb and 1 other location - About 20 mins to fix
                    app/controllers/aktivmeldungen_controller.rb on lines 152..156

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 27.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Similar blocks of code found in 2 locations. Consider refactoring.
                    Open

                          if netenv_user.burschungsdatum
                            burschen = corporation.status_group("Aktive Burschen")
                            current_membership = self.reload.current_status_membership_in corporation
                            membership_burschen = current_membership.promote_to burschen, at: netenv_user.burschungsdatum
                            membership_burschen.needs_review! if netenv_user.burschungsdatum_geschätzt?
                    Severity: Minor
                    Found in lib/importers/models/user.rb and 1 other location - About 15 mins to fix
                    lib/importers/models/user.rb on lines 256..260

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 26.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Similar blocks of code found in 2 locations. Consider refactoring.
                    Open

                          if netenv_user.philistrationsdatum
                            philister = corporation.status_group("Philister")
                            current_membership = self.reload.current_status_membership_in corporation
                            membership_philister = current_membership.promote_to philister, at: netenv_user.philistrationsdatum
                            membership_philister.needs_review! if netenv_user.philistrationsdatum_geschätzt?
                    Severity: Minor
                    Found in lib/importers/models/user.rb and 1 other location - About 15 mins to fix
                    lib/importers/models/user.rb on lines 248..252

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 26.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Severity
                    Category
                    Status
                    Source
                    Language