Showing 95 of 177 total issues
Function matches
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def matches(self, value):
normval = self.normalize(value)
if self.normalize(self.canonical_name) == normval:
return True
for alt in self.alternatives:
- 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 createButtonText
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
createButtonText() {
const { selectedSchedule, queryBy } = this.props;
let searchSummary;
if (queryBy === QUERY_BY_SCHEDULE) {
const allSchedsLabel = `${Object.keys(scheduleLabels).length} contract vehicles`;
Function render
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
return (
<div className="html-dropdown">
<button
type="button"
Function makeInput
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
const makeInput = (value, label) => {
const id = value.replace(/ /g, '-').toLowerCase() || 'all-schedules';
const makeLabel = (title) => {
let scheduleLabel = title;
let labelSuffix;
Function render
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const id = `${this.props.idPrefix}results-table`;
const idHref = `#${id}`;
return (
Function describe
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def describe(cursor, vocab, labor_category, min_years_experience,
Function render
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
// Note that Chrome has issues with number input, so we're just
// going to use a standard text field here. This is unfortunate for
// mobile users, since they won't get a numeric keypad.
//
Function describe
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def describe(cursor, vocab, labor_category, min_years_experience,
education_level, price, severe_stddevs=2,
min_comparables=DEFAULT_MIN_COMPARABLES,
cache=None):
if cache is None:
- 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 step_1
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def step_1(request, step):
if request.method == 'GET':
form = forms.Step1Form(data=get_nested_item(
request.session,
(SESSION_KEY, 'step_1_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 listItem
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
const listItem = (year) => {
const { className, shortLabel, idSuffix } = YEAR_LI_INFO[year];
const id = `${idPrefix}${idSuffix}`;
return (
Function render
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const id = `${this.props.idPrefix}labor_category`;
let placeholder = "Type a labor category";
if (this.props.queryBy === QUERY_BY_CONTRACT) {
Function appendHighlightedTerm
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function appendHighlightedTerm($el, term, searchStr) {
const sanitizedSearch = searchStr.replace(/[^a-z0-9 ]/gi, '')
.trim()
.split(/[ ]+/)
.join('|');
Function price_list_details
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def price_list_details(request, id):
'''
This view shows all the details of a SubmittedPriceList model.
Note that any logged-in user with the PRICE_LIST_UPLOAD_PERMISSION (so
Contract Officers and above) can view the page for ANY SubmittedPriceList,
- 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 head_meta
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def head_meta(context, *args, **kwargs):
"""
Outputs an array of tags in the head for search engines and social media outlets
including relevant icon and image meta tags.
- 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 find_comparable_contracts
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def find_comparable_contracts(cursor, vocab, labor_category,
Function log_m2m_change
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def log_m2m_change(sender, instance, action, reverse, model, pk_set, **kwargs):
Function glean_labor_categories_from_book
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def glean_labor_categories_from_book(book, sheet_name=DEFAULT_SHEET_NAME):
if sheet_name not in book.sheet_names():
raise ValidationError(
'There is no sheet in the workbook called "%s".' % sheet_name
)
- 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 generate_column_index_map
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def generate_column_index_map(heading_row, field_title_map):
def find_col(col_title):
for idx, cell in enumerate(heading_row):
if col_title.matches(cell.value):
return idx
- 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 replace_step_1
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def replace_step_1(request, id, step):
price_list = price_list = get_object_or_404(SubmittedPriceList, pk=id)
schedule_class = registry.get_class(price_list.schedule)
if request.method == 'GET':
- 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 __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, attrs=None, degraded=False, required=True,