espressopp/espressopp

View on GitHub
examples/hierarchical_strategy_for_one-component/polymer_melt_from_restart.py

Summary

Maintainability
F
3 days
Test Coverage

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

def writeTabFile(pot, name, N, low=0.0, high=2.5, body=2):

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

    def writeTabFile(pot, name, N, low=0.0, high=2.5, body=2):
        outfile = open(name, "w")
        delta = (high - low) / (N - 1)
    
        for i in range(int(N)):
    examples/hierarchical_strategy_for_one-component/reinsertion.py on lines 65..78

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

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

    for i in range(3):
        line = input_file.readline()
        parameters = line.split()
        if parameters[0] == "num_chains:":
            num_chains = int(parameters[1])
    examples/hierarchical_strategy_for_one-component/generate_microscopic-c.py on lines 20..28
    examples/hierarchical_strategy_for_one-component/reinsertion.py on lines 24..32

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

    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

                res_positions = espressopp.Real3D((float(parameters[6 - i_diff]) + 2.*L)%L,
                                                  (float(parameters[7 - i_diff]) + 2.*L)%L,
                                                  (float(parameters[8 - i_diff]) + 2.*L)%L)
    examples/hierarchical_strategy_for_one-component/reinsertion.py on lines 134..136

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

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

    for k in range(20):
        steepest.run(isteps)
        espressopp.tools.analyse.info(system, steepest)
    examples/hierarchical_strategy_for_one-component/generate_microscopic-c.py on lines 137..139
    examples/hierarchical_strategy_for_one-component/generate_microscopic-c.py on lines 147..149
    examples/hierarchical_strategy_for_one-component/generate_microscopic-c.py on lines 153..155
    examples/hierarchical_strategy_for_one-component/reinsertion.py on lines 328..330
    examples/hierarchical_strategy_for_one-component/reinsertion.py on lines 334..336

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

    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

    for k in range(100):
        integrator.run(1000)
        espressopp.tools.analyse.info(system, integrator)
    examples/fix_particles/fix_particles.py on lines 60..62
    examples/lj_cos/lj_cos.py on lines 161..163
    examples/stillinger_weber_Si/stillinger_weber_silicon.py on lines 196..198
    src/tools/warmup.py on lines 67..69
    testsuite/pickle_potential/warmup/testWarmup.py on lines 68..70
    testsuite/pickle_potential/warmup/testWarmup.py on lines 75..77

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

    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

    There are no issues that match your filters.

    Category
    Status