Showing 207 of 1,119 total issues
File sabr.py
has 1413 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
#!/bin/python
# -*- coding: utf-8 -*-
from __future__ import division, print_function, absolute_import
import math
File pricer_quanto_cms.py
has 911 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
#!/bin/python
# -*- coding: utf-8 -*-
from __future__ import division, print_function, absolute_import
import numpy as np
File test_pricer_quanto_cms.py
has 756 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
#!/bin/python
# -*- coding: utf-8 -*-
from __future__ import division, print_function, absolute_import
from pytest import approx
File black_scholes.py
has 643 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
from __future__ import division, print_function, absolute_import
import math
import numpy as np
import scipy.special
File test_black.py
has 494 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
#!/bin/python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
File test_black_scholes.py
has 483 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
#!/bin/python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
File test_sabr.py
has 479 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
#!/bin/python
# -*- coding: utf-8 -*-
from __future__ import division, print_function, absolute_import
from pytest import approx
File test__quanto_cms_forward_fx.py
has 426 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
#!/bin/python
# -*- coding: utf-8 -*-
from __future__ import division, print_function, absolute_import
from pytest import approx
TestSabr
has 31 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class TestSabr(object):
# before all tests starts
@classmethod
def setup_class(cls):
File black.py
has 323 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
#!/bin/python
# -*- coding: utf-8 -*-
from __future__ import division, print_function, absolute_import
import numpy as np
File _quanto_cms_forward_fx.py
has 312 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
#!/bin/python
# -*- coding: utf-8 -*-
from __future__ import division, print_function, absolute_import
import math
File setup.py
has 311 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import Command
from setuptools.command.test import test as TestCommand
TestBlackScholes
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class TestBlackScholes(object):
# before all tests starts
@classmethod
def setup_class(cls):
Test_SimpleQuantoCmsLinearBullSpreadHelper
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class Test_SimpleQuantoCmsLinearBullSpreadHelper(object):
# before all tests starts
@classmethod
def setup_class(cls):
Function test_black_scholes_call_value
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
Open
def test_black_scholes_call_value(
self, underlying, strike, rate, maturity, vol, today):
time = maturity - today
if vol <= 0.0:
with pytest.raises(AssertionError):
- 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 sabr_implied_vol_hagan
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
Open
def sabr_implied_vol_hagan(
underlying, strike, maturity, alpha, beta, rho, nu):
"""sabr_implied_vol_hagan
calculate implied volatility under SABR 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 __init__
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(self,
Function sabr_implied_vol_hagan_fhess_by_strike
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def sabr_implied_vol_hagan_fhess_by_strike(
underlying, strike, maturity, alpha, beta, rho, nu):
"""sabr_implied_vol_hagan_fhess_by_strike
second derivative of Hagan's SABR implied volatility formula
with respect to strike.
Function sabr_implied_vol_hagan_fhess_by_underlying
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def sabr_implied_vol_hagan_fhess_by_underlying(
underlying, strike, maturity, alpha, beta, rho, nu):
"""sabr_implied_vol_hagan_fhess_by_underlying
second derivative of Hagan's SABR implied volatility formula
with respect to underlying.
Function __init__
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(self,