django/django

View on GitHub

Showing 2,090 of 2,090 total issues

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

                if (SelectBox.cache_contains(from, option_value)) {
                    SelectBox.add_to_cache(to, {value: option_value, text: option.text, displayed: 1});
                    SelectBox.delete_from_cache(from, option_value);
                }
Severity: Minor
Found in django/contrib/admin/static/admin/js/SelectBox.js and 1 other location - About 40 mins to fix
django/contrib/admin/static/admin/js/SelectBox.js on lines 75..78

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 48.

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

                const field = $(this),
                    input = field.find('input, select, textarea'),
                    dependency_list = input.data('dependency_list') || [],
                    dependencies = [];
Severity: Minor
Found in django/contrib/admin/static/admin/js/inlines.js and 1 other location - About 40 mins to fix
django/contrib/admin/static/admin/js/inlines.js on lines 240..243

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 48.

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 2 locations. Consider refactoring.
Open

        daysOfWeekInitial: [
            pgettext('one letter Sunday', 'S'),
            pgettext('one letter Monday', 'M'),
            pgettext('one letter Tuesday', 'T'),
            pgettext('one letter Wednesday', 'W'),
Severity: Minor
Found in django/contrib/admin/static/admin/js/calendar.js and 1 other location - About 40 mins to fix
django/contrib/admin/static/admin/js/calendar.js on lines 47..55

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 48.

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 (option.selected && SelectBox.cache_contains(from, option_value)) {
                    SelectBox.add_to_cache(to, {value: option_value, text: option.text, displayed: 1});
                    SelectBox.delete_from_cache(from, option_value);
                }
Severity: Minor
Found in django/contrib/admin/static/admin/js/SelectBox.js and 1 other location - About 40 mins to fix
django/contrib/admin/static/admin/js/SelectBox.js on lines 87..90

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 48.

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

                const field = $(this),
                    input = field.find('input, select, textarea'),
                    dependency_list = input.data('dependency_list') || [],
                    dependencies = [];
Severity: Minor
Found in django/contrib/admin/static/admin/js/inlines.js and 1 other location - About 40 mins to fix
django/contrib/admin/static/admin/js/inlines.js on lines 303..306

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 48.

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 2 locations. Consider refactoring.
Open

        daysOfWeekAbbrev: [
            pgettext('abbrev. day Sunday', 'Sun'),
            pgettext('abbrev. day Monday', 'Mon'),
            pgettext('abbrev. day Tuesday', 'Tue'),
            pgettext('abbrev. day Wednesday', 'Wed'),
Severity: Minor
Found in django/contrib/admin/static/admin/js/calendar.js and 1 other location - About 40 mins to fix
django/contrib/admin/static/admin/js/calendar.js on lines 56..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 48.

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

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

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

        def __init__(self, func, takes_context, args, kwargs, filename):
    Severity: Minor
    Found in django/template/library.py - About 35 mins to fix

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

          function updateRelatedSelectsOptions(currentSelect, win, objId, newRepr, newId) {
      Severity: Minor
      Found in django/contrib/admin/static/admin/js/admin/RelatedObjectLookups.js - About 35 mins to fix

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

                    const move_selection = function(e, elem, move_func, from, to) {
        Severity: Minor
        Found in django/contrib/admin/static/admin/js/SelectFilter2.js - About 35 mins to fix

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

              def _get_lines_from_file(
          Severity: Minor
          Found in django/views/debug.py - About 35 mins to fix

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

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

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

                  def __init__(self, nodelist, expire_time_var, fragment_name, vary_on, cache_name):
              Severity: Minor
              Found in django/templatetags/cache.py - About 35 mins to fix

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

                        draw: function(month, year, div_id, callback, selected) { // month = 1-12, year = 1-9999
                Severity: Minor
                Found in django/contrib/admin/static/admin/js/calendar.js - About 35 mins to fix

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

                      def __init__(self, func, takes_context, args, kwargs, target_var):
                  Severity: Minor
                  Found in django/template/library.py - About 35 mins to fix

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

                    def pbkdf2(password, salt, iterations, dklen=0, digest=None):
                    Severity: Minor
                    Found in django/utils/crypto.py - About 35 mins to fix

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

                          def __init__(self, *, length, replacement, convert_charrefs=True):
                      Severity: Minor
                      Found in django/utils/text.py - About 35 mins to fix

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

                        def timesince(d, now=None, reversed=False, time_strings=None, depth=2):
                        Severity: Minor
                        Found in django/utils/timesince.py - About 35 mins to fix

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

                          def technical_500_response(request, exc_type, exc_value, tb, status_code=500):
                          Severity: Minor
                          Found in django/views/debug.py - About 35 mins to fix

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

                                def __init__(
                            Severity: Minor
                            Found in django/http/response.py - About 35 mins to fix
                              Severity
                              Category
                              Status
                              Source
                              Language