Showing 207 of 1,119 total issues
Function get_var_name
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def get_var_name(var, symboltable, error=None):
"""getVarName
Return a var's name as a string.
This funciton require a
symboltable(returned value of globals() or locals())
- 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
return underlying - math.exp(-rate * time) * strike
Avoid too many return
statements within this function. Open
return 0.0
Avoid too many return
statements within this function. Open
return black_scholes_call_formula(
Avoid too many return
statements within this function. Open
return (underlying - strike) + value
Function black_scholes_call_value_fhess_by_strike
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def black_scholes_call_value_fhess_by_strike(
underlying, strike, rate, maturity, vol):
"""black_scholes_call_value_fhess_by_strike
Second derivative of value of call option with respect to strike
under black scholes model.
- 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 replicate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def replicate(init_swap_rate,
discount_factor,
call_pricer,
put_pricer,
payoff_type,
- 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"