MAKENTNU/web

View on GitHub

Showing 86 of 230 total issues

Avoid too many return statements within this function.
Open

                return False
Severity: Major
Found in src/make_queue/models/reservation.py - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

                        return False
    Severity: Major
    Found in src/make_queue/models/reservation.py - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                  return _("The reservation cannot start and end at the same time")
      Severity: Major
      Found in src/make_queue/views/reservation.py - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

            return user_details
        Severity: Major
        Found in src/dataporten/ldap_utils.py - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                  return ""
          Severity: Major
          Found in src/make_queue/templatetags/reservation_extra.py - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                    return HttpResponseRedirect(reverse('admin_suggest_skill'))
            Severity: Major
            Found in src/checkin/views.py - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                      return self.quota_can_create_reservation()
              Severity: Major
              Found in src/make_queue/models/reservation.py - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                        return all(rule.valid_time_in_rule(start_time, end_time, len(rules) > 1) for rule in rules)
                Severity: Major
                Found in src/make_queue/models/reservation.py - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                                      return False
                  Severity: Major
                  Found in src/make_queue/models/reservation.py - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                                return _("The start time can't be after the end time")
                    Severity: Major
                    Found in src/make_queue/views/reservation.py - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                                  return _("The reservation can't start in the past")
                      Severity: Major
                      Found in src/make_queue/views/reservation.py - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                    return False
                        Severity: Major
                        Found in src/make_queue/models/reservation.py - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                          return False
                          Severity: Major
                          Found in src/make_queue/models/reservation.py - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                        return not fail_if_not_standalone
                            Severity: Major
                            Found in src/news/models.py - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                                  return False
                              Severity: Major
                              Found in src/make_queue/models/reservation.py - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                        return _("The time slot is not available")
                                Severity: Major
                                Found in src/make_queue/views/reservation.py - About 30 mins to fix

                                  Function mock_module_attrs has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  def mock_module_attrs(module_and_attrname_to_newattr: dict[tuple[Any, str], Any]):
                                      """
                                      A decorator for monkey patching attributes of modules while the decorated function is executed;
                                      the original module attributes are monkey patched back after execution.
                                  
                                  
                                  Severity: Minor
                                  Found in src/util/test_utils.py - 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

                                  Function block_join has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  def block_join(object_collection: Sequence | QuerySet, sep="<b>&bull;</b>", multiline=True):
                                      if len(object_collection) == 0:
                                          return ""
                                  
                                      tag = '<div style="display: inline-block; white-space: nowrap;">'
                                  Severity: Minor
                                  Found in src/util/html_utils.py - 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

                                  Function _do_request_assertion_for_path has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      def _do_request_assertion_for_path(self, path: str, language_prefix: str, client: Client, is_superuser: bool, test_case: SimpleTestCase):
                                          response = client.get(path)
                                  
                                          if self.redirect:
                                              test_case.assertIn(response.status_code, {HTTPStatus.MOVED_PERMANENTLY, HTTPStatus.FOUND},
                                  Severity: Minor
                                  Found in src/util/test_utils.py - 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

                                  Function inner_run has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      def inner_run(self, *args, **options):
                                          if not settings.DEBUG:
                                              super().inner_run(*args, **options)
                                  
                                          addr_regex = r"(?:127\.0\.0\.1|localhost)"
                                  Severity: Minor
                                  Found in src/web/management/commands/runserver.py - 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