i05nagai/mafipy

View on GitHub

Showing 245 of 1,119 total issues

Avoid too many return statements within this function.
Open

        return 0.0
Severity: Major
Found in mafipy/function/black_scholes.py - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

        return black_scholes_call_formula(
    Severity: Major
    Found in mafipy/function/black_scholes.py - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

              return underlying - math.exp(-rate * time) * strike
      Severity: Major
      Found in mafipy/function/black_scholes.py - About 30 mins to fix

        Function black_scholes_call_value_fhess_by_strike has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

        def black_scholes_call_value_fhess_by_strike(
                underlying, strike, rate, maturity, vol):
            """black_scholes_call_value_fhess_by_strike
            Second derivative of value of call option with respect to strike
            under black scholes model.
        Severity: Minor
        Found in mafipy/function/black_scholes.py - About 25 mins to fix

        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 replicate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

        def replicate(init_swap_rate,
                      discount_factor,
                      call_pricer,
                      put_pricer,
                      payoff_type,
        Severity: Minor
        Found in mafipy/replication/pricer_quanto_cms.py - About 25 mins to fix

        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

        Severity
        Category
        Status
        Source
        Language