i05nagai/mafipy

View on GitHub

Showing 245 of 1,119 total issues

Function black_scholes_call_theta has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

def black_scholes_call_theta(underlying, strike, rate, maturity, vol, today):
Severity: Minor
Found in mafipy/function/black_scholes.py - About 45 mins to fix

    Function test_make_pdf_fprime_black_scholes has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def test_make_pdf_fprime_black_scholes(
    Severity: Minor
    Found in mafipy/replication/tests/test_pricer_quanto_cms.py - About 45 mins to fix

      Function test_black_scholes_call_value has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def test_black_scholes_call_value(
      Severity: Minor
      Found in mafipy/function/tests/test_black_scholes.py - About 45 mins to fix

        Function test_black_scholes_call_formula has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def test_black_scholes_call_formula(
        Severity: Minor
        Found in mafipy/function/tests/test_black_scholes.py - About 45 mins to fix

          Function sabr_atm_implied_vol_hagan has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          def sabr_atm_implied_vol_hagan(
          Severity: Minor
          Found in mafipy/function/sabr.py - About 45 mins to fix

            Function test_black_scholes_call_rho has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def test_black_scholes_call_rho(
            Severity: Minor
            Found in mafipy/function/tests/test_black_scholes.py - About 45 mins to fix

              Function test_make_cdf_black_scholes has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  def test_make_cdf_black_scholes(
              Severity: Minor
              Found in mafipy/replication/tests/test_pricer_quanto_cms.py - About 45 mins to fix

                Function test_black_scholes_call_value_third_by_strike has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    def test_black_scholes_call_value_third_by_strike(
                Severity: Minor
                Found in mafipy/function/tests/test_black_scholes.py - About 45 mins to fix

                  Function black_scholes_call_value has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  def black_scholes_call_value(
                  Severity: Minor
                  Found in mafipy/function/black_scholes.py - About 45 mins to fix

                    Function test_black_scholes_call_theta has 6 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        def test_black_scholes_call_theta(
                    Severity: Minor
                    Found in mafipy/function/tests/test_black_scholes.py - About 45 mins to fix

                      Function test_black_scholes_call_value_fhess_by_strike has 6 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          def test_black_scholes_call_value_fhess_by_strike(
                      Severity: Minor
                      Found in mafipy/function/tests/test_black_scholes.py - About 45 mins to fix

                        Function calc_local_vol_model_implied_vol has 6 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                        def calc_local_vol_model_implied_vol(
                        Severity: Minor
                        Found in mafipy/function/local_vol.py - About 45 mins to fix

                          Function finalize_options has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                          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)]
                          Severity: Minor
                          Found in setup.py - About 45 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 run has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                          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)]
                          Severity: Minor
                          Found in setup.py - About 45 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

                          Consider simplifying this complex logical expression.
                          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:
                          Severity: Major
                          Found in mafipy/function/black_scholes.py - About 40 mins to fix

                            Consider simplifying this complex logical expression.
                            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
                            Severity: Major
                            Found in mafipy/function/tests/test_black_scholes.py - About 40 mins to fix

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

                                  def test_model_black_payers_swaption_vega(self,
                              Severity: Minor
                              Found in mafipy/function/tests/test_black.py - About 35 mins to fix

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

                                    def test_black_payers_swaption_pdf(self,
                                Severity: Minor
                                Found in mafipy/function/tests/test_black.py - About 35 mins to fix

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

                                  def d_fprime_by_strike(underlying, strike, rate, maturity, vol):
                                  Severity: Minor
                                  Found in mafipy/function/black_scholes.py - About 35 mins to fix

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

                                    def black_scholes_call_value_fhess_by_strike(
                                    Severity: Minor
                                    Found in mafipy/function/black_scholes.py - About 35 mins to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language