Showing 207 of 1,119 total issues
Function test_black_scholes_call_value_fprime_by_strike
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def test_black_scholes_call_value_fprime_by_strike(
Function sabr_caibration_west
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def sabr_caibration_west(market_vols,
Function test_make_cdf_black_scholes
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def test_make_cdf_black_scholes(
Function test_black_scholes_call_delta
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def test_black_scholes_call_delta(
Function black_scholes_put_value
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def black_scholes_put_value(
Function _replicate_numerator
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def _replicate_numerator(init_swap_rate,
Function test_black_scholes_call_vega
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def test_black_scholes_call_vega(
Function test_black_scholes_call_theta
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def test_black_scholes_call_theta(
Function black_scholes_call_rho
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def black_scholes_call_rho(underlying, strike, rate, maturity, vol, today):
Function test_make_pdf_black_scholes
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def test_make_pdf_black_scholes(
Function test_put_call_parity_black_scholes
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def test_put_call_parity_black_scholes(
Function test_black_scholes_call_value_third_by_strike
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def test_black_scholes_call_value_third_by_strike(
Function test_black_scholes_call_rho
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def test_black_scholes_call_rho(
Function calc_local_vol_model_implied_vol
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def calc_local_vol_model_implied_vol(
Function run
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
def run(self):
if self.run_type is not None:
self.args += ["{0}".format(self.run_type)]
if self.bench is not None:
self.args += ["--bench={0}".format(self.bench)]
- 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 finalize_options
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
def finalize_options(self):
TestCommand.finalize_options(self)
# if cov option is specified, option is replaced.
if self.cov:
self.test_args += ["--cov={0}".format(self.cov)]
- 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
Consider simplifying this complex logical expression. Open
Open
if time < 0.0 or np.isclose(time, 0.0):
expect = 0.0
elif np.isclose(strike, 0.0) and underlying > 0.0:
# max(-|S|, 0)
expect = 0.0
Consider simplifying this complex logical expression. Open
Open
if time < 0.0 or np.isclose(time, 0.0):
return 0.0
elif np.isclose(underlying, 0.0):
return math.exp(-rate * time) * max(-strike, 0.0)
elif np.isclose(strike, 0.0) and underlying > 0.0:
Function _calc_h_fhess
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def _calc_h_fhess(swap_rate_pdf_fprime, swap_rate_pdf, swap_rate, h, h_fprime):
Function test_model_black_payers_swaption_volga
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def test_model_black_payers_swaption_volga(self,