kiwitcms/Kiwi

View on GitHub

Showing 262 of 405 total issues

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

            if ($('#id_before').val()) {
                params.created_at__lte = $('#id_before').data('DateTimePicker').date().format('YYYY-MM-DD 23:59:59')
            }
Severity: Major
Found in tcms/bugs/static/bugs/js/search.js and 13 other locations - About 1 hr to fix
tcms/bugs/static/bugs/js/search.js on lines 47..49
tcms/testcases/static/testcases/js/search.js on lines 76..78
tcms/testcases/static/testcases/js/search.js on lines 80..82
tcms/testplans/static/testplans/js/search.js on lines 61..63
tcms/testplans/static/testplans/js/search.js on lines 65..67
tcms/testruns/static/testruns/js/search.js on lines 69..71
tcms/testruns/static/testruns/js/search.js on lines 73..75
tcms/testruns/static/testruns/js/search.js on lines 77..79
tcms/testruns/static/testruns/js/search.js on lines 81..83
tcms/testruns/static/testruns/js/search.js on lines 85..87
tcms/testruns/static/testruns/js/search.js on lines 89..91
tcms/testruns/static/testruns/js/search.js on lines 93..95
tcms/testruns/static/testruns/js/search.js on lines 97..99

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

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

            if ($('#id_before_start_date').val()) {
                params.start_date__lte = $('#id_before_start_date').data('DateTimePicker').date().format('YYYY-MM-DD 23:59:59')
            }
Severity: Major
Found in tcms/testruns/static/testruns/js/search.js and 13 other locations - About 1 hr to fix
tcms/bugs/static/bugs/js/search.js on lines 43..45
tcms/bugs/static/bugs/js/search.js on lines 47..49
tcms/testcases/static/testcases/js/search.js on lines 76..78
tcms/testcases/static/testcases/js/search.js on lines 80..82
tcms/testplans/static/testplans/js/search.js on lines 61..63
tcms/testplans/static/testplans/js/search.js on lines 65..67
tcms/testruns/static/testruns/js/search.js on lines 69..71
tcms/testruns/static/testruns/js/search.js on lines 77..79
tcms/testruns/static/testruns/js/search.js on lines 81..83
tcms/testruns/static/testruns/js/search.js on lines 85..87
tcms/testruns/static/testruns/js/search.js on lines 89..91
tcms/testruns/static/testruns/js/search.js on lines 93..95
tcms/testruns/static/testruns/js/search.js on lines 97..99

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

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

            if ($('#id_before_planned_start').val()) {
                params.planned_start__lte = $('#id_before_planned_start').data('DateTimePicker').date().format('YYYY-MM-DD 23:59:59')
            }
Severity: Major
Found in tcms/testruns/static/testruns/js/search.js and 13 other locations - About 1 hr to fix
tcms/bugs/static/bugs/js/search.js on lines 43..45
tcms/bugs/static/bugs/js/search.js on lines 47..49
tcms/testcases/static/testcases/js/search.js on lines 76..78
tcms/testcases/static/testcases/js/search.js on lines 80..82
tcms/testplans/static/testplans/js/search.js on lines 61..63
tcms/testplans/static/testplans/js/search.js on lines 65..67
tcms/testruns/static/testruns/js/search.js on lines 69..71
tcms/testruns/static/testruns/js/search.js on lines 73..75
tcms/testruns/static/testruns/js/search.js on lines 77..79
tcms/testruns/static/testruns/js/search.js on lines 81..83
tcms/testruns/static/testruns/js/search.js on lines 85..87
tcms/testruns/static/testruns/js/search.js on lines 93..95
tcms/testruns/static/testruns/js/search.js on lines 97..99

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

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

            if ($('#id_after_planned_start').val()) {
                params.planned_start__gte = $('#id_after_planned_start').data('DateTimePicker').date().format('YYYY-MM-DD 00:00:00')
            }
