django/django

View on GitHub

Showing 1,786 of 2,094 total issues

Function open has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def open(self):
        """
        Ensure an open connection to the email server. Return whether or not a
        new connection was required (True or False) or None if an exception
        passed silently.
Severity: Minor
Found in django/core/mail/backends/smtp.py - 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

Function __init__ has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def __init__(
Severity: Major
Found in django/template/response.py - About 50 mins to fix

    Function _date_from_string has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def _date_from_string(
    Severity: Major
    Found in django/views/generic/dates.py - About 50 mins to fix

      Function log_response has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def log_response(
      Severity: Major
      Found in django/utils/log.py - About 50 mins to fix

        Function format has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        def format(
        Severity: Major
        Found in django/utils/numberformat.py - About 50 mins to fix

          Function _do_update has 7 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def _do_update(self, base_qs, using, pk_val, values, update_fields, forced_update):
          Severity: Major
          Found in django/db/models/base.py - About 50 mins to fix

            Function as_sql has 7 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def as_sql(
            Severity: Major
            Found in django/db/models/expressions.py - About 50 mins to fix

              Function __init__ has 7 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  def __init__(
              Severity: Major
              Found in django/db/models/indexes.py - About 50 mins to fix

                Function _save_table has 7 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    def _save_table(
                Severity: Major
                Found in django/db/models/base.py - About 50 mins to fix

                  Function __init__ has 7 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      def __init__(
                  Severity: Major
                  Found in django/db/models/fields/reverse_related.py - About 50 mins to fix

                    Function __init__ has 7 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        def __init__(
                    Severity: Major
                    Found in django/db/models/constraints.py - About 50 mins to fix

                      Function __init__ has 7 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          def __init__(
                      Severity: Major
                      Found in django/db/models/fields/__init__.py - About 50 mins to fix

                        Function __init__ has 7 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            def __init__(
                        Severity: Major
                        Found in django/db/models/sql/datastructures.py - About 50 mins to fix

                          Function create_option has 7 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              def create_option(
                          Severity: Major
                          Found in django/forms/widgets.py - About 50 mins to fix

                            Function __init__ has 7 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                def __init__(
                            Severity: Major
                            Found in django/forms/fields.py - About 50 mins to fix

                              Function __init__ has 7 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                  def __init__(
                              Severity: Major
                              Found in django/forms/models.py - About 50 mins to fix

                                Function render_change_form has 7 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                    def render_change_form(
                                Severity: Major
                                Found in django/contrib/admin/options.py - About 50 mins to fix

                                  Function __init__ has 7 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                      def __init__(
                                  Severity: Major
                                  Found in django/contrib/contenttypes/forms.py - About 50 mins to fix

                                    Function __init__ has 7 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                        def __init__(
                                    Severity: Major
                                    Found in django/contrib/admin/widgets.py - About 50 mins to fix

                                      Function __init__ has 7 arguments (exceeds 4 allowed). Consider refactoring.
                                      Open

                                          def __init__(
                                      Severity: Major
                                      Found in django/contrib/contenttypes/fields.py - About 50 mins to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language