Showing 88 of 148 total issues
Function bond
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
def bond(start_date=TODAY,
Function __call__
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def __call__(self, _=None):
flows = list()
for item in self.domain:
payoff = self._flows.get(item, 0.)
if not isinstance(payoff, (int, float)):
- 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_bucketed_delta
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def get_bucketed_delta(cashflow_list, discount_curve, valuation_date=None,
delta_curve=None, delta_grid=None, shift=.0001):
r""" list of bpv delta for partly shifted interest rate curve
:param cashflow_list: list of cashflows
- 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 __init__
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, domain, data, interpolation=None):
r"""class to build piecewise interpolation function
:param list(float) domain: points $x_1 \dots x_n$
:param list(float) data: values $y_1 \dots y_n$
- 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 __init__
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, payment_date_list, amount_list=DEFAULT_AMOUNT,
Function __init__
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, payment_date_list,
Function table
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def table(self):
""" cashflow details as list of tuples """
# print(tabulate(cf.table, headers='firstrow')) # for pretty print
header, table = list(), list()
- 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_curve_fit
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_curve_fit(cashflow_list, discount_curve, valuation_date=None,
Function __init__
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, payment_date_list, amount_list=DEFAULT_AMOUNT,
Function __init__
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, start, end, amount=DEFAULT_AMOUNT,
Function __init__
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, payment_date_list, amount_list=DEFAULT_AMOUNT,
Function add
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def add(self, foreign_currency, foreign_curve=None, fx_spot=1.0):
"""
adds contents to FxShelf.
If curve is FxCurve or FxDict,
spot should turn curve.currency into self.currency,
- 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 __setitem__
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def __setitem__(self, key, value):
if isinstance(key, tuple) and len(key) == 2:
d, f = key
if not (isinstance(d, type(self.currency))
and isinstance(f, type(self.currency))
- 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 kwargs
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def kwargs(self):
"""returns constructor arguments as ordered dictionary
(under construction)
"""
warn('%s().kwargs is under construction' % self.__class__.__name__)
- 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 __getitem__
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def __getitem__(self, item):
if item in self:
return super(FxContainer, self).__getitem__(item)
else:
if not isinstance(item, type(self.currency)):
- 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 __init__
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, value=0., masterscale=None):
if not isinstance(masterscale, RatingClass.master_scale):
if isinstance(masterscale, dict):
masterscale = self.__class__.master_scale(masterscale)
elif isinstance(masterscale, (tuple, list)) or \
- 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 __init__
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, domain=(), data=(), interpolation=None, origin=None,
Function __init__
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, payment_date_list, amount_list=DEFAULT_AMOUNT,
strike_list=(), is_put_list=False,
fixing_offset=None, pay_offset=None,
origin=None, payoff_model=None):
r""" list of European option payoffs
- 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_compounding_factor
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _get_compounding_factor(self, start, stop):
if start == stop:
return 1. if 2 * float_info.min <= self(start) else 0.
current = start
- 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 __init__
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, domain=(), data=(), interpolation=None, origin=None,
day_count=None, forward_tenor=None):
# validate probabilities
if not isinstance(data, RateCurve):
data = [max(float_info.min, min(d, 1. - float_info.min)) for d in
- 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"