Severity: Major
Found in tcms/testruns/static/testruns/js/search.js and 13 other locations - About 1 hr to fix
tcms/bugs/static/bugs/js/search.js on lines 43..45
tcms/bugs/static/bugs/js/search.js on lines 47..49
tcms/testcases/static/testcases/js/search.js on lines 76..78
tcms/testcases/static/testcases/js/search.js on lines 80..82
tcms/testplans/static/testplans/js/search.js on lines 61..63
tcms/testplans/static/testplans/js/search.js on lines 65..67
tcms/testruns/static/testruns/js/search.js on lines 69..71
tcms/testruns/static/testruns/js/search.js on lines 73..75
tcms/testruns/static/testruns/js/search.js on lines 77..79
tcms/testruns/static/testruns/js/search.js on lines 81..83
tcms/testruns/static/testruns/js/search.js on lines 89..91
tcms/testruns/static/testruns/js/search.js on lines 93..95
tcms/testruns/static/testruns/js/search.js on lines 97..99

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

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

            if ($('#id_before_planned_stop').val()) {
                params.planned_stop__lte = $('#id_before_planned_stop').data('DateTimePicker').date().format('YYYY-MM-DD 23:59:59')
            }
Severity: Major
Found in tcms/testruns/static/testruns/js/search.js and 13 other locations - About 1 hr to fix
tcms/bugs/static/bugs/js/search.js on lines 43..45
tcms/bugs/static/bugs/js/search.js on lines 47..49
tcms/testcases/static/testcases/js/search.js on lines 76..78
tcms/testcases/static/testcases/js/search.js on lines 80..82
tcms/testplans/static/testplans/js/search.js on lines 61..63
tcms/testplans/static/testplans/js/search.js on lines 65..67
tcms/testruns/static/testruns/js/search.js on lines 69..71
tcms/testruns/static/testruns/js/search.js on lines 73..75
tcms/testruns/static/testruns/js/search.js on lines 77..79
tcms/testruns/static/testruns/js/search.js on lines 81..83
tcms/testruns/static/testruns/js/search.js on lines 85..87
tcms/testruns/static/testruns/js/search.js on lines 89..91
tcms/testruns/static/testruns/js/search.js on lines 93..95

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

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

            if ($('#id_before_stop_date').val()) {
                params.stop_date__lte = $('#id_before_stop_date').data('DateTimePicker').date().format('YYYY-MM-DD 23:59:59')
            }
Severity: Major
Found in tcms/testruns/static/testruns/js/search.js and 13 other locations - About 1 hr to fix
tcms/bugs/static/bugs/js/search.js on lines 43..45
tcms/bugs/static/bugs/js/search.js on lines 47..49
tcms/testcases/static/testcases/js/search.js on lines 76..78
tcms/testcases/static/testcases/js/search.js on lines 80..82
tcms/testplans/static/testplans/js/search.js on lines 61..63
tcms/testplans/static/testplans/js/search.js on lines 65..67
tcms/testruns/static/testruns/js/search.js on lines 69..71
tcms/testruns/static/testruns/js/search.js on lines 73..75
tcms/testruns/static/testruns/js/search.js on lines 77..79
tcms/testruns/static/testruns/js/search.js on lines 85..87
tcms/testruns/static/testruns/js/search.js on lines 89..91
tcms/testruns/static/testruns/js/search.js on lines 93..95
tcms/testruns/static/testruns/js/search.js on lines 97..99

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

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

            if ($('#id_after_planned_stop').val()) {
                params.planned_stop__gte = $('#id_after_planned_stop').data('DateTimePicker').date().format('YYYY-MM-DD 00:00:00')
            }
Severity: Major
Found in tcms/testruns/static/testruns/js/search.js and 13 other locations - About 1 hr to fix
tcms/bugs/static/bugs/js/search.js on lines 43..45
tcms/bugs/static/bugs/js/search.js on lines 47..49
tcms/testcases/static/testcases/js/search.js on lines 76..78
tcms/testcases/static/testcases/js/search.js on lines 80..82
tcms/testplans/static/testplans/js/search.js on lines 61..63
tcms/testplans/static/testplans/js/search.js on lines 65..67
tcms/testruns/static/testruns/js/search.js on lines 69..71
tcms/testruns/static/testruns/js/search.js on lines 73..75
tcms/testruns/static/testruns/js/search.js on lines 77..79
tcms/testruns/static/testruns/js/search.js on lines 81..83
tcms/testruns/static/testruns/js/search.js on lines 85..87
tcms/testruns/static/testruns/js/search.js on lines 89..91
tcms/testruns/static/testruns/js/search.js on lines 97..99

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

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

            if ($('#id_after').val()) {
                params.created_at__gte = $('#id_after').data('DateTimePicker').date().format('YYYY-MM-DD 00:00:00')
            }
