Showing 245 of 1,119 total issues
Function black_scholes_call_theta
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def black_scholes_call_theta(underlying, strike, rate, maturity, vol, today):
Function test_make_pdf_fprime_black_scholes
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def test_make_pdf_fprime_black_scholes(
Function test_black_scholes_call_value
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def test_black_scholes_call_value(
Function test_black_scholes_call_formula
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def test_black_scholes_call_formula(
Function sabr_atm_implied_vol_hagan
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def sabr_atm_implied_vol_hagan(
Function test_black_scholes_call_rho
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def test_black_scholes_call_rho(
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_value_third_by_strike
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def test_black_scholes_call_value_third_by_strike(
Function black_scholes_call_value
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def black_scholes_call_value(
Function test_black_scholes_call_theta
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def test_black_scholes_call_theta(
Function test_black_scholes_call_value_fhess_by_strike
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def test_black_scholes_call_value_fhess_by_strike(
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 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
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
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:
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
Function test_model_black_payers_swaption_vega
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def test_model_black_payers_swaption_vega(self,
Function test_black_payers_swaption_pdf
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def test_black_payers_swaption_pdf(self,
Function d_fprime_by_strike
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def d_fprime_by_strike(underlying, strike, rate, maturity, vol):
Function black_scholes_call_value_fhess_by_strike
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def black_scholes_call_value_fhess_by_strike(