Showing 1,132 of 1,132 total issues
Avoid deeply nested control flow statements. Open
if (eAttachment.left === 'left') {
left -= targetWidth;
tAttachment.left = 'left';
left -= width;
eAttachment.left = 'right';
Avoid deeply nested control flow statements. 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
function cmn(q, a, b, x, s, t) {
Function cmn
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function cmn(q, a, b, x, s, t) {
Avoid deeply nested control flow statements. 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
if (priorKey) {
execIteration(priorKey, i-1);
}
Avoid deeply nested control flow statements. Open
if (eAttachment.left === 'left') {
left -= targetWidth;
tAttachment.left = 'left';
left -= width;
eAttachment.left = 'right';
Function db_schema
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def db_schema(db, table):
"""
only works for postgres
@return dictionary of column name -> python type object
- 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 export_table
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def export_table(self, repo, table, file_name=None, file_format='CSV',
Function find_security_policies
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def find_security_policies(
Function schema
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. 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 schema
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def schema(request, repo_name, table_name):
username = request.user.get_username()
manager = DataHubManager(username)
repos = get_repos(manager)
if repos is not None and repo_name 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 add_password
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def add_password(request, is_disconnect=False):
"""
Presents a form asking the current user to set a password on their account.
Used by both the settings page and disconnect pipeline.
- 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_table_from_file
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_table_from_file(self, repo, table, file_name, delimiter,
Avoid deeply nested control flow statements. Open
if c_name == col_name and can_apply(agg_type, col_name):
result = manager.execute_sql(
"SELECT %s(%s) FROM %s.%s" % (agg_type.lower(), col_name.lower(), repo, table))
if "tuples" in result and len(result["tuples"]) > 0 and len(result["tuples"][0]) > 0:
return json_response({"value": result["tuples"][0]})
Function license_view_delete
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def license_view_delete(request, repo_base, repo, table,
Function default
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def default(self, o):
if isinstance(o, float):
if o == float('inf'):
return 1e100
elif o == float('-inf'):
- 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 export_table
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def export_table(self, repo, table, file_name, file_format='CSV',
Avoid deeply nested control flow statements. Open
if op == "=":
text = "'%" + text + "%'"
op = "ILIKE"
elif op == "!=":
text = "'%" + text + "%'"
Function create_user_db_and_data_folder_if_needed
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. 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"