Severity: Major
Found in tcms/bugs/static/bugs/js/search.js and 13 other locations - About 1 hr to fix
tcms/bugs/static/bugs/js/search.js on lines 43..45
tcms/testcases/static/testcases/js/search.js on lines 76..78
tcms/testcases/static/testcases/js/search.js on lines 80..82
tcms/testplans/static/testplans/js/search.js on lines 61..63
tcms/testplans/static/testplans/js/search.js on lines 65..67
tcms/testruns/static/testruns/js/search.js on lines 69..71
tcms/testruns/static/testruns/js/search.js on lines 73..75
tcms/testruns/static/testruns/js/search.js on lines 77..79
tcms/testruns/static/testruns/js/search.js on lines 81..83
tcms/testruns/static/testruns/js/search.js on lines 85..87
tcms/testruns/static/testruns/js/search.js on lines 89..91
tcms/testruns/static/testruns/js/search.js on lines 93..95
tcms/testruns/static/testruns/js/search.js on lines 97..99

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

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

            if ($('#id_after_start_date').val()) {
                params.start_date__gte = $('#id_after_start_date').data('DateTimePicker').date().format('YYYY-MM-DD 00:00:00')
            }
Severity: Major
Found in tcms/testruns/static/testruns/js/search.js and 13 other locations - About 1 hr to fix
tcms/bugs/static/bugs/js/search.js on lines 43..45
tcms/bugs/static/bugs/js/search.js on lines 47..49
tcms/testcases/static/testcases/js/search.js on lines 76..78
tcms/testcases/static/testcases/js/search.js on lines 80..82
tcms/testplans/static/testplans/js/search.js on lines 61..63
tcms/testplans/static/testplans/js/search.js on lines 65..67
tcms/testruns/static/testruns/js/search.js on lines 73..75
tcms/testruns/static/testruns/js/search.js on lines 77..79
tcms/testruns/static/testruns/js/search.js on lines 81..83
tcms/testruns/static/testruns/js/search.js on lines 85..87
tcms/testruns/static/testruns/js/search.js on lines 89..91
tcms/testruns/static/testruns/js/search.js on lines 93..95
tcms/testruns/static/testruns/js/search.js on lines 97..99

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

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

            if ($('#id_after_stop_date').val()) {
                params.stop_date__gte = $('#id_after_stop_date').data('DateTimePicker').date().format('YYYY-MM-DD 00:00:00')
            }
