i05nagai/mafipy

View on GitHub

Showing 191 of 1,119 total issues

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

def _sabr_implied_vol_hagan_A31_fprime_by_underlying(
        underlying, strike, maturity, alpha, beta, rho, nu):
    """_sabr_implied_vol_hagan_A31_fprime_by_underlying
    See :py:func:`_sabr_implied_vol_hagan_A31`.

Severity: Major
Found in mafipy/function/sabr.py and 1 other location - About 1 day to fix
mafipy/function/sabr.py on lines 893..918

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 161.

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 _sabr_implied_vol_hagan_A31_fprime_by_strike(
        underlying, strike, maturity, alpha, beta, rho, nu):
    """_sabr_implied_vol_hagan_A31_fprime_by_strike
    See :py:func:`_sabr_implied_vol_hagan_A31`.

Severity: Major
Found in mafipy/function/sabr.py and 1 other location - About 1 day to fix
mafipy/function/sabr.py on lines 955..980

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 161.

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 _sabr_implied_vol_hagan_A1_fhess_by_underlying(
        underlying, strike, maturity, alpha, beta, rho, nu):
    """_sabr_implied_vol_hagan_A1_fhess_by_underlying
    See :py:func:`_sabr_implied_vol_hagan_A1`.

Severity: Major
Found in mafipy/function/sabr.py and 1 other location - About 1 day to fix
mafipy/function/sabr.py on lines 619..648

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 144.

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 _sabr_implied_vol_hagan_A1_fhess_by_strike(
        underlying, strike, maturity, alpha, beta, rho, nu):
    """_sabr_implied_vol_hagan_A1_fhess_by_strike
    See :py:func:`_sabr_implied_vol_hagan_A1`.

