Showing 95 of 177 total issues
Function updateHistogram
has 258 lines of code (exceeds 25 allowed). Consider refactoring. Open
function updateHistogram(rootEl, data, proposedPrice, showTransition) {
const width = 720;
const height = 300;
const pad = [120, 15, 60, 60];
const top = pad[0];
File models.py
has 454 lines of code (exceeds 250 allowed). Consider refactoring. Open
import bleach
import csv
from datetime import datetime
from decimal import Decimal
File views.py
has 452 lines of code (exceeds 250 allowed). Consider refactoring. Open
import bleach
import csv
from decimal import Decimal
from textwrap import dedent
Function command
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
def command(verbosity: int, testtype: List[str]) -> None:
'''
Test and lint everything!
Optionally specify one or more test names to run only those tests.
- 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
File histogram.jsx
has 405 lines of code (exceeds 250 allowed). Consider refactoring. Open
import PropTypes from 'prop-types';
import React from 'react';
import { connect } from 'react-redux';
import { select } from 'd3-selection';
File admin.py
has 399 lines of code (exceeds 250 allowed). Consider refactoring. Open
import os
import re
from django.contrib import admin
from django.http import HttpResponse, HttpResponseForbidden
from django.db import models, transaction
Function make_contract
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
def make_contract(cls, line, upload_source=None):
if line[0]:
# create contract record, unique to vendor, labor cat
idv_piid = line[11]
vendor_name = line[10]
- 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 get_contracts_queryset
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
def get_contracts_queryset(request_params, wage_field):
"""
Filters and returns contracts based on query params
Args:
- 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
File settings.py
has 367 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""
Django settings for calc project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
Function render
has 107 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const prefixId = name => `${this.props.idPrefix}${name}`;
return (
<form
Function handle_cancel
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def handle_cancel(*args, redirect_name='index', key_prefix='data_capture:'):
'''
Decorator to handle cancel behavior in Data Capture flows.
The associated request's POST data is checked for a 'cancel' key,
and, if found, all session keys that start with `key_prefix`
- 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 attachedCallback
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
attachedCallback() {
const $el = $(this);
const $input = $('input', $el);
if ($input.length !== 1 || $input.attr('is') !== 'upload-input') {
Function render
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { levels, idPrefix } = this.props;
const inputs = Object.keys(EDU_LABELS).map((value) => {
const id = idPrefix + value;
return (
File price_list_upload.py
has 295 lines of code (exceeds 250 allowed). Consider refactoring. Open
import json
from django.views.decorators.http import require_http_methods
from django.shortcuts import redirect, render
from django.template.loader import render_to_string
Function updateHistogram
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
function updateHistogram(rootEl, data, proposedPrice, showTransition) {
const width = 720;
const height = 300;
const pad = [120, 15, 60, 60];
const top = pad[0];
- 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
File models.py
has 277 lines of code (exceeds 250 allowed). Consider refactoring. Open
import hashlib
import logging
from django.db import models
from django.contrib.auth.models import User
Function entrypoint
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def entrypoint(argv): # type: (List[str]) -> None
'''
This is a Docker entrypoint that configures the container to run
as the same uid of the user on the host container, rather than
the Docker default of root. Aside from following security best
- 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 multi_phrase_search
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def multi_phrase_search(self, query, query_by=None, *args, **kwargs):
"""
Given a query as string, runs it through clean_search to get a list of search terms,
then returns a matching queryset of Contract objects for each of those terms.
- 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
File styleguide.py
has 270 lines of code (exceeds 250 allowed). Consider refactoring. Open
import os.path
from html.parser import HTMLParser
from textwrap import dedent
from inspect import getsourcefile
from importlib import import_module
Function render
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const [min, max] = this.state.sliderVal;
const rangeId = `${this.props.idPrefix}range`;
const minId = `${this.props.idPrefix}min`;