Showing 283 of 1,132 total issues
Function gg
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function gg(a, b, c, d, x, s, t) {
Function create_security_policy
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def create_security_policy(self, policy, policy_type, grantee, grantor,
Function create_security_policy
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def create_security_policy(
Function create_security_policy
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def create_security_policy(self, policy, policy_type, grantee,
Function import_file
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def import_file(self, table_name, file_path, file_format='CSV',
Function import_file
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def import_file(self, table_name, file_path, file_format='CSV',
Avoid deeply nested control flow statements. Open
Open
if (eAttachment.left === 'left') {
left -= targetWidth;
tAttachment.left = 'left';
left -= width;
eAttachment.left = 'right';
Avoid deeply nested control flow statements. Open
Open
} else if (tAttachment.left === 'center') {
if (left + width > bounds[2] && eAttachment.left === 'left') {
left -= width;
eAttachment.left = 'right';
} else if (left < bounds[0] && eAttachment.left === 'right') {
Function cmn
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function cmn(q, a, b, x, s, t) {
Function cmn
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function cmn(q, a, b, x, s, t) {
Avoid deeply nested control flow statements. Open
Open
if (priorKey) {
execIteration(priorKey, i-1);
}
Avoid deeply nested control flow statements. Open
Open
} else if (tAttachment.left === 'center') {
if (left + width > bounds[2] && eAttachment.left === 'left') {
left -= width;
eAttachment.left = 'right';
} else if (left < bounds[0] && eAttachment.left === 'right') {
Avoid deeply nested control flow statements. Open
Open
if (eAttachment.left === 'left') {
left -= targetWidth;
tAttachment.left = 'left';
left -= width;
eAttachment.left = 'right';
Function schema
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
def schema(request, repo, table):
username = request.user.get_username()
manager = DataHubManager(username)
repos = get_repos(manager)
if repos is not None and repo in repos:
- 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
Open
def __init__(self, data, name, searchable, orderable, searchValue, searchRegex):
Function create_user_db_and_data_folder_if_needed
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
def create_user_db_and_data_folder_if_needed(sender, instance, **kwargs):
"""
Creates a Postgres role and db and data folder to go with new Django users.
Raises an exception if the role, database, or user data folder exists
- 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 deeply nested control flow statements. Open
Open
if type_for_col[col_filter.name] == "text":
first = "'" + first + "'"
second = "'" + second + "'"
col_filter_string = "(%s BETWEEN %s AND %s)" % (col_filter.name, first, second)
Function export_view
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def export_view(self, repo, view, file_name=None, file_format='CSV',
Function create_table_from_file
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def create_table_from_file(self, repo, table, file_name, delimiter,
Avoid deeply nested control flow statements. Open
Open
if len(range_vals) != 2:
return ""
first, second = range_vals[0], range_vals[1]