espressopp/espressopp

View on GitHub

Showing 649 of 1,134 total issues

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

def prewrite_expected_files(file_list_expected):
    length_unit_test = "LJ"
    header_lines = [
        'system description, current step=0, length unit=%s\n' % (length_unit_test),
        '    5\n'
Severity: Major
Found in testsuite/FileIOTests/dump_gromacs/test_dump_gromacs.py and 1 other location - About 7 hrs to fix
testsuite/FileIOTests/dump_gromacs_adress/test_dump_gromacs_adress.py on lines 47..71

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

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

def prewrite_expected_files(file_list_expected):
    length_unit_test = "LJ"
    header_lines = [
        'system description, current step=0, length unit=%s\n' % (length_unit_test),
        '    5\n'
testsuite/FileIOTests/dump_gromacs/test_dump_gromacs.py on lines 34..58

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

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

        tf_damp[2] =   (1.0 - dist_unitv[2]*dist_unitv[2])*veldiff[2] \
                     - dist_unitv[2]*dist_unitv[0]*veldiff[0]         \
                     - dist_unitv[2]*dist_unitv[1]*veldiff[1]
Severity: Major
Found in testsuite/DPDThermostat/testDPDThermostat.py and 5 other locations - About 7 hrs to fix
testsuite/DPDThermostat/testDPDThermostat.py on lines 109..111
testsuite/DPDThermostat/testDPDThermostat.py on lines 112..114
testsuite/DPDThermostat/testDPDThermostat.py on lines 128..130
testsuite/DPDThermostat/testDPDThermostat.py on lines 131..133
testsuite/DPDThermostat/testDPDThermostat.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 119.

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

        tf_noise[1] =   (1.0 - dist_unitv[1]*dist_unitv[1])*randvec[1] \
                      - dist_unitv[1]*dist_unitv[0]*randvec[0]         \
                      - dist_unitv[1]*dist_unitv[2]*randvec[2]
Severity: Major
Found in testsuite/DPDThermostat/testDPDThermostat.py and 5 other locations - About 7 hrs to fix
testsuite/DPDThermostat/testDPDThermostat.py on lines 109..111
testsuite/DPDThermostat/testDPDThermostat.py on lines 112..114
testsuite/DPDThermostat/testDPDThermostat.py on lines 115..117
testsuite/DPDThermostat/testDPDThermostat.py on lines 128..130
testsuite/DPDThermostat/testDPDThermostat.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 119.

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

        tf_noise[2] =   (1.0 - dist_unitv[2]*dist_unitv[2])*randvec[2] \
                      - dist_unitv[2]*dist_unitv[0]*randvec[0]         \
                      - dist_unitv[2]*dist_unitv[1]*randvec[1]
Severity: Major
Found in testsuite/DPDThermostat/testDPDThermostat.py and 5 other locations - About 7 hrs to fix
testsuite/DPDThermostat/testDPDThermostat.py on lines 109..111
testsuite/DPDThermostat/testDPDThermostat.py on lines 112..114
testsuite/DPDThermostat/testDPDThermostat.py on lines 115..117
testsuite/DPDThermostat/testDPDThermostat.py on lines 128..130
testsuite/DPDThermostat/testDPDThermostat.py on lines 131..133

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

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

        tf_noise[0] =   (1.0 - dist_unitv[0]*dist_unitv[0])*randvec[0] \
                      - dist_unitv[0]*dist_unitv[1]*randvec[1]         \
                      - dist_unitv[0]*dist_unitv[2]*randvec[2]
Severity: Major
Found in testsuite/DPDThermostat/testDPDThermostat.py and 5 other locations - About 7 hrs to fix
testsuite/DPDThermostat/testDPDThermostat.py on lines 109..111
testsuite/DPDThermostat/testDPDThermostat.py on lines 112..114
testsuite/DPDThermostat/testDPDThermostat.py on lines 115..117
testsuite/DPDThermostat/testDPDThermostat.py on lines 131..133
testsuite/DPDThermostat/testDPDThermostat.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 119.

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

        tf_damp[0] =   (1.0 - dist_unitv[0]*dist_unitv[0])*veldiff[0] \
                     - dist_unitv[0]*dist_unitv[1]*veldiff[1]         \
                     - dist_unitv[0]*dist_unitv[2]*veldiff[2]
Severity: Major
Found in testsuite/DPDThermostat/testDPDThermostat.py and 5 other locations - About 7 hrs to fix
testsuite/DPDThermostat/testDPDThermostat.py on lines 112..114
testsuite/DPDThermostat/testDPDThermostat.py on lines 115..117
testsuite/DPDThermostat/testDPDThermostat.py on lines 128..130
testsuite/DPDThermostat/testDPDThermostat.py on lines 131..133
testsuite/DPDThermostat/testDPDThermostat.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 119.

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

        tf_damp[1] =   (1.0 - dist_unitv[1]*dist_unitv[1])*veldiff[1] \
                     - dist_unitv[1]*dist_unitv[0]*veldiff[0]         \
                     - dist_unitv[1]*dist_unitv[2]*veldiff[2]
Severity: Major
Found in testsuite/DPDThermostat/testDPDThermostat.py and 5 other locations - About 7 hrs to fix
testsuite/DPDThermostat/testDPDThermostat.py on lines 109..111
testsuite/DPDThermostat/testDPDThermostat.py on lines 115..117
testsuite/DPDThermostat/testDPDThermostat.py on lines 128..130
testsuite/DPDThermostat/testDPDThermostat.py on lines 131..133
testsuite/DPDThermostat/testDPDThermostat.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 119.

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

    if(num_types == 1):
        rstart = 3
        if(num_bonds == 0): rstart = 2

        x = []
Severity: Major
Found in src/tools/lammps.py and 1 other location - About 7 hrs to fix
src/tools/lammps.py on lines 231..257

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

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

    if(num_types == 1):
        rstart = 3
        if(num_bonds == 0): rstart = 2

        p_type = []
Severity: Major
Found in src/tools/lammps.py and 1 other location - About 7 hrs to fix
src/tools/lammps.py on lines 66..90

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

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

            if pi!=pj:
                sig=0.5*(float(pi['sig'])+float(pj['sig']))
                eps=math.sqrt(float(pi['eps'])*float(pj['eps']))
            else:
                sig=float(pi['sig'])
Severity: Major
Found in src/tools/gromacs.py and 2 other locations - About 7 hrs to fix
src/tools/gromacs.py on lines 1168..1173
src/tools/gromacs.py on lines 1212..1217

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

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

            if pi!=pj:
                sig=0.5*(float(pi['sig'])+float(pj['sig']))
                eps=math.sqrt(float(pi['eps'])*float(pj['eps']))
            else:
                sig=float(pi['sig'])
Severity: Major
Found in src/tools/gromacs.py and 2 other locations - About 7 hrs to fix
src/tools/gromacs.py on lines 1119..1124
src/tools/gromacs.py on lines 1168..1173

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

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

            if pi!=pj:
                sig=0.5*(float(pi['sig'])+float(pj['sig']))
                eps=math.sqrt(float(pi['eps'])*float(pj['eps']))
            else:
                sig=float(pi['sig'])
Severity: Major
Found in src/tools/gromacs.py and 2 other locations - About 7 hrs to fix
src/tools/gromacs.py on lines 1119..1124
src/tools/gromacs.py on lines 1212..1217

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

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

    for m in unique_masses:
        fpl=espressopp.FixedPairList(system.storage)
        k=m*P*P*langevin.temperature*langevin.temperature/(hbar*hbar)
        pot=espressopp.interaction.Harmonic(k,0.0)
        interb = espressopp.interaction.FixedPairListHarmonic(system, fpl, pot)
Severity: Major
Found in testsuite/pi_water/pathintegral.py and 1 other location - About 7 hrs to fix
src/tools/pathintegral.py on lines 259..265

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

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/polymer_melt_from_restart.py on lines 124..126

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

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

    for m in unique_masses:
        fpl=espressopp.FixedPairList(system.storage)
        k=m*P*P*langevin.temperature*langevin.temperature/(hbar*hbar)
        pot=espressopp.interaction.Harmonic(k,0.0)
        interb = espressopp.interaction.FixedPairListHarmonic(system, fpl, pot)
Severity: Major
Found in src/tools/pathintegral.py and 1 other location - About 7 hrs to fix
testsuite/pi_water/pathintegral.py on lines 135..141

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

class TabulatedDihedralInteractionType(InteractionType):
    def createEspressoInteraction(self, system, fpl):
        spline = 3
        fg = "table_d"+str(self.parameters['tablenr'])+".xvg"
        fe = fg.split(".")[0]+".tab" # name of espressopp file
Severity: Major
Found in src/tools/topology_helper.py and 1 other location - About 7 hrs to fix
src/tools/topology_helper.py on lines 159..167

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

class TabulatedAngleInteractionType(InteractionType):
    def createEspressoInteraction(self, system, fpl):
        spline = 3
        fg = "table_a"+str(self.parameters['tablenr'])+".xvg"
        fe = fg.split(".")[0]+".tab" # name of espressopp file
Severity: Major
Found in src/tools/topology_helper.py and 1 other location - About 7 hrs to fix
src/tools/topology_helper.py on lines 169..177

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

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

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

    while pid <= num_particles:
        type = 0
        mass = 1.0
        pos  = system.bc.getRandomPos()
        vel  = espressopp.Real3D(0.0, 0.0, 0.0)
Severity: Major
Found in src/standard_system/Minimal.py and 1 other location - About 7 hrs to fix
src/standard_system/LennardJones.py on lines 130..141

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

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