Showing 283 of 1,132 total issues
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, repo, tablename, username, repo_base=None,
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
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 export_table
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def export_table(self, repo, table, file_name=None, file_format='CSV',
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 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 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 find_security_policies
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def find_security_policies(
Avoid deeply nested control flow statements. Open
if op == "=":
text = "'%" + text + "%'"
op = "ILIKE"
elif op == "!=":
text = "'%" + text + "%'"
Function export_table
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def export_table(self, repo, table, file_name, file_format='CSV',
Consider simplifying this complex logical expression. Open
if (elVal !== '' && val !== '' && (key === 'top' || key === 'left' || key === 'bottom' || key === 'right')) {
elVal = parseFloat(elVal);
val = parseFloat(val);
}
Consider simplifying this complex logical expression. Open
if (elVal !== '' && val !== '' && (key === 'top' || key === 'left' || key === 'bottom' || key === 'right')) {
elVal = parseFloat(elVal);
val = parseFloat(val);
}
Function compute_aggregate
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
api.compute_aggregate = function(repo, table, agg_type, col_name, callback) {
Function program
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
program: function(i, data, declaredBlockParams, blockParams, depths) {
Function compute_aggregate
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
api.compute_aggregate = function(repo, table, agg_type, col_name, callback) {
Function patch
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def patch(self, request, repo_base, repo_name, card_name, format=None):
Function update_security_policy
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def update_security_policy(policy_id, new_policy, new_policy_type,
Function create_license_view
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_license_view(self, repo_base, repo,
Function delete
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def delete(self, request, repo_base, repo_name, collaborator, format=None):