project-callisto/callisto-core

View on GitHub

Showing 28 of 28 total issues

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

    def dispatch(self, request, token=None, uidb64=None, *args, **kwargs):
Severity: Minor
Found in callisto_core/reporting/view_partials.py - About 35 mins to fix

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

        def on_retry(self, exc, task_id, args, kwargs, einfo):
    Severity: Minor
    Found in callisto_core/celeryconfig/tasks.py - About 35 mins to fix

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

          def send_user_review_nofication(
      Severity: Minor
      Found in callisto_core/notification/api.py - About 35 mins to fix

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

            def on_failure(self, exc, task_id, args, kwargs, einfo):
        Severity: Minor
        Found in callisto_core/celeryconfig/tasks.py - About 35 mins to fix

          Function twitter_validation_function has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          def twitter_validation_function(value):
              path = None
              try:
                  url_parts = _get_url_parts(value)
                  # check if acceptable domain
          Severity: Minor
          Found in callisto_core/reporting/validators.py - 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

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

              def dispatch(self, request, *args, **kwargs):
                  logger.debug(f"{self.__class__.__name__} access check")
          
                  if (
                      self.access_granted or self.access_form_valid
          Severity: Minor
          Found in callisto_core/delivery/view_partials.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 authenticate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              def authenticate(self, request, username, password):
                  username = sha256(username.encode("utf-8")).hexdigest()
                  username_index = index(username)
                  for user in Account.objects.filter(username_index=username_index):
                      if not user or not bcrypt.checkpw(
          Severity: Minor
          Found in callisto_core/accounts/auth.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 _passphrase_next_url has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              def _passphrase_next_url(self, request):
                  next_url = None
                  if "next" in request.GET:
                      if re.search(r"^/[\W/-]*", request.GET["next"]):
                          if is_safe_url(request.GET["next"]):
          Severity: Minor
          Found in callisto_core/delivery/view_partials.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