kiwitcms/Kiwi

View on GitHub

Showing 101 of 392 total issues

File get.js has 686 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

      File testcase.py has 506 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      # -*- coding: utf-8 -*-
      
      from datetime import timedelta
      
      from django.db.models.functions import Coalesce
      Severity: Major
      Found in tcms/rpc/api/testcase.py - About 1 day to fix

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

        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/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..35

        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 164 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

            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

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

            export function pageTestcasesSearchReadyHandler () {
                const table = $('#resultsTable').DataTable({
                    pageLength: $('#navbar').data('defaultpagesize'),
                    ajax: function (data, callbackF, settings) {
                        const params = {}
            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

              @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 74..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 86.

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

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

              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 pageTestcasesGetReadyHandler has 113 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

                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 571..596

                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

                            components.forEach(function (element) {
                                if (componentsPerCase[element.cases] === undefined) {
                                    componentsPerCase[element.cases] = []
                                }
                
                
                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 17..26
                tcms/testplans/static/testplans/js/search.js on lines 17..26

                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 31..40
                tcms/testplans/static/testplans/js/search.js on lines 17..26

                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 (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 17..26
                tcms/testcases/static/testcases/js/search.js on lines 31..40

                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

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

                export function pageTestrunsSearchReadyHandler () {
                    const table = $('#resultsTable').DataTable({
                        pageLength: $('#navbar').data('defaultpagesize'),
                        ajax: function (data, callbackF, settings) {
                            const params = {}
                Severity: Major
                Found in tcms/testruns/static/testruns/js/search.js - About 3 hrs to fix
                  Severity
                  Category
                  Status
                  Source
                  Language