nephila/djangocms-helper

View on GitHub

Showing 93 of 93 total issues

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

    def _prepare_request(self, request, page, user, lang, use_middlewares, use_toolbar=False, secure=False):
Severity: Major
Found in app_helper/base_test.py - About 50 mins to fix

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

        def get_page_request(self, page, user, path=None, edit=False, lang="en", use_middlewares=False, secure=False):
    Severity: Major
    Found in app_helper/base_test.py - About 50 mins to fix

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

      def run(settings, bind, port, migrate_cmd, verbose, use_channels, use_daphne):
      Severity: Major
      Found in app_helper/server.py - About 50 mins to fix

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

                if author.lower() not in seen_authors:
                    seen_authors.append(author.lower())
                    authors.append(author)
        Severity: Minor
        Found in app_helper/main.py and 1 other location - About 50 mins to fix
        app_helper/main.py on lines 186..188

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 36.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

                        if author.lower() not in seen_authors:
                            seen_authors.append(author.lower())
                            authors.append(author)
        Severity: Minor
        Found in app_helper/main.py and 1 other location - About 50 mins to fix
        app_helper/main.py on lines 191..193

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 36.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 4 locations. Consider refactoring.
        Open

                                self.assertTrue(
                                    "django.template.loaders.app_directories.Loader"
                                    in local_settings.TEMPLATES[0]["OPTIONS"]["loaders"]
        Severity: Major
        Found in tests/test_commands.py and 3 other locations - About 45 mins to fix
        tests/test_commands.py on lines 369..370
        tests/test_commands.py on lines 373..375
        tests/test_commands.py on lines 378..380

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 35.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Avoid deeply nested control flow statements.
        Open

                            with context:
                                num_failures = test(
                                    args["<test-label>"],
                                    application,
                                    args["--failfast"],
        Severity: Major
        Found in app_helper/main.py - About 45 mins to fix

          Function get_default_settings has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          def get_default_settings(CMS_APP, CMS_PROCESSORS, CMS_MIDDLEWARE, CMS_APP_STYLE, URLCONF, application):  # NOQA
          Severity: Minor
          Found in app_helper/default_settings.py - About 45 mins to fix

            Similar blocks of code found in 4 locations. Consider refactoring.
            Open

                                    self.assertTrue(
                                        "admin_tools.template_loaders.Loader" in local_settings.TEMPLATES[0]["OPTIONS"]["loaders"]
            Severity: Major
            Found in tests/test_commands.py and 3 other locations - About 45 mins to fix
            tests/test_commands.py on lines 364..366
            tests/test_commands.py on lines 373..375
            tests/test_commands.py on lines 378..380

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 35.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 10 locations. Consider refactoring.
            Open

            DJANGO_2_2 = version.parse("2.2") <= version.parse(django.get_version()) < version.parse("3.0")
            Severity: Major
            Found in app_helper/utils.py and 9 other locations - About 45 mins to fix
            app_helper/utils.py on lines 57..57
            app_helper/utils.py on lines 58..58
            app_helper/utils.py on lines 59..59
            app_helper/utils.py on lines 60..60
            app_helper/utils.py on lines 61..61
            app_helper/utils.py on lines 62..62
            app_helper/utils.py on lines 63..63
            app_helper/utils.py on lines 64..64
            app_helper/utils.py on lines 65..65

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 35.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 10 locations. Consider refactoring.
            Open

            DJANGO_3_2 = version.parse("3.2") <= version.parse(django.get_version()) < version.parse("4.0")
            Severity: Major
            Found in app_helper/utils.py and 9 other locations - About 45 mins to fix
            app_helper/utils.py on lines 56..56
            app_helper/utils.py on lines 57..57
            app_helper/utils.py on lines 58..58
            app_helper/utils.py on lines 60..60
            app_helper/utils.py on lines 61..61
            app_helper/utils.py on lines 62..62
            app_helper/utils.py on lines 63..63
            app_helper/utils.py on lines 64..64
            app_helper/utils.py on lines 65..65

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 35.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 10 locations. Consider refactoring.
            Open

            DJANGO_5_0 = version.parse("5.0") <= version.parse(django.get_version()) < version.parse("5.1")
            Severity: Major
            Found in app_helper/utils.py and 9 other locations - About 45 mins to fix
            app_helper/utils.py on lines 56..56
            app_helper/utils.py on lines 57..57
            app_helper/utils.py on lines 58..58
            app_helper/utils.py on lines 59..59
            app_helper/utils.py on lines 60..60
            app_helper/utils.py on lines 61..61
            app_helper/utils.py on lines 62..62
            app_helper/utils.py on lines 64..64
            app_helper/utils.py on lines 65..65

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 35.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 10 locations. Consider refactoring.
            Open

            DJANGO_5_1 = version.parse("5.1") <= version.parse(django.get_version()) < version.parse("5.2")
            Severity: Major
            Found in app_helper/utils.py and 9 other locations - About 45 mins to fix
            app_helper/utils.py on lines 56..56
            app_helper/utils.py on lines 57..57
            app_helper/utils.py on lines 58..58
            app_helper/utils.py on lines 59..59
            app_helper/utils.py on lines 60..60
            app_helper/utils.py on lines 61..61
            app_helper/utils.py on lines 62..62
            app_helper/utils.py on lines 63..63
            app_helper/utils.py on lines 65..65

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 35.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 4 locations. Consider refactoring.
            Open

                                    self.assertTrue(
                                        "django.template.context_processors.request"
                                        in local_settings.TEMPLATES[0]["OPTIONS"]["context_processors"]
            Severity: Major
            Found in tests/test_commands.py and 3 other locations - About 45 mins to fix
            tests/test_commands.py on lines 364..366
            tests/test_commands.py on lines 369..370
            tests/test_commands.py on lines 378..380

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 35.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Avoid deeply nested control flow statements.
            Open

                                if args["--runner"]:
                                    runner = args["--runner"]
                                else:
                                    runner = settings.TEST_RUNNER
            
            
            Severity: Major
            Found in app_helper/main.py - About 45 mins to fix

              Function _init_runserver has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              def _init_runserver(runserver_module, bind, port, verbose, logger=None, channels=False):
              Severity: Minor
              Found in app_helper/server.py - About 45 mins to fix

                Similar blocks of code found in 10 locations. Consider refactoring.
                Open

                DJANGO_3_0 = version.parse("3.0") <= version.parse(django.get_version()) < version.parse("3.1")
                Severity: Major
                Found in app_helper/utils.py and 9 other locations - About 45 mins to fix
                app_helper/utils.py on lines 56..56
                app_helper/utils.py on lines 58..58
                app_helper/utils.py on lines 59..59
                app_helper/utils.py on lines 60..60
                app_helper/utils.py on lines 61..61
                app_helper/utils.py on lines 62..62
                app_helper/utils.py on lines 63..63
                app_helper/utils.py on lines 64..64
                app_helper/utils.py on lines 65..65

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 35.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 10 locations. Consider refactoring.
                Open

                DJANGO_5_2 = version.parse("5.2") <= version.parse(django.get_version()) < version.parse("6.0")
                Severity: Major
                Found in app_helper/utils.py and 9 other locations - About 45 mins to fix
                app_helper/utils.py on lines 56..56
                app_helper/utils.py on lines 57..57
                app_helper/utils.py on lines 58..58
                app_helper/utils.py on lines 59..59
                app_helper/utils.py on lines 60..60
                app_helper/utils.py on lines 61..61
                app_helper/utils.py on lines 62..62
                app_helper/utils.py on lines 63..63
                app_helper/utils.py on lines 64..64

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 35.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 10 locations. Consider refactoring.
                Open

                DJANGO_4_0 = version.parse("4.0") <= version.parse(django.get_version()) < version.parse("4.1")
                Severity: Major
                Found in app_helper/utils.py and 9 other locations - About 45 mins to fix
                app_helper/utils.py on lines 56..56
                app_helper/utils.py on lines 57..57
                app_helper/utils.py on lines 58..58
                app_helper/utils.py on lines 59..59
                app_helper/utils.py on lines 61..61
                app_helper/utils.py on lines 62..62
                app_helper/utils.py on lines 63..63
                app_helper/utils.py on lines 64..64
                app_helper/utils.py on lines 65..65

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 35.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Function django_db_setup has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                def django_db_setup(
                Severity: Minor
                Found in tests/test_utils/conftest.py - About 45 mins to fix
                  Severity
                  Category
                  Status
                  Source
                  Language