django/django

View on GitHub

Showing 2,094 of 2,094 total issues

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

        def __init__(self, mode="w+b", bufsize=-1, suffix="", prefix="", dir=None):
Severity: Minor
Found in django/core/files/temp.py - About 35 mins to fix

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

    def dumps(
    Severity: Minor
    Found in django/core/signing.py - About 35 mins to fix

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

      def html_page_context_hook(app, pagename, templatename, context, doctree):
      Severity: Minor
      Found in docs/_ext/djangodocs.py - About 35 mins to fix

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

            def __init__(self, stdin, stdout, stderr, environ, **kwargs):
        Severity: Minor
        Found in django/core/servers/basehttp.py - About 35 mins to fix

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

          def mail_managers(
          Severity: Minor
          Found in django/core/mail/__init__.py - About 35 mins to fix

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

                def handle_raw_input(
            Severity: Minor
            Found in django/core/files/uploadhandler.py - About 35 mins to fix

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

                  def __init__(self, name, content_type, size, charset, content_type_extra=None):
              Severity: Minor
              Found in django/core/files/uploadedfile.py - About 35 mins to fix

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

                def github_linkcode_resolve(domain, info, *, version, next_version):
                Severity: Minor
                Found in docs/_ext/github_links.py - About 35 mins to fix

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

                      def __init__(
                  Severity: Minor
                  Found in django/core/paginator.py - About 35 mins to fix

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

                        def __init__(
                    Severity: Minor
                    Found in django/core/cache/backends/redis.py - About 35 mins to fix

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

                          def __init__(
                      Severity: Minor
                      Found in django/core/serializers/xml_serializer.py - About 35 mins to fix

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

                            def unparsed_entity_decl(self, name, base, sysid, pubid, notation_name):
                        Severity: Minor
                        Found in django/core/serializers/xml_serializer.py - About 35 mins to fix

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

                              def __init__(
                          Severity: Minor
                          Found in django/core/validators.py - About 35 mins to fix

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

                            def linenumbers(value, autoescape=True):
                                """Display text with line numbers."""
                                lines = value.split("\n")
                                # Find the maximum width of the line count, for use with zero padding
                                # string format command
                            Severity: Minor
                            Found in django/template/defaultfilters.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 select_template has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                            Open

                                def select_template(self, template_name_list):
                                    """
                                    Given a list of template names, return the first that can be loaded.
                                    """
                                    if not template_name_list:
                            Severity: Minor
                            Found in django/template/engine.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 get_template has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                            Open

                                def get_template(self, template_name, skip=None):
                                    """
                                    Call self.get_template_sources() and return a Template object for
                                    the first template matching template_name. If skip is provided, ignore
                                    template origins in skip. This is used to avoid recursion during
                            Severity: Minor
                            Found in django/template/loaders/base.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 load_from_library has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                            Open

                            def load_from_library(library, label, names):
                                """
                                Return a subset of tags and filters from a library.
                                """
                                subset = Library()
                            Severity: Minor
                            Found in django/template/defaulttags.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 init has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                            Open

                                    init: function() {
                                        const serverOffset = document.body.dataset.adminUtcOffset;
                                        if (serverOffset) {
                                            const localOffset = new Date().getTimezoneOffset() * -60;
                                            DateTimeShortcuts.timezoneOffset = localOffset - serverOffset;
                            Severity: Minor
                            Found in django/contrib/admin/static/admin/js/admin/DateTimeShortcuts.js - 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 render has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                            Open

                                def render(self, context):
                                    csrf_token = context.get("csrf_token")
                                    if csrf_token:
                                        if csrf_token == "NOTPROVIDED":
                                            return format_html("")
                            Severity: Minor
                            Found in django/template/defaulttags.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 strptime has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                            Open

                                String.prototype.strptime = function(format) {
                                    const split_format = format.split(/[.\-/]/);
                                    const date = this.split(/[.\-/]/);
                                    let i = 0;
                                    let day, month, year;
                            Severity: Minor
                            Found in django/contrib/admin/static/admin/js/core.js - 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

                            Severity
                            Category
                            Status
                            Source
                            Language