Showing 283 of 1,132 total issues
Function paginate_query
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def paginate_query(self, query, current_page, rows_per_page):
"""
Set variables for query pagination, limiting query statement
to just the section of the table that will be displayed
"""
- 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 remove_user
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def remove_user(username, remove_db=True, ignore_missing_user=False):
# Delete the Django user
try:
DataHubManager._remove_django_user(username)
except User.DoesNotExist as e:
- 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 license_create
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def license_create(request):
username = request.user.get_username()
public_role = settings.PUBLIC_ROLE
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 refine_data
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def refine_data(request):
res = {'error': None}
try:
if request.method == 'POST':
training_input = request.POST['training_input']
- 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 _check_external_links
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _check_external_links(self):
# Justin gets a list of external links
links = self.browser.find_elements_by_xpath(
"//a[(starts-with(@href, 'http'))]")
links = map(lambda x: x.get_attribute('href'), links)
- 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_security_policies
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def find_security_policies(self, repo_base, repo=None, table=None,
policy_id=None, policy=None, policy_type=None,
grantee=None, grantor=None):
'''
Returns a list of all security polices that match the inputs specied
- 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_date_stats
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def get_date_stats(self, col_name):
q = ('select max(%s)::date, min(%s)::date, '
'EXTRACT(EPOCH FROM (max(%s::timestamp) - min(%s::timestamp)))/60'
' as minutes from %s')
q = q % (col_name, col_name, col_name, col_name, self.tablename)
- 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 fn(context, options);
Avoid too many return
statements within this function. Open
return string.replace(badChars, escapeChar);
Avoid too many return
statements within this function. Open
return Response(
Avoid too many return
statements within this function. Open
return super(SummaryEncoder, self).default(o)
Avoid too many return
statements within this function. Open
return HttpResponse(
Function set_visibility
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
var set_visibility = function(colname, visibility) {
if (visibility !== undefined) {
if (visibility) {
hidden_cols[colname] = undefined;
} 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 get_user_details
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_user_details(request):
"""
DataHub account registration form for social accounts.
Gives new users a chance to choose a DataHub username and set their email
- 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 _unique_keys
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _unique_keys(proposed):
"""
Uniques and returns a given list of strings.
e.g. ['foo', 'foo', 'foo'] => ['foo', 'foo_1', 'foo_2']
- 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 insert_into_cache
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def insert_into_cache(f):
"""Inserts metadata into the cache"""
@wraps(f)
def _f(self, *args, **kwargs):
try:
- 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 user
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def user(request, repo_base=None):
username = request.user.get_username()
repo_base = username or 'public'
- 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_view_sql
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_view_sql(self, repo_base, repo, table, view_params, license_id):
# create view based on license
license = LicenseManager.find_license_by_id(license_id)
pii_def = license.pii_def
- 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 app_register
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def app_register(request):
username = request.user.get_username()
if request.method == "POST":
try:
- 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 _remove_django_user
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _remove_django_user(username):
# Get the user associated with the username, delete their apps, and
# then delete the user
try:
user = User.objects.get(username=username)
- 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"