Showing 112 of 403 total issues
File get.js
has 727 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 {
File get.js
has 520 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { jsonRPC } from '../../../../static/js/jsonrpc'
import { tagsCard } from '../../../../static/js/tags'
import {
animate,
advancedSearchAndAddTestCases,
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
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'
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')
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({
File utils.js
has 378 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { jsonRPC } from './jsonrpc'
/*
Used to update a select when something else changes.
*/
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')
- Read upRead up
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')
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'
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({
- Read upRead up
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')
File testrun.py
has 335 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
File types.py
has 332 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!
"""
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 }
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 = {}
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')
- Read upRead up
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)
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({
Function drawTable
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function drawTable () {
$('.js-spinner').show()
if (table) {
table.destroy()