Function price_to_precision
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def price_to_precision(
price: float,
price_precision: Optional[float],
precisionMode: Optional[int],
*,
- 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 __price_to_precision_significant_digits
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def __price_to_precision_significant_digits(
price: float,
price_precision: float,
*,
rounding_mode: int = ROUND,
- 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 price_to_precision
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def price_to_precision(
Avoid too many return
statements within this function. Open
return floor(ticks) / (10**ndigits)
Avoid too many return
statements within this function. Open
return price
Avoid too many return
statements within this function. Open
return __price_to_precision_significant_digits(
Function validate_exchange
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def validate_exchange(exchange: str) -> Tuple[bool, str]:
"""
returns: can_use, reason
with Reason including both missing and missing_opt
"""
- 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"