Severity: Major
Found in mafipy/function/sabr.py and 1 other location - About 1 day to fix
mafipy/function/sabr.py on lines 679..708

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 144.

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

    @pytest.mark.parametrize(
        "underlying, strike, maturity, alpha, beta, rho, nu", [
            (0.0357, 0.03, 2, 0.036, 0.5, -0.25, 0.35)
        ])
    def test_model__sabr_implied_vol_hagan_A1_fhess_by_underlying(
Severity: Major
Found in mafipy/function/tests/test_sabr.py and 1 other location - About 1 day to fix
mafipy/function/tests/test_sabr.py on lines 534..550

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 142.

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

    @pytest.mark.parametrize(
        "underlying, strike, maturity, alpha, beta, rho, nu", [
            (0.0357, 0.03, 2, 0.036, 0.5, -0.25, 0.35)
        ])
    def test_model__sabr_implied_vol_hagan_A1_fhess_by_strike(
Severity: Major
Found in mafipy/function/tests/test_sabr.py and 1 other location - About 1 day to fix
mafipy/function/tests/test_sabr.py on lines 496..512

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 142.

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

    @pytest.mark.parametrize(
        "underlying, strike, maturity, alpha, beta, rho, nu", [
            (0.0357, 0.03, 2, 0.036, 0.5, -0.25, 0.35)
        ])
    def test_model_sabr_implied_vol_hagan_fhess_by_underlying(
Severity: Major
Found in mafipy/function/tests/test_sabr.py and 1 other location - About 1 day to fix
mafipy/function/tests/test_sabr.py on lines 237..254

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 142.

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

    @pytest.mark.parametrize(
        "underlying, strike, maturity, alpha, beta, rho, nu", [
            (0.0357, 0.03, 2, 0.036, 0.5, -0.25, 0.35)
        ])
    def test_model_sabr_implied_vol_hagan_fhess_by_strike(
Severity: Major
Found in mafipy/function/tests/test_sabr.py and 1 other location - About 1 day to fix
mafipy/function/tests/test_sabr.py on lines 197..214

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 142.

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

    @pytest.mark.parametrize(
        "underlying, strike, rate, maturity, vol, expect", [
            # maturity < 0 raise AssertionError
            (2.0, 1.0, 1.0, -1.0, 1.0, 1.0),
            # vol < 0 raise AssertionError
Severity: Major
Found in mafipy/replication/tests/test_pricer_quanto_cms.py and 1 other location - About 1 day to fix
mafipy/replication/tests/test_pricer_quanto_cms.py on lines 142..163

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 140.

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

    @pytest.mark.parametrize(
        "underlying, strike, rate, maturity, vol, expect", [
            # maturity < 0 raise AssertionError
            (2.0, 1.0, 1.0, -1.0, 1.0, 1.0),
            # vol < 0 raise AssertionError
Severity: Major
Found in mafipy/replication/tests/test_pricer_quanto_cms.py and 1 other location - About 1 day to fix
mafipy/replication/tests/test_pricer_quanto_cms.py on lines 120..140

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 140.

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 8 locations. Consider refactoring.
Open

    @pytest.mark.parametrize(
        "underlying, strike, maturity, alpha, beta, rho, nu", [
            (0.0357, 0.03, 2, 0.036, 0.5, -0.25, 0.35)
        ])
    def test_model__sabr_implied_vol_hagan_A3_fprime_by_underlying(
Severity: Major
Found in mafipy/function/tests/test_sabr.py and 7 other locations - About 1 day to fix
mafipy/function/tests/test_sabr.py on lines 217..234
mafipy/function/tests/test_sabr.py on lines 297..314
mafipy/function/tests/test_sabr.py on lines 317..334
mafipy/function/tests/test_sabr.py on lines 397..414
mafipy/function/tests/test_sabr.py on lines 417..434
mafipy/function/tests/test_sabr.py on lines 457..474
mafipy/function/tests/test_sabr.py on lines 515..531

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 138.

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 8 locations. Consider refactoring.
Open

    @pytest.mark.parametrize(
        "underlying, strike, maturity, alpha, beta, rho, nu", [
            (0.0357, 0.03, 2, 0.036, 0.5, -0.25, 0.35)
        ])
    def test_model__sabr_implied_vol_hagan_A3_fhess_by_underlying(
Severity: Major
Found in mafipy/function/tests/test_sabr.py and 7 other locations - About 1 day to fix
mafipy/function/tests/test_sabr.py on lines 217..234
mafipy/function/tests/test_sabr.py on lines 297..314
mafipy/function/tests/test_sabr.py on lines 317..334
mafipy/function/tests/test_sabr.py on lines 377..394
mafipy/function/tests/test_sabr.py on lines 417..434
mafipy/function/tests/test_sabr.py on lines 457..474
mafipy/function/tests/test_sabr.py on lines 515..531

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 138.

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 7 locations. Consider refactoring.
Open

    @pytest.mark.parametrize(
        "underlying, strike, maturity, alpha, beta, rho, nu", [
            (0.0357, 0.03, 2, 0.036, 0.5, -0.25, 0.35)
        ])
    def test_model__sabr_implied_vol_hagan_A1_fprime_by_strike(
Severity: Major
Found in mafipy/function/tests/test_sabr.py and 6 other locations - About 1 day to fix
mafipy/function/tests/test_sabr.py on lines 257..274
mafipy/function/tests/test_sabr.py on lines 277..294
mafipy/function/tests/test_sabr.py on lines 337..354
mafipy/function/tests/test_sabr.py on lines 357..374
mafipy/function/tests/test_sabr.py on lines 437..454
mafipy/function/tests/test_sabr.py on lines 477..493

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 138.

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 8 locations. Consider refactoring.
Open

    @pytest.mark.parametrize(
        "underlying, strike, maturity, alpha, beta, rho, nu", [
            (0.0357, 0.03, 2, 0.036, 0.5, -0.25, 0.35)
        ])
    def test_model__sabr_implied_vol_hagan_A2_fprime_by_underlying(
Severity: Major
Found in mafipy/function/tests/test_sabr.py and 7 other locations - About 1 day to fix
mafipy/function/tests/test_sabr.py on lines 217..234
mafipy/function/tests/test_sabr.py on lines 317..334
mafipy/function/tests/test_sabr.py on lines 377..394
mafipy/function/tests/test_sabr.py on lines 397..414
mafipy/function/tests/test_sabr.py on lines 417..434
mafipy/function/tests/test_sabr.py on lines 457..474
mafipy/function/tests/test_sabr.py on lines 515..531

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 138.

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 8 locations. Consider refactoring.
Open

    @pytest.mark.parametrize(
        "underlying, strike, maturity, alpha, beta, rho, nu", [
            (0.0357, 0.03, 2, 0.036, 0.5, -0.25, 0.35)
        ])
    def test_model__sabr_implied_vol_hagan_A2_fhess_by_underlying(
Severity: Major
Found in mafipy/function/tests/test_sabr.py and 7 other locations - About 1 day to fix
mafipy/function/tests/test_sabr.py on lines 217..234
mafipy/function/tests/test_sabr.py on lines 297..314
mafipy/function/tests/test_sabr.py on lines 377..394
mafipy/function/tests/test_sabr.py on lines 397..414
mafipy/function/tests/test_sabr.py on lines 417..434
mafipy/function/tests/test_sabr.py on lines 457..474
mafipy/function/tests/test_sabr.py on lines 515..531

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 138.

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

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

Severity: Major
Found in mafipy/replication/tests/util.py and 1 other location - About 1 day to fix
mafipy/function/tests/util.py on lines 0..25

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 138.

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

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

Severity: Major
Found in mafipy/function/tests/util.py and 1 other location - About 1 day to fix
mafipy/replication/tests/util.py on lines 0..25

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 138.

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 7 locations. Consider refactoring.
Open

    @pytest.mark.parametrize(
        "underlying, strike, maturity, alpha, beta, rho, nu", [
            (0.0357, 0.03, 2, 0.036, 0.5, -0.25, 0.35)
        ])
    def test_model__sabr_implied_vol_hagan_A2_fhess_by_strike(
Severity: Major
Found in mafipy/function/tests/test_sabr.py and 6 other locations - About 1 day to fix
mafipy/function/tests/test_sabr.py on lines 177..194
mafipy/function/tests/test_sabr.py on lines 257..274
mafipy/function/tests/test_sabr.py on lines 337..354
mafipy/function/tests/test_sabr.py on lines 357..374
mafipy/function/tests/test_sabr.py on lines 437..454
mafipy/function/tests/test_sabr.py on lines 477..493

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 138.

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 7 locations. Consider refactoring.
Open

    @pytest.mark.parametrize(
        "underlying, strike, maturity, alpha, beta, rho, nu", [
            (0.0357, 0.03, 2, 0.036, 0.5, -0.25, 0.35)
        ])
    def test_model__sabr_implied_vol_hagan_A3_fhess_by_strike(
Severity: Major
Found in mafipy/function/tests/test_sabr.py and 6 other locations - About 1 day to fix
mafipy/function/tests/test_sabr.py on lines 177..194
mafipy/function/tests/test_sabr.py on lines 257..274
mafipy/function/tests/test_sabr.py on lines 277..294
mafipy/function/tests/test_sabr.py on lines 337..354
mafipy/function/tests/test_sabr.py on lines 437..454
mafipy/function/tests/test_sabr.py on lines 477..493

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 138.

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 8 locations. Consider refactoring.
Open

    @pytest.mark.parametrize(
        "underlying, strike, maturity, alpha, beta, rho, nu", [
            (0.0357, 0.03, 2, 0.036, 0.5, -0.25, 0.35)
        ])
    def test_model__sabr_implied_vol_hagan_A4_fprime_by_underlying(
Severity: Major
Found in mafipy/function/tests/test_sabr.py and 7 other locations - About 1 day to fix
mafipy/function/tests/test_sabr.py on lines 217..234
mafipy/function/tests/test_sabr.py on lines 297..314
mafipy/function/tests/test_sabr.py on lines 317..334
mafipy/function/tests/test_sabr.py on lines 377..394
mafipy/function/tests/test_sabr.py on lines 397..414
mafipy/function/tests/test_sabr.py on lines 457..474
mafipy/function/tests/test_sabr.py on lines 515..531

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 138.

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

Severity
Category
Status
Source
Language