Severity: Major
Found in tcms/testruns/static/testruns/js/search.js and 13 other locations - About 1 hr to fix
tcms/bugs/static/bugs/js/search.js on lines 43..45
tcms/bugs/static/bugs/js/search.js on lines 47..49
tcms/testcases/static/testcases/js/search.js on lines 76..78
tcms/testcases/static/testcases/js/search.js on lines 80..82
tcms/testplans/static/testplans/js/search.js on lines 61..63
tcms/testplans/static/testplans/js/search.js on lines 65..67
tcms/testruns/static/testruns/js/search.js on lines 69..71
tcms/testruns/static/testruns/js/search.js on lines 73..75
tcms/testruns/static/testruns/js/search.js on lines 81..83
tcms/testruns/static/testruns/js/search.js on lines 85..87
tcms/testruns/static/testruns/js/search.js on lines 89..91
tcms/testruns/static/testruns/js/search.js on lines 93..95
tcms/testruns/static/testruns/js/search.js on lines 97..99

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

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 jsonRPC has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function jsonRPC (rpcMethod, rpcParams, callback, isSync) {
    // .filter() args are passed as dictionary but other args,
    // e.g. for .add_tag() are passed as a list of positional values
    if (!Array.isArray(rpcParams)) {
        rpcParams = [rpcParams]
Severity: Minor
Found in tcms/static/js/jsonrpc.js - About 1 hr to fix

    Function clone has 8 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def clone(  # pylint: disable=too-many-arguments
    Severity: Major
    Found in tcms/testplans/models.py - About 1 hr to fix

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

          $('#btn-search-cases').click(function () {
              return advancedSearchAndAddTestCases(
                  testRunId, 'TestRun.add_case', $(this).attr('href'),
                  $('#test_run_pk').data('trans-error-adding-cases')
              )
      Severity: Minor
      Found in tcms/testruns/static/testruns/js/get.js and 1 other location - About 55 mins to fix
      tcms/testplans/static/testplans/js/get.js on lines 62..67

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

      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

          $('#btn-search-cases').click(function () {
              return advancedSearchAndAddTestCases(
                  testPlanId, 'TestPlan.add_case', $(this).attr('href'),
                  $('#test_plan_pk').data('trans-error-adding-cases')
              )
      Severity: Minor
      Found in tcms/testplans/static/testplans/js/get.js and 1 other location - About 55 mins to fix
      tcms/testruns/static/testruns/js/get.js on lines 175..180

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

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

      @permissions_required("testruns.delete_environmentproperty")
      @rpc_method(name="Environment.remove_property")
      def remove_property(query):
          """
          .. function:: Environment.remove_property(query)
      Severity: Major
      Found in tcms/rpc/api/environment.py and 4 other locations - About 55 mins to fix
      tcms/rpc/api/testcase.py on lines 576..588
      tcms/rpc/api/testexecution.py on lines 274..286
      tcms/rpc/api/testexecution.py on lines 341..353
      tcms/bugs/api.py on lines 59..71

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

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

      @permissions_required("testcases.delete_property")
      @rpc_method(name="TestCase.remove_property")
      def remove_property(query):
          """
          .. function:: TestCase.remove_property(query)
      Severity: Major
      Found in tcms/rpc/api/testcase.py and 4 other locations - About 55 mins to fix
      tcms/rpc/api/environment.py on lines 41..53
      tcms/rpc/api/testexecution.py on lines 274..286
      tcms/rpc/api/testexecution.py on lines 341..353
      tcms/bugs/api.py on lines 59..71

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

      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

          $('.change-assignee-bulk').click(function () {
              $(this).parents('.dropdown').toggleClass('open')
              changeAssigneeBulk()
      
              return false
      Severity: Minor
      Found in tcms/testruns/static/testruns/js/get.js and 1 other location - About 50 mins to fix
      tcms/testruns/static/testruns/js/get.js on lines 126..131

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

      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

                  {
                      data: null,
                      render: function (data, type, full, meta) {
                          return '<a href="/case/' + data.id + '/" target="_parent">' + escapeHTML(data.summary) + '</a>'
                      }
      Severity: Major
      Found in tcms/testcases/static/testcases/js/search.js and 3 other locations - About 50 mins to fix
      tcms/bugs/static/bugs/js/search.js on lines 67..72
      tcms/telemetry/static/telemetry/js/testing/execution-dashboard.js on lines 75..80
      tcms/testcases/static/testcases/js/get.js on lines 181..186

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

      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

                  {
                      data: null,
                      render: function (data, type, full, meta) {
                          return '<a href="/bugs/' + data.pk + '/" target="_parent">' + escapeHTML(data.summary) + '</a>'
                      }
      Severity: Major
      Found in tcms/bugs/static/bugs/js/search.js and 3 other locations - About 50 mins to fix
      tcms/telemetry/static/telemetry/js/testing/execution-dashboard.js on lines 75..80
      tcms/testcases/static/testcases/js/get.js on lines 181..186
      tcms/testcases/static/testcases/js/search.js on lines 151..156

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

      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

          $('.update-case-text-bulk').click(function () {
              $(this).parents('.dropdown').toggleClass('open')
              updateCaseText()
      
              return false
      Severity: Minor
      Found in tcms/testruns/static/testruns/js/get.js and 1 other location - About 50 mins to fix
      tcms/testruns/static/testruns/js/get.js on lines 119..124

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

      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

      Severity
      Category
      Status
      Source
      Language