kiwitcms/Kiwi

View on GitHub

Showing 104 of 405 total issues

File get.js has 720 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { fetchBugDetails } from '../../../../static/js/bugs'
import { jsonRPC } from '../../../../static/js/jsonrpc'
import { propertiesCard } from '../../../../static/js/properties'
import { tagsCard } from '../../../../static/js/tags'
import {
Severity: Major
Found in tcms/testruns/static/testruns/js/get.js - About 1 day to fix

    File get.js has 517 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import { jsonRPC } from '../../../../static/js/jsonrpc'
    import { tagsCard } from '../../../../static/js/tags'
    import {
        animate,
        advancedSearchAndAddTestCases,
    Severity: Major
    Found in tcms/testplans/static/testplans/js/get.js - About 1 day to fix

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

      Severity: Major
      Found in tcms/testruns/migrations/0016_testexecutionproperty.py and 1 other location - About 7 hrs to fix
      tcms/testcases/migrations/0021_add_property_model.py on lines 0..34

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

      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

      Severity: Major
      Found in tcms/testcases/migrations/0021_add_property_model.py and 1 other location - About 7 hrs to fix
      tcms/testruns/migrations/0016_testexecutionproperty.py on lines 0..34

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

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

      export function pageTestrunsGetReadyHandler () {
          permissions.removeTag = $('#test_run_pk').data('perm-remove-tag') === 'True'
          permissions.addComment = $('#test_run_pk').data('perm-add-comment') === 'True'
          permissions.removeComment = $('#test_run_pk').data('perm-remove-comment') === 'True'
      
      
      Severity: Major
      Found in tcms/testruns/static/testruns/js/get.js - About 6 hrs to fix

        Function toolbarEvents has 154 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function toolbarEvents (testPlanId, permissions) {
            $('.js-checkbox-toolbar').click(function (ev) {
                const isChecked = ev.target.checked
                const testCaseRows = $('.js-testcase-row').find('input')
        
        
        Severity: Major
        Found in tcms/testplans/static/testplans/js/get.js - About 6 hrs to fix

          Function pageTestcasesSearchReadyHandler has 144 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export function pageTestcasesSearchReadyHandler () {
              initializeDateTimePicker('#id_before')
              initializeDateTimePicker('#id_after')
          
              const table = $('#resultsTable').DataTable({
          Severity: Major
          Found in tcms/testcases/static/testcases/js/search.js - About 5 hrs to fix

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

                $('#bulk-reviewer-button').click(function (ev) {
                    $(this).parents('.dropdown').toggleClass('open')
                    const selectedCases = getSelectedTestCases()
            
                    if (!selectedCases.length) {
            Severity: Major
            Found in tcms/testplans/static/testplans/js/get.js and 1 other location - About 5 hrs to fix
            tcms/testplans/static/testplans/js/get.js on lines 542..561

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

            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

                $('#default-tester-button').click(function (ev) {
                    $(this).parents('.dropdown').toggleClass('open')
                    const selectedCases = getSelectedTestCases()
            
                    if (!selectedCases.length) {
            Severity: Major
            Found in tcms/testplans/static/testplans/js/get.js and 1 other location - About 5 hrs to fix
            tcms/testplans/static/testplans/js/get.js on lines 563..582

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

            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

            Severity: Major
            Found in tcms/telemetry/urls.py and 1 other location - About 5 hrs to fix
            tcms/bugs/urls.py on lines 0..14

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

            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

            @permissions_required("management.change_build")
            @rpc_method(name="Build.update")
            def update(build_id, values):
                """
                .. function:: RPC Build.update(build_id, values)
            Severity: Major
            Found in tcms/rpc/api/build.py and 1 other location - About 5 hrs to fix
            tcms/rpc/api/component.py on lines 84..108

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

            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

            @permissions_required("management.change_component")
            @rpc_method(name="Component.update")
            def update(component_id, values):
                """
                .. function:: RPC Component.update
            Severity: Major
            Found in tcms/rpc/api/component.py and 1 other location - About 5 hrs to fix
            tcms/rpc/api/build.py on lines 67..92

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

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

            export function pageTestplansSearchReadyHandler () {
                initializeDateTimePicker('#id_before')
                initializeDateTimePicker('#id_after')
            
                const rowsNotShownMessage = $('#main-element').data('trans-some-rows-not-shown')
            Severity: Major
            Found in tcms/testplans/static/testplans/js/search.js - About 4 hrs to fix

              Function pageTestcasesGetReadyHandler has 115 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export function pageTestcasesGetReadyHandler () {
                  const caseId = $('#test_case_pk').data('pk')
                  const productId = $('#product_pk').data('pk')
                  const permRemoveTag = $('#test_case_pk').data('perm-remove-tag') === 'True'
                  const permRemoveComponent = $('#test_case_pk').data('perm-remove-component') === 'True'
              Severity: Major
              Found in tcms/testcases/static/testcases/js/get.js - About 4 hrs to fix

                Function pageTestrunsSearchReadyHandler has 107 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export function pageTestrunsSearchReadyHandler () {
                    initializeDateTimePicker('#id_before_start_date')
                    initializeDateTimePicker('#id_after_start_date')
                    initializeDateTimePicker('#id_before_stop_date')
                    initializeDateTimePicker('#id_after_stop_date')
                Severity: Major
                Found in tcms/testruns/static/testruns/js/search.js - About 4 hrs to fix

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

                      $('.js-toolbar-status').click(function (ev) {
                          $(this).parents('.dropdown').toggleClass('open')
                          const selectedCases = getSelectedTestCases()
                  
                          if (!selectedCases.length) {
                  Severity: Major
                  Found in tcms/testplans/static/testplans/js/get.js and 1 other location - About 4 hrs to fix
                  tcms/testplans/static/testplans/js/get.js on lines 513..526

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

                  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

                      $('.js-toolbar-priority').click(function (ev) {
                          $(this).parents('.dropdown').toggleClass('open')
                          const selectedCases = getSelectedTestCases()
                  
                          if (!selectedCases.length) {
                  Severity: Major
                  Found in tcms/testplans/static/testplans/js/get.js and 1 other location - About 4 hrs to fix
                  tcms/testplans/static/testplans/js/get.js on lines 528..540

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

                  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

                  @permissions_required("testruns.view_environmentproperty")
                  @rpc_method(name="Environment.properties")
                  def properties(query=None):
                      """
                      .. function:: Environment.properties(query)
                  Severity: Major
                  Found in tcms/rpc/api/environment.py and 1 other location - About 4 hrs to fix
                  tcms/rpc/api/testcase.py on lines 546..571

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

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

                          tags.forEach(function (element) {
                              if (tagsPerPlan[element.plan] === undefined) {
                                  tagsPerPlan[element.plan] = []
                              }
                  
                  
                  Severity: Major
                  Found in tcms/testplans/static/testplans/js/search.js and 2 other locations - About 3 hrs to fix
                  tcms/testcases/static/testcases/js/search.js on lines 18..27
                  tcms/testcases/static/testcases/js/search.js on lines 32..41

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

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

                          tags.forEach(function (element) {
                              if (tagsPerCase[element.case] === undefined) {
                                  tagsPerCase[element.case] = []
                              }
                  
                  
                  Severity: Major
                  Found in tcms/testcases/static/testcases/js/search.js and 2 other locations - About 3 hrs to fix
                  tcms/testcases/static/testcases/js/search.js on lines 32..41
                  tcms/testplans/static/testplans/js/search.js on lines 23..32

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

                  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