espressopp/espressopp

View on GitHub

Showing 1,134 of 1,134 total issues

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

    restraintAngle.addTriples([(restraintAtoms['a'],restraintAtoms['A'],restraintAtoms['B'])])
Severity: Minor
Found in src/tools/prepareComplexMolecules.py and 1 other location - About 35 mins to fix
src/tools/prepareComplexMolecules.py on lines 211..211

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

for k in range(2):
    integrator.run(isteps)
    espressopp.tools.analyse.info(system, integrator)
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/polymer_melt_from_restart.py on lines 190..192
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

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

        i = numpy.where(abs(numpy.real(w)) < 1e-8)[0]
Severity: Minor
Found in src/external/transformations.py and 1 other location - About 35 mins to fix
src/external/transformations.py on lines 525..525

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

for step in range(equil_nloops):
    # perform equilibration_isteps integration steps
    integrator.run(equil_isteps)
    # print status information
    espressopp.tools.analyse.info(system, integrator)
Severity: Major
Found in examples/vec/lennard_jones/lennard_jones.py and 5 other locations - About 35 mins to fix
examples/lennard_jones/lennard_jones.py on lines 269..273
examples/lennard_jones_em/lennard_jones.py on lines 198..202
testsuite/vec/test_vec_lennard_jones.py on lines 96..98
testsuite/vec/test_vec_polymer_melt.py on lines 114..116
testsuite/verlet_list_buffer/verlet_list_buffer.py on lines 72..74

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

    cellsX = halfCellInt * round(cursor[0] / rc_skin - 0.5)
Severity: Minor
Found in src/tools/decomp.py and 2 other locations - About 35 mins to fix
src/tools/decomp.py on lines 435..435
src/tools/decomp.py on lines 436..436

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

potSWpair = espressopp.interaction.StillingerWeberPairTerm(A=_A, B=_B, p=_p, q=_q, epsilon=_eps, sigma=_sig, cutoff=rc)
Severity: Minor
Found in examples/stillinger_weber_Si/stillinger_weber_silicon.py and 1 other location - About 35 mins to fix
src/tools/gromacs.py on lines 1262..1262

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

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

        i = numpy.where(abs(numpy.real(w)) < 1e-8)[0]
Severity: Minor
Found in src/external/transformations.py and 1 other location - About 35 mins to fix
src/external/transformations.py on lines 532..532

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

                [wholeNeiListX_CG.append((totCellsCG - 1) / totNodesCG) for i in range(totNodesCG)]
Severity: Minor
Found in src/tools/loadbal.py and 2 other locations - About 35 mins to fix
src/tools/loadbal.py on lines 317..317
src/tools/loadbal.py on lines 356..356

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

    for k in range(nsteps):
        integrator.run(isteps)
        espressopp.tools.analyse.info(system, integrator)
Severity: Major
Found in testsuite/verlet_list_buffer/verlet_list_buffer.py and 5 other locations - About 35 mins to fix
examples/lennard_jones/lennard_jones.py on lines 269..273
examples/lennard_jones_em/lennard_jones.py on lines 198..202
examples/vec/lennard_jones/lennard_jones.py on lines 325..329
testsuite/vec/test_vec_lennard_jones.py on lines 96..98
testsuite/vec/test_vec_polymer_melt.py on lines 114..116

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

                [wholeNeiListX_EH.append((totCellsEH - 1) / totNodesEH) for i in range(totNodesEH)]
Severity: Minor
Found in src/tools/loadbal.py and 2 other locations - About 35 mins to fix
src/tools/loadbal.py on lines 317..317
src/tools/loadbal.py on lines 378..378

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

    restraintAngle.addTriples([(restraintAtoms['b'],restraintAtoms['a'],restraintAtoms['A'])])
Severity: Minor
Found in src/tools/prepareComplexMolecules.py and 1 other location - About 35 mins to fix
src/tools/prepareComplexMolecules.py on lines 205..205

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

Avoid too many return statements within this function.
Open

        return True
Severity: Major
Found in src/RealND.py - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

        return q0
    Severity: Major
    Found in src/external/transformations.py - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                          return False
      Severity: Major
      Found in src/RealND.py - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                return bonds, angles, dihedrals, x, y, z, Lx, Ly, Lz
        Severity: Major
        Found in src/tools/lammps.py - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                  return p_type, masses, epsilon, sigma, K, r0, bonds, bonds_type_arr, Kt, t0, angles, angles_type_arr, q, x, y, z, Lx, Ly, Lz, vx, vy, vz
          Severity: Major
          Found in src/tools/lammps.py - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                            return positions, bonds
            Severity: Major
            Found in src/tools/topology.py - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                      return bonds, angles, x, y, z, Lx, Ly, Lz
              Severity: Major
              Found in src/tools/lammps.py - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                                return positions, bonds, dihedrals, avecostheta
                Severity: Major
                Found in src/tools/topology.py - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                                  return positions, bonds, dihedrals
                  Severity: Major
                  Found in src/tools/topology.py - About 30 mins to fix
                    Severity
                    Category
                    Status
                    Source
                    Language