django/django

View on GitHub

Showing 1,784 of 2,092 total issues

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 save has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def save(
    Severity: Major
    Found in django/contrib/gis/utils/layermapping.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/gis/db/models/fields.py - About 50 mins to fix

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

        def default_reference_role(
        Severity: Major
        Found in django/contrib/admindocs/utils.py - About 50 mins to fix

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

              def _role(name, rawtext, text, lineno, inliner, options=None, content=None):
          Severity: Major
          Found in django/contrib/admindocs/utils.py - About 50 mins to fix

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

            def default_role_error(
            Severity: Major
            Found in docs/_ext/djangodocs.py - About 50 mins to fix

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

                  def entity_decl(
              Severity: Major
              Found in django/core/serializers/xml_serializer.py - About 50 mins to fix

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

                    def __init__(
                Severity: Major
                Found in django/core/files/uploadedfile.py - About 50 mins to fix

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

                  def run(
                  Severity: Major
                  Found in django/core/servers/basehttp.py - About 50 mins to fix

                    Function url has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def url(parser, token):
                        r"""
                        Return an absolute URL matching the given view with its parameters.
                    
                        This is a way to define links that aren't tied to a particular URL
                    Severity: Minor
                    Found in django/template/defaulttags.py - About 45 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 reset_loaders has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def reset_loaders():
                        from django.forms.renderers import get_default_renderer
                    
                        for backend in engines.all():
                            if not isinstance(backend, DjangoTemplates):
                    Severity: Minor
                    Found in django/template/autoreload.py - About 45 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 simple_tag has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def simple_tag(self, func=None, takes_context=None, name=None):
                            """
                            Register a callable as a compiled template tag. Example:
                    
                            @register.simple_tag
                    Severity: Minor
                    Found in django/template/library.py - About 45 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_timezone has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def do_timezone(value, arg):
                        """
                        Convert a datetime to local time in a given time zone.
                    
                        The argument must be an instance of a tzinfo subclass or a time zone name.
                    Severity: Minor
                    Found in django/templatetags/tz.py - About 45 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 tabularFormset has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                        $.fn.tabularFormset = function(selector, options) {
                            const $rows = $(this);
                    
                            const reinitDateTimeShortCuts = function() {
                                // Reinitialize the calendar and clock widgets by force
                    Severity: Minor
                    Found in django/contrib/admin/static/admin/js/inlines.js - About 45 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 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def render(self, context):
                            """
                            Render the specified template and context. Cache the template object
                            in render_context to avoid reparsing and loading when used in a for
                            loop.
                    Severity: Minor
                    Found in django/template/loader_tags.py - About 45 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 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def render(self, context):
                            """
                            Render the specified template and context. Cache the template object
                            in render_context to avoid reparsing and loading when used in a for
                            loop.
                    Severity: Minor
                    Found in django/template/library.py - About 45 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 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                            init: function(field_id, field_name, is_stacked) {
                                if (field_id.match(/__prefix__/)) {
                                    // Don't initialize on empty forms.
                                    return;
                                }
                    Severity: Minor
                    Found in django/contrib/admin/static/admin/js/SelectFilter2.js - About 45 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 process_response has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def process_response(self, request, response):
                            language = translation.get_language()
                            language_from_path = translation.get_language_from_path(request.path_info)
                            urlconf = getattr(request, "urlconf", settings.ROOT_URLCONF)
                            (
                    Severity: Minor
                    Found in django/middleware/locale.py - About 45 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 6 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        def __init__(
                    Severity: Minor
                    Found in django/template/context.py - About 45 mins to fix

                      Function resolve has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def resolve(self, context):
                              """Resolve this variable against a given context."""
                              if self.lookups is not None:
                                  # We're dealing with a variable that needs to be resolved
                                  value = self._resolve_lookup(context)
                      Severity: Minor
                      Found in django/template/base.py - About 45 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