Showing 10 of 10 total issues
File dynamo.py
has 577 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
def get_safe_alias(attr_name):
return DYNAMO_RESERVED_WORDS.get(attr_name.upper(), attr_name)
DYNAMO_RESERVED_WORDS = {
'ABORT': '#abort',
Function builder
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def builder(
Function RequestTree
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def RequestTree(attributes, table_name, index_name, hash_key, range_key, conditions, gsi, lsi):
Function strip_Decimals
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Open
def strip_Decimals(obj):
if isinstance(obj, list):
return [strip_Decimals(item) for item in obj]
if isinstance(obj, dict):
- 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 Attr
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def Attr(equals, gt, lt, lt_or_eq, gt_or_eq, between, begins_with):
Function create
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def create(table_name: str, hash_key: str, range_key: str = None, gsi: str = None, lsi: str = None):
Function Attribute
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def Attribute(original, key, value, alias, func):
Function builder
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
def builder(
table_name,
index_name=None,
key=None,
attributes=None,
- 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
Open
return obj
Avoid too many return
statements within this function. Open
Open
return UnknownDatabaseException(boto_client_err)