Showing 95 of 177 total issues
Avoid deeply nested control flow statements. Open
if (el.checked) {
formData.append(el.name, el.value);
}
Function send_mail
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def send_mail(subject, to, template, ctx, reply_to=None):
Function broaden_query
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def broaden_query(cursor, vocab, query, cache, min_count):
Function get_best_permutations
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_best_permutations(vocab, lexemes, min_count=1, min_length=4,
Function attachedCallback
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
attachedCallback() {
if ('isUpgraded' in this) {
// We've already been attached.
return;
}
- 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 getCustomMessage
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function getCustomMessage(type, validity) {
if (validity.typeMismatch) {
return ERROR_MESSAGES[`${type}Mismatch`];
} else {
for (const invalidKey in ERROR_MESSAGES) { // eslint-disable-line no-restricted-syntax
- 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 glean_labor_categories_from_book
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def glean_labor_categories_from_book(book, sheet_name=DEFAULT_SHEET_NAME):
# TODO: This should be DRY'd out a bit since it is extremely similar
# to the s70.py function of the same name.
if sheet_name not in book.sheet_names():
- 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 _create_contract_batches
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _create_contract_batches(upload_source, batch_size=5000, rows=None):
if rows is None:
r10_file = ContentFile(upload_source.original_file)
converter = Region10SpreadsheetConverter(r10_file)
rows = converter.convert_next()
- 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 update_price_fields
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def update_price_fields(self):
'''
Set current, next, and second year price fields based on this
contract's contract_year.
'''
- 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 command
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def command(user_file, groupname, dryrun):
'''
Bulk creates users from email addresses in the the specified text file,
which should contain one email address per line.
If the optional "--group <GROUPNAME>" argument is specified, then all the
- 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 glean_labor_categories_from_book
has a Cognitive Complexity of 7 (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 glean_labor_categories_from_book
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def glean_labor_categories_from_book(book, sheet_name=DEFAULT_SHEET_NAME):
# TODO: This should be DRY'd out a bit since it is extremely similar
# to the s70.py function of the same name.
if sheet_name not in book.sheet_names():
- 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 glean_labor_categories_from_book
has a Cognitive Complexity of 7 (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 step_2
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def step_2(request, step):
# Redirect back to step 1 if we don't have data
if get_step_form_from_session(1, request) is None:
return redirect('data_capture:step_1')
else:
- 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 extract_min_education
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def extract_min_education(text):
'''
Attempts to find a valid Education Choice within the given text argument
If a matching Education Choice is found, it is returned
- 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 trackInterestingLink
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function trackInterestingLink(el) {
if (!(el instanceof HTMLAnchorElement)) {
return;
}
- 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 handleChange
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
handleChange(e) {
const { value } = e.target;
const filteredChars = [];
let decimalFound = false;
let centDigits = 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
Function load_cups_from_vcap_services
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def load_cups_from_vcap_services(name: str='calc-env',
env: Environ=os.environ) -> None:
'''
Detects if VCAP_SERVICES exists in the environment; if so, parses
it and imports all the credentials from the given custom
- 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_template_path
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def get_template_path(template_name: str) -> Path:
'''
Given a Django template path, return an absolute path to it.
'''
- 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
Avoid too many return
statements within this function. Open
return step.render(request, {