i05nagai/mafipy

View on GitHub
mafipy/replication/replication_method.py

Summary

Maintainability
A
3 hrs
Test Coverage

Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def __init__(self,
Severity: Minor
Found in mafipy/replication/replication_method.py - About 35 mins to fix

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

        def _calc_put_integral(self, init_swap_rate, min_put_range):
            """_calc_put_integral
            integrate function with put pricer.
    
            :param init_swap_rate:
    Severity: Major
    Found in mafipy/replication/replication_method.py and 1 other location - About 1 hr to fix
    mafipy/replication/replication_method.py on lines 249..260

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 39.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

        def _calc_call_integral(self, init_swap_rate, max_call_range):
            """_calc_call_integral
            integrate function with put pricer.
    
            :param init_swap_rate:
    Severity: Major
    Found in mafipy/replication/replication_method.py and 1 other location - About 1 hr to fix
    mafipy/replication/replication_method.py on lines 236..247

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 39.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

    class AnnuityMappingFuncHelper(object):
        """AnnuityMappingFuncHelper
        Interface to generate annuity mapping function
        and it's first and second derivative.
        """
    Severity: Minor
    Found in mafipy/replication/replication_method.py and 1 other location - About 40 mins to fix
    mafipy/function/payoff.py on lines 193..206

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 34.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Invalid escape sequence '\m'
    Open

                \int_{L{\mathrm{lower}}}^{L_{\mathrm{upper}}} f(x) g(x)\ dx,

    Invalid escape sequences are deprecated in Python 3.6.

    Okay: regex = r'\.png$'
    W605: regex = '\.png$'

    Invalid escape sequence '\i'
    Open

                    + \int_{S(0)}^{\infty} f^{\prime\prime}(K)c(K)\ d K

    Invalid escape sequences are deprecated in Python 3.6.

    Okay: regex = r'\.png$'
    W605: regex = '\.png$'

    Invalid escape sequence '\c'
    Open

            :math:`f(\cdot)` is payoff function as a function of underlying,

    Invalid escape sequences are deprecated in Python 3.6.

    Okay: regex = r'\.png$'
    W605: regex = '\.png$'

    Invalid escape sequence '\m'
    Open

            :math:`L_{\mathrm{upper}}` is `upper`.

    Invalid escape sequences are deprecated in Python 3.6.

    Okay: regex = r'\.png$'
    W605: regex = '\.png$'

    Invalid escape sequence '\p'
    Open

                    + \int_{S(0)}^{\infty} f^{\prime\prime}(K)c(K)\ d K

    Invalid escape sequences are deprecated in Python 3.6.

    Okay: regex = r'\.png$'
    W605: regex = '\.png$'

    Invalid escape sequence '\c'
    Open

            :math:`g(\cdot)` is `pricer`,

    Invalid escape sequences are deprecated in Python 3.6.

    Okay: regex = r'\.png$'
    W605: regex = '\.png$'

    Invalid escape sequence '\l'
    Open

                \left[

    Invalid escape sequences are deprecated in Python 3.6.

    Okay: regex = r'\.png$'
    W605: regex = '\.png$'

    Invalid escape sequence '\p'
    Open

                    + \int_{-\infty}^{S(0)} f^{\prime\prime}(K)p(K)\ d K

    Invalid escape sequences are deprecated in Python 3.6.

    Okay: regex = r'\.png$'
    W605: regex = '\.png$'

    Invalid escape sequence '\m'
    Open

            :math:`L_{\mathrm{lower}}` is `lower`,

    Invalid escape sequences are deprecated in Python 3.6.

    Okay: regex = r'\.png$'
    W605: regex = '\.png$'

    Invalid escape sequence '\p'
    Open

            \\alpha^{\prime}(S) := \\alpha_{0.}

    Invalid escape sequences are deprecated in Python 3.6.

    Okay: regex = r'\.png$'
    W605: regex = '\.png$'

    Invalid escape sequence '\ '
    Open

                    + \int_{-\infty}^{S(0)} f^{\prime\prime}(K)p(K)\ d K

    Invalid escape sequences are deprecated in Python 3.6.

    Okay: regex = r'\.png$'
    W605: regex = '\.png$'

    Invalid escape sequence '\i'
    Open

                    + \int_{S(0)}^{\infty} f^{\prime\prime}(K)c(K)\ d K

    Invalid escape sequences are deprecated in Python 3.6.

    Okay: regex = r'\.png$'
    W605: regex = '\.png$'

    Invalid escape sequence '\s'
    Open

            :math:`c(K; S(0), T, \sigma)` is value of call pricer

    Invalid escape sequences are deprecated in Python 3.6.

    Okay: regex = r'\.png$'
    W605: regex = '\.png$'

    Invalid escape sequence '\m'
    Open

                \mathrm{E}

    Invalid escape sequences are deprecated in Python 3.6.

    Okay: regex = r'\.png$'
    W605: regex = '\.png$'

    Invalid escape sequence '\s'
    Open

            :math:`p(K; S(0), T, \sigma)` is value of put pricer

    Invalid escape sequences are deprecated in Python 3.6.

    Okay: regex = r'\.png$'
    W605: regex = '\.png$'

    Invalid escape sequence '\c'
    Open

            :math:`f(\cdot)` is `func`,

    Invalid escape sequences are deprecated in Python 3.6.

    Okay: regex = r'\.png$'
    W605: regex = '\.png$'

    Invalid escape sequence '\p'
    Open

                    + \int_{S(0)}^{\infty} f^{\prime\prime}(K)c(K)\ d K

    Invalid escape sequences are deprecated in Python 3.6.

    Okay: regex = r'\.png$'
    W605: regex = '\.png$'

    Invalid escape sequence '\i'
    Open

                    + \int_{-\infty}^{S(0)} f^{\prime\prime}(K)p(K)\ d K

    Invalid escape sequences are deprecated in Python 3.6.

    Okay: regex = r'\.png$'
    W605: regex = '\.png$'

    Invalid escape sequence '\ '
    Open

                \int_{L{\mathrm{lower}}}^{L_{\mathrm{upper}}} f(x) g(x)\ dx,

    Invalid escape sequences are deprecated in Python 3.6.

    Okay: regex = r'\.png$'
    W605: regex = '\.png$'

    Invalid escape sequence '\i'
    Open

                    + \int_{-\infty}^{S(0)} f^{\prime\prime}(K)p(K)\ d K

    Invalid escape sequences are deprecated in Python 3.6.

    Okay: regex = r'\.png$'
    W605: regex = '\.png$'

    Invalid escape sequence '\i'
    Open

                \int_{L{\mathrm{lower}}}^{L_{\mathrm{upper}}} f(x) g(x)\ dx,

    Invalid escape sequences are deprecated in Python 3.6.

    Okay: regex = r'\.png$'
    W605: regex = '\.png$'

    Invalid escape sequence '\p'
    Open

                    + \int_{-\infty}^{S(0)} f^{\prime\prime}(K)p(K)\ d K

    Invalid escape sequences are deprecated in Python 3.6.

    Okay: regex = r'\.png$'
    W605: regex = '\.png$'

    Invalid escape sequence '\ '
    Open

                    + \int_{S(0)}^{\infty} f^{\prime\prime}(K)c(K)\ d K

    Invalid escape sequences are deprecated in Python 3.6.

    Okay: regex = r'\.png$'
    W605: regex = '\.png$'

    Invalid escape sequence '\m'
    Open

                \int_{L{\mathrm{lower}}}^{L_{\mathrm{upper}}} f(x) g(x)\ dx,

    Invalid escape sequences are deprecated in Python 3.6.

    Okay: regex = r'\.png$'
    W605: regex = '\.png$'

    There are no issues that match your filters.

    Category
    Status