i05nagai/mafipy

View on GitHub

Showing 245 of 1,119 total issues

File sabr.py has 1413 lines of code (exceeds 250 allowed). Consider refactoring.
Open

#!/bin/python
# -*- coding: utf-8 -*-

from __future__ import division, print_function, absolute_import
import math
Severity: Major
Found in mafipy/function/sabr.py - About 3 days to fix

    File pricer_quanto_cms.py has 911 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    #!/bin/python
    # -*- coding: utf-8 -*-
    
    from __future__ import division, print_function, absolute_import
    import numpy as np
    Severity: Major
    Found in mafipy/replication/pricer_quanto_cms.py - About 2 days to fix

      File test_pricer_quanto_cms.py has 756 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      #!/bin/python
      # -*- coding: utf-8 -*-
      
      from __future__ import division, print_function, absolute_import
      from pytest import approx
      Severity: Major
      Found in mafipy/replication/tests/test_pricer_quanto_cms.py - About 1 day to fix

        File black_scholes.py has 643 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        from __future__ import division, print_function, absolute_import
        import math
        import numpy as np
        import scipy.special
        
        
        Severity: Major
        Found in mafipy/function/black_scholes.py - About 1 day to fix

          File test_black.py has 494 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          #!/bin/python
          # -*- coding: utf-8 -*-
          
          from __future__ import absolute_import
          from __future__ import division
          Severity: Minor
          Found in mafipy/function/tests/test_black.py - About 7 hrs to fix

            File test_black_scholes.py has 483 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            #!/bin/python
            # -*- coding: utf-8 -*-
            
            from __future__ import absolute_import
            from __future__ import division
            Severity: Minor
            Found in mafipy/function/tests/test_black_scholes.py - About 7 hrs to fix

              File test_sabr.py has 479 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              #!/bin/python
              # -*- coding: utf-8 -*-
              
              from __future__ import division, print_function, absolute_import
              from pytest import approx
              Severity: Minor
              Found in mafipy/function/tests/test_sabr.py - About 7 hrs to fix

                File test__quanto_cms_forward_fx.py has 426 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                #!/bin/python
                # -*- coding: utf-8 -*-
                
                from __future__ import division, print_function, absolute_import
                from pytest import approx
                Severity: Minor
                Found in mafipy/replication/tests/test__quanto_cms_forward_fx.py - About 6 hrs to fix

                  Cyclomatic complexity is too high in method test_black_scholes_call_value. (24)
                  Open

                      @pytest.mark.parametrize(
                          "underlying, strike, rate, maturity, vol, today",
                          [
                              # maturity < 0
                              (1.0, 1.0, 1.0, -1.0, 1.0, 0.0),

                  Cyclomatic Complexity

                  Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

                  Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

                  Construct Effect on CC Reasoning
                  if +1 An if statement is a single decision.
                  elif +1 The elif statement adds another decision.
                  else +0 The else statement does not cause a new decision. The decision is at the if.
                  for +1 There is a decision at the start of the loop.
                  while +1 There is a decision at the while statement.
                  except +1 Each except branch adds a new conditional path of execution.
                  finally +0 The finally block is unconditionally executed.
                  with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
                  assert +1 The assert statement internally roughly equals a conditional statement.
                  Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
                  Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

                  Source: http://radon.readthedocs.org/en/latest/intro.html

                  TestSabr has 31 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  class TestSabr(object):
                  
                      # before all tests starts
                      @classmethod
                      def setup_class(cls):
                  Severity: Minor
                  Found in mafipy/function/tests/test_sabr.py - About 3 hrs to fix

                    File black.py has 323 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    #!/bin/python
                    # -*- coding: utf-8 -*-
                    
                    from __future__ import division, print_function, absolute_import
                    import numpy as np
                    Severity: Minor
                    Found in mafipy/function/black.py - About 3 hrs to fix

                      File _quanto_cms_forward_fx.py has 312 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      #!/bin/python
                      # -*- coding: utf-8 -*-
                      
                      from __future__ import division, print_function, absolute_import
                      import math
                      Severity: Minor
                      Found in mafipy/replication/_quanto_cms_forward_fx.py - About 3 hrs to fix

                        File setup.py has 311 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        #!/usr/bin/env python
                        # -*- coding: utf-8 -*-
                        
                        from setuptools import Command
                        from setuptools.command.test import test as TestCommand
                        Severity: Minor
                        Found in setup.py - About 3 hrs to fix

                          Cyclomatic complexity is too high in method test_sabr_calibration_west. (15)
                          Open

                              def test_sabr_calibration_west(self):
                          Severity: Minor
                          Found in mafipy/calibrator/tests/test_sabr.py by radon

                          Cyclomatic Complexity

                          Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

                          Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

                          Construct Effect on CC Reasoning
                          if +1 An if statement is a single decision.
                          elif +1 The elif statement adds another decision.
                          else +0 The else statement does not cause a new decision. The decision is at the if.
                          for +1 There is a decision at the start of the loop.
                          while +1 There is a decision at the while statement.
                          except +1 Each except branch adds a new conditional path of execution.
                          finally +0 The finally block is unconditionally executed.
                          with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
                          assert +1 The assert statement internally roughly equals a conditional statement.
                          Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
                          Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

                          Source: http://radon.readthedocs.org/en/latest/intro.html

                          Cyclomatic complexity is too high in method test_sabr_calibration_simple. (15)
                          Open

                              def test_sabr_calibration_simple(self):
                          Severity: Minor
                          Found in mafipy/calibrator/tests/test_sabr.py by radon

                          Cyclomatic Complexity

                          Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

                          Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

                          Construct Effect on CC Reasoning
                          if +1 An if statement is a single decision.
                          elif +1 The elif statement adds another decision.
                          else +0 The else statement does not cause a new decision. The decision is at the if.
                          for +1 There is a decision at the start of the loop.
                          while +1 There is a decision at the while statement.
                          except +1 Each except branch adds a new conditional path of execution.
                          finally +0 The finally block is unconditionally executed.
                          with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
                          assert +1 The assert statement internally roughly equals a conditional statement.
                          Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
                          Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

                          Source: http://radon.readthedocs.org/en/latest/intro.html

                          Cyclomatic complexity is too high in function black_scholes_call_value. (14)
                          Open

                          def black_scholes_call_value(
                                  underlying,
                                  strike,
                                  rate,
                                  maturity,
                          Severity: Minor
                          Found in mafipy/function/black_scholes.py by radon

                          Cyclomatic Complexity

                          Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

                          Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

                          Construct Effect on CC Reasoning
                          if +1 An if statement is a single decision.
                          elif +1 The elif statement adds another decision.
                          else +0 The else statement does not cause a new decision. The decision is at the if.
                          for +1 There is a decision at the start of the loop.
                          while +1 There is a decision at the while statement.
                          except +1 Each except branch adds a new conditional path of execution.
                          finally +0 The finally block is unconditionally executed.
                          with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
                          assert +1 The assert statement internally roughly equals a conditional statement.
                          Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
                          Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

                          Source: http://radon.readthedocs.org/en/latest/intro.html

                          Cyclomatic complexity is too high in method test_black_payers_swaption_value_fhess_by_strike. (12)
                          Open

                              @pytest.mark.parametrize(
                          Severity: Minor
                          Found in mafipy/function/tests/test_black.py by radon

                          Cyclomatic Complexity

                          Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

                          Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

                          Construct Effect on CC Reasoning
                          if +1 An if statement is a single decision.
                          elif +1 The elif statement adds another decision.
                          else +0 The else statement does not cause a new decision. The decision is at the if.
                          for +1 There is a decision at the start of the loop.
                          while +1 There is a decision at the while statement.
                          except +1 Each except branch adds a new conditional path of execution.
                          finally +0 The finally block is unconditionally executed.
                          with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
                          assert +1 The assert statement internally roughly equals a conditional statement.
                          Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
                          Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

                          Source: http://radon.readthedocs.org/en/latest/intro.html

                          Cyclomatic complexity is too high in method test_black_payers_swaption_value. (12)
                          Open

                              @pytest.mark.parametrize(
                          Severity: Minor
                          Found in mafipy/function/tests/test_black.py by radon

                          Cyclomatic Complexity

                          Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

                          Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

                          Construct Effect on CC Reasoning
                          if +1 An if statement is a single decision.
                          elif +1 The elif statement adds another decision.
                          else +0 The else statement does not cause a new decision. The decision is at the if.
                          for +1 There is a decision at the start of the loop.
                          while +1 There is a decision at the while statement.
                          except +1 Each except branch adds a new conditional path of execution.
                          finally +0 The finally block is unconditionally executed.
                          with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
                          assert +1 The assert statement internally roughly equals a conditional statement.
                          Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
                          Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

                          Source: http://radon.readthedocs.org/en/latest/intro.html

                          Cyclomatic complexity is too high in method test_black_receivers_swaption_value. (12)
                          Open

                              @pytest.mark.parametrize(
                          Severity: Minor
                          Found in mafipy/function/tests/test_black.py by radon

                          Cyclomatic Complexity

                          Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

                          Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

                          Construct Effect on CC Reasoning
                          if +1 An if statement is a single decision.
                          elif +1 The elif statement adds another decision.
                          else +0 The else statement does not cause a new decision. The decision is at the if.
                          for +1 There is a decision at the start of the loop.
                          while +1 There is a decision at the while statement.
                          except +1 Each except branch adds a new conditional path of execution.
                          finally +0 The finally block is unconditionally executed.
                          with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
                          assert +1 The assert statement internally roughly equals a conditional statement.
                          Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
                          Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

                          Source: http://radon.readthedocs.org/en/latest/intro.html

                          Cyclomatic complexity is too high in method test_black_scholes_put_value. (12)
                          Open

                              @pytest.mark.parametrize(

                          Cyclomatic Complexity

                          Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

                          Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

                          Construct Effect on CC Reasoning
                          if +1 An if statement is a single decision.
                          elif +1 The elif statement adds another decision.
                          else +0 The else statement does not cause a new decision. The decision is at the if.
                          for +1 There is a decision at the start of the loop.
                          while +1 There is a decision at the while statement.
                          except +1 Each except branch adds a new conditional path of execution.
                          finally +0 The finally block is unconditionally executed.
                          with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
                          assert +1 The assert statement internally roughly equals a conditional statement.
                          Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
                          Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

                          Source: http://radon.readthedocs.org/en/latest/intro.html

                          Severity
                          Category
                          Status
                          Source
                          Language