kiwitcms/Kiwi

View on GitHub

Showing 109 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

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

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

        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

              Function pageTestrunsSearchReadyHandler has a Cognitive Complexity of 32 (exceeds 5 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: Minor
              Found in tcms/testruns/static/testruns/js/search.js - About 4 hrs to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              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 pageTestcasesSearchReadyHandler has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
                  Open

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

                  Cognitive Complexity

                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                  A method's cognitive complexity is based on a few simple rules:

                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                  • Code is considered more complex for each "break in the linear flow of the code"
                  • Code is considered more complex when "flow breaking structures are nested"

                  Further reading

                  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

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

                    function renderAdditionalInformation (testRunId, execution) {
                        let linksQuery = { execution__run: testRunId }
                        let casesQuery = { executions__run: testRunId }
                        let componentQ = { cases__executions__run: testRunId }
                        let tagsQ = { case__executions__run: testRunId }
                    Severity: Major
                    Found in tcms/testruns/static/testruns/js/get.js - About 3 hrs to fix

                      File utils.js has 328 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      import { jsonRPC } from './jsonrpc'
                      
                      /*
                          Used to update a select when something else changes.
                      */
                      Severity: Minor
                      Found in tcms/static/js/utils.js - About 3 hrs to fix

                        Function drawTable has 94 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export function drawTable () {
                            $('#resultsTable').DataTable({
                                pageLength: $('#navbar').data('defaultpagesize'),
                                ajax: function (data, callbackF, settings) {
                                    const query = {}
                        Severity: Major
                        Found in tcms/telemetry/static/telemetry/js/testing/execution-dashboard.js - About 3 hrs to fix

                          File testrun.py has 320 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          # -*- coding: utf-8 -*-
                          from django.forms.models import model_to_dict
                          from modernrpc.core import REQUEST_KEY, rpc_method
                          
                          from tcms.management.models import Tag
                          Severity: Minor
                          Found in tcms/rpc/api/testrun.py - About 3 hrs to fix

                            File types.py has 320 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            """
                                This module implements Kiwi TCMS interface to external issue tracking systems.
                                Refer to each implementor class for integration specifics!
                            """
                            
                            
                            Severity: Minor
                            Found in tcms/issuetracker/types.py - About 3 hrs to fix

                              Function pageTestplansSearchReadyHandler has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
                              Open

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

                              Cognitive Complexity

                              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                              A method's cognitive complexity is based on a few simple rules:

                              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                              • Code is considered more complex for each "break in the linear flow of the code"
                              • Code is considered more complex when "flow breaking structures are nested"

                              Further reading

                              Function getExpandArea has 87 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              function getExpandArea (testExecution) {
                                  const container = $(`.test-execution-${testExecution.id}`)
                              
                                  container.find('.test-execution-information .run-date').html(testExecution.stop_date || '-')
                                  container.find('.test-execution-information .build').html(testExecution.build__name)
                              Severity: Major
                              Found in tcms/testruns/static/testruns/js/get.js - About 3 hrs to fix

                                Function drawTable has 79 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                export function drawTable () {
                                    $('.js-spinner').show()
                                    if (table) {
                                        table.destroy()
                                
                                
                                Severity: Major
                                Found in tcms/telemetry/static/telemetry/js/testing/status-matrix.js - About 3 hrs to fix

                                  Function pageBugsSearchReadyHandler has 79 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  export function pageBugsSearchReadyHandler () {
                                      initializeDateTimePicker('#id_before')
                                      initializeDateTimePicker('#id_after')
                                  
                                      const table = $('#resultsTable').DataTable({
                                  Severity: Major
                                  Found in tcms/bugs/static/bugs/js/search.js - About 3 hrs to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language