Function make_transaction_entry
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def make_transaction_entry(
method: Union[TransactionMethod, str],
url: str = None,
resource: Union[Resource, dict] = None,
) -> BundleEntry:
- 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_transaction_url_for_method
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def _get_transaction_url_for_method(
method: TransactionMethod, url: str = None, resource: Resource = None
) -> str:
"""
Get the url for a transaction entry based on the method, url, and resource.
- 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 _validate_transaction_input
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def _validate_transaction_input(
method: Union[TransactionMethod, str],
references: Union[List[Reference], List[str]],
resources: Union[List[Resource], List[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 make_transaction_bundle
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def make_transaction_bundle(
transaction_type: TransactionType = TransactionType.TRANSACTION,
method: Union[TransactionMethod, str] = TransactionMethod.POST,
resources: Union[List[Resource], List[dict]] = None,
references: Union[List[Reference], List[str]] = 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"