Showing 21 of 96 total issues
File views.py
has 597 lines of code (exceeds 250 allowed). Consider refactoring. Open
import re
from datetime import datetime, timezone, timedelta
from django.db.models import Q
from ipware.ip import get_ip
Function renderRunDetailChart
has 108 lines of code (exceeds 25 allowed). Consider refactoring. Open
function renderRunDetailChart() {
if (window.app.runList === undefined
|| window.app.summaryInfo === undefined
|| window.app.summaryInfo.result_total === 0) {
loadingCompleted();
Function renderResultDetailChart
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
function renderResultDetailChart(callback) {
if (window.app.resultHistory === undefined
|| window.app.summaryInfo === undefined) {
loadingCompleted();
return;
File chart-support.js
has 261 lines of code (exceeds 250 allowed). Consider refactoring. Open
define(['moment', 'c3', 'd3', './utils'], function (moment, c3, d3, utils) {
"use strict";
let config = {};
Function handler
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def handler(self, request, pk=None):
"""
Handle single reset result.
1. update current reset result with provided info.
2. create error object if required.
- 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 resultDetailSummaryPostEvent
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
function resultDetailSummaryPostEvent(data) {
if (data[0] === undefined) return;
let result = data[0];
let stderr = "Nothing found.";
let stdout = "Nothing found.";
Function runDetailSummaryPostEvent
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
function runDetailSummaryPostEvent(data) {
if (data[0] === undefined) return;
let run = data[0];
let nav = `${run.id} - ${run.name}`;
Function renderRunCoverageChart
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
function renderRunCoverageChart(runId, callback) {
require(['jquery'], function ($) {
$.getJSON('/api/runs/' + runId + '/tags/', function (data) {
let counts = ['counts'];
let tags = [];
Function start
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def start(self, request):
"""client api to start a run, `example` as reference."""
example = {
'name': 'your run name',
'owner': 'run owner, default => current user',
- 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 caseTagsEvent
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function caseTagsEvent(id) {
function tagsAction(event, data) {
$.ajax({
url: '/api/cases/' + id + '/tags/',
type: 'post',
Function result_reset
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def result_reset(request, result_id):
"""POST view for result reset"""
result_id = int(result_id)
if request.method == 'POST':
- 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 result_analysis
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def result_analysis(request, result_id):
"""POST view for result analysis"""
result_id = int(result_id)
if request.method == 'POST':
- 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 save
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def save(self, result_id, username):
"""
to save the analysis form, we will:
1. create analysis object then link to result id
2. create issue object if issue id was added
- 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 signin
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def signin(request):
if request.user.is_authenticated:
return to_next_page(request)
if request.method == 'POST':
- 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 clear
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def clear(self, request):
"""clear dead runs, will be called async when user visit run list."""
pending_runs = TestRun.objects.filter(state__lt=2) # not ready, starting, running
fixed = []
- 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 register
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def register(request):
"""To register a new client, must provide a token"""
if request.method == 'POST':
data = request.POST
client_type = data.get('client_type')
- 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 tags
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def tags(self, request, pk=None):
"""query result tags"""
from tagging.models import Tag
instance = self.get_object()
- 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 new
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def new(self, request):
"""client api to reset a result, `example` as reference."""
example = {
'reset_id': 123,
'outcome': 'int, 0=passed, 1=failed, 2=skipped, 3=error, 5=pending',
- 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 new
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def new(self, request):
"""client api to create a result, `example` as reference"""
example = {
'run_id': 123,
'outcome': 'int, 0=passed, 1=failed, 2=skipped, 3=error, 5=pending',
- 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 stop
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def stop(self, request):
"""client api to stop a run, `example` as reference."""
example = {
'run_id': 123,
'state': 'int, default 3=>completed, (2=aborted)',
- 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"