espressopp/espressopp

View on GitHub
src/tools/gromacs.py

Summary

Maintainability
F
1 mo
Test Coverage

Function read has a Cognitive Complexity of 273 (exceeds 5 allowed). Consider refactoring.
Open

def read(gro_file, top_file="", doRegularExcl=True):
    """ Read GROMACS data files.

    Arguments:
    :param gro_file: -- contains coordinates of all particles, the number of particles, velocities and box size.
Severity: Minor
Found in src/tools/gromacs.py - About 5 days to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

File gromacs.py has 1100 lines of code (exceeds 250 allowed). Consider refactoring.
Open

#  Copyright (C) 2012,2013,2015(H),2016
#      Max Planck Institute for Polymer Research
#  Copyright (C) 2008,2009,2010,2011
#      Max-Planck-Institute for Polymer Research & Fraunhofer SCAI
#
Severity: Major
Found in src/tools/gromacs.py - About 2 days to fix

    Function storeImpropers has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring.
    Open

    def storeImpropers(f, types, impropertypes, impropertypeparams, impropers, num_atoms_molecule, num_molecule_copies, molstartindex, atomtype_wildcard):
        print('#Warning! This parser of the improper angles section of gromacs-format forcefield files is for the Amber forcefield only. Other forcefields may have a different atom ordering. See storeImpropers in gromacs.py for further details.')
        line = ''
        impropers_tmp = []
        pos = f.tell()
    Severity: Minor
    Found in src/tools/gromacs.py - About 1 day to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function storeDihedrals has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
    Open

    def storeDihedrals(f, types, dihedraltypes, dihedraltypeparams, dihedrals, num_atoms_molecule, num_molecule_copies, molstartindex, atomtype_wildcard):
        line = ''
        dihedrals_tmp = []
        pos = f.tell()
        line=f.readlastline()
    Severity: Minor
    Found in src/tools/gromacs.py - About 4 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function setLennardJonesInteractionsTI has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
    Open

    def setLennardJonesInteractionsTI(system, defaults, atomtypeparams, verletlist, cutoff, epsilonB, sigmaSC, alphaSC, powerSC, lambdaTI, pidlist, annihilate=True, hadress=False, adress=False, ftpl=None):
        """ Set lennard jones interactions which were read from gromacs based on the atomypes"""
        if (hadress and adress):
            print("Error! In gromacs.setLennardJonesInteractionsTI, you cannot use adress and hadress at the same time")
            return
    Severity: Minor
    Found in src/tools/gromacs.py - About 4 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function setLennardJonesInteractions has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
    Open

    def setLennardJonesInteractions(system, defaults, atomtypeparams, verletlist, cutoff, hadress=False, adress=False, ftpl=None):
        """ Set lennard jones interactions which were read from gromacs based on the atomypes"""
        if (hadress and adress):
            print("Error! In gromacs.setLennardJonesInteractions, you cannot use adress and hadress at the same time")
            return
    Severity: Minor
    Found in src/tools/gromacs.py - About 4 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function storeBonds has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
    Open

    def storeBonds(f, types, bondtypes, bondtypeparams, bonds, num_atoms_molecule,\
        num_molecule_copies, molstartindex, exclusions, nregxcl, doRegularExcl=True):
        line = ''
        bonds_tmp = []
        top = False
    Severity: Minor
    Found in src/tools/gromacs.py - About 4 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function convertTable has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
    Open

    def convertTable(gro_in_file, esp_out_file, sigma=1.0, epsilon=1.0, c6=1.0, c12=1.0):
        """Convert GROMACS tabulated file into ESPResSo++ tabulated file (new file
        is created). First column of input file can be either distance or angle.
        For non-bonded files, c6 and c12 can be provided. Default value for sigma, epsilon,
        c6 and c12 is 1.0. Electrostatics are not taken into account (f and fd columns).
    Severity: Minor
    Found in src/tools/gromacs.py - About 4 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function setCoulombInteractionsProtein has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
    Open

    def setCoulombInteractionsProtein(system, verletlist, rc, types, epsilon1, epsilonprot,epsilonwat,kappa,otype,htype, hadress=False, adress=False, ftpl=None):
    
        print("# Setting up Coulomb reaction field interactions")
        print("# Using ",epsilonwat," for water and wat-prot and ",epsilonprot," for protein")
    
    
    Severity: Minor
    Found in src/tools/gromacs.py - About 3 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function storeAngles has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
    Open

    def storeAngles(f, types, angletypes, angletypeparams, angles, num_atoms_molecule, num_molecule_copies, molstartindex):
        line = ''
        angles_tmp = []
        pos = f.tell()
        line=f.readlastline()
    Severity: Minor
    Found in src/tools/gromacs.py - About 3 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function setLennardJones14Interactions has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
    Open

    def setLennardJones14Interactions(system, defaults, atomtypeparams, onefourlist, cutoff):
        """ Set lennard jones interactions which were read from gromacs based on the atomypes"""
        interaction = espressopp.interaction.FixedPairListTypesLennardJones(system,onefourlist)
    
        print("# Setting up 1-4 Lennard-Jones interactions")
    Severity: Minor
    Found in src/tools/gromacs.py - About 3 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function read has 48 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    def read(gro_file, top_file="", doRegularExcl=True):
        """ Read GROMACS data files.
    
        Arguments:
        :param gro_file: -- contains coordinates of all particles, the number of particles, velocities and box size.
    Severity: Minor
    Found in src/tools/gromacs.py - About 1 hr to fix

      Function setLennardJonesInteractionsTI has 15 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def setLennardJonesInteractionsTI(system, defaults, atomtypeparams, verletlist, cutoff, epsilonB, sigmaSC, alphaSC, powerSC, lambdaTI, pidlist, annihilate=True, hadress=False, adress=False, ftpl=None):
      Severity: Major
      Found in src/tools/gromacs.py - About 1 hr to fix

        Function storeAtoms has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

        def storeAtoms(f, types, atomtypes, atomtypeparams, masses, charges, num_molecule_copies):
            line = ''
            types_tmp = []
            charge_tmp =[]
            mass_tmp=[]
        Severity: Minor
        Found in src/tools/gromacs.py - About 1 hr to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Consider simplifying this complex logical expression.
        Open

                    if (not angle and not dihedral and r != 0) or \
                         (angle and r <= 3.1415 and r > 0) or \
                          (dihedral and r >= -3.1415 and r <= 3.1415):
                        fout.write("%15.8g %15.8g %15.8g\n" % (r, e, f))
        
        
        Severity: Critical
        Found in src/tools/gromacs.py - About 1 hr to fix

          Function setCoulombInteractionsTI has 13 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          def setCoulombInteractionsTI(system, verletlist, rc, types, epsilon1, epsilon2,kappa, lambdaTI, pidlist, annihilate=True, hadress=False, adress=False, ftpl=None):
          Severity: Major
          Found in src/tools/gromacs.py - About 1 hr to fix

            Function setCoulombInteractionsProtein has 13 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            def setCoulombInteractionsProtein(system, verletlist, rc, types, epsilon1, epsilonprot,epsilonwat,kappa,otype,htype, hadress=False, adress=False, ftpl=None):
            Severity: Major
            Found in src/tools/gromacs.py - About 1 hr to fix

              Function setCoulombInteractions has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
              Open

              def setCoulombInteractions(system, verletlist, rc, types, epsilon1, epsilon2,kappa, hadress=False, adress=False, ftpl=None):
              
                  print("# Setting up Coulomb reaction field interactions")
              
                  pref=138.935485 # we want gromacs units, so this is 1/(4 pi eps_0) ins units of kJ mol^-1 e^-2
              Severity: Minor
              Found in src/tools/gromacs.py - About 1 hr to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Function setCoulombInteractionsTI has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
              Open

              def setCoulombInteractionsTI(system, verletlist, rc, types, epsilon1, epsilon2,kappa, lambdaTI, pidlist, annihilate=True, hadress=False, adress=False, ftpl=None):
              
                  print("# Setting up Coulomb reaction field interactions for TI simulation with lambda = ",lambdaTI)
              
                  pref=138.935485 # we want gromacs units, so this is 1/(4 pi eps_0) ins units of kJ mol^-1 e^-2
              Severity: Minor
              Found in src/tools/gromacs.py - About 1 hr to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Function storeBonds has 11 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              def storeBonds(f, types, bondtypes, bondtypeparams, bonds, num_atoms_molecule,\
              Severity: Major
              Found in src/tools/gromacs.py - About 1 hr to fix

                Function setCoulombInteractions has 10 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                def setCoulombInteractions(system, verletlist, rc, types, epsilon1, epsilon2,kappa, hadress=False, adress=False, ftpl=None):
                Severity: Major
                Found in src/tools/gromacs.py - About 1 hr to fix

                  Function storeDihedrals has 9 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  def storeDihedrals(f, types, dihedraltypes, dihedraltypeparams, dihedrals, num_atoms_molecule, num_molecule_copies, molstartindex, atomtype_wildcard):
                  Severity: Major
                  Found in src/tools/gromacs.py - About 1 hr to fix

                    Function storeImpropers has 9 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                    def storeImpropers(f, types, impropertypes, impropertypeparams, impropers, num_atoms_molecule, num_molecule_copies, molstartindex, atomtype_wildcard):
                    Severity: Major
                    Found in src/tools/gromacs.py - About 1 hr to fix

                      Function setLennardJonesInteractions has 8 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                      def setLennardJonesInteractions(system, defaults, atomtypeparams, verletlist, cutoff, hadress=False, adress=False, ftpl=None):
                      Severity: Major
                      Found in src/tools/gromacs.py - About 1 hr to fix

                        Function storeAngles has 8 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                        def storeAngles(f, types, angletypes, angletypeparams, angles, num_atoms_molecule, num_molecule_copies, molstartindex):
                        Severity: Major
                        Found in src/tools/gromacs.py - About 1 hr to fix

                          Function storeAtoms has 7 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                          def storeAtoms(f, types, atomtypes, atomtypeparams, masses, charges, num_molecule_copies):
                          Severity: Major
                          Found in src/tools/gromacs.py - About 50 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                if i in dihedraltypes:
                                                    if j in dihedraltypes[i]:
                                                        if k in dihedraltypes[i][j]:
                                                            if l in dihedraltypes[i][j][k]:
                                                                dihedraltypes[i][j][k][l]+=(dtypeid,)
                            Severity: Major
                            Found in src/tools/gromacs.py - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                  if (nextline[4]=='8'): print('Warning: Assuming dihedraltypes of function type 8 are dihedrals, not impropers')
                                              else:
                              Severity: Major
                              Found in src/tools/gromacs.py - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                    if len(fields)==7:
                                                        tmpprop={"atnum":int(fields[1]), "mass": float(fields[2]),
                                                        "charge":float(fields[3]), "particletype":fields[4],
                                                        "sig":float(fields[5]), "eps":float(fields[6])}
                                                    else:
                                Severity: Major
                                Found in src/tools/gromacs.py - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                      if bdtypeid==None:
                                                          bdtypeid=len(bondtypeparams)
                                                          bondtypeparams.update({bdtypeid:p})
                                  
                                  
                                  Severity: Major
                                  Found in src/tools/gromacs.py - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                        if atypeid==None:
                                                            atypeid=len(angletypeparams)
                                                            angletypeparams.update({atypeid:p})
                                    
                                    
                                    Severity: Major
                                    Found in src/tools/gromacs.py - About 45 mins to fix

                                      Avoid deeply nested control flow statements.
                                      Open

                                                          if i > j:
                                                              i, j = j, i
                                                          p=ParseBondTypeParam(line)
                                      Severity: Major
                                      Found in src/tools/gromacs.py - About 45 mins to fix

                                        Avoid deeply nested control flow statements.
                                        Open

                                                            if dtypeid==None:
                                                                dtypeid=len(dihedraltypeparams)
                                                                dihedraltypeparams.update({dtypeid:p})
                                                            if i in dihedraltypes:
                                        Severity: Major
                                        Found in src/tools/gromacs.py - About 45 mins to fix

                                          Avoid deeply nested control flow statements.
                                          Open

                                                              for t in sorted(list(atomtypes.items()), key=itemgetter(1)):
                                                                  print(" %s: %d"%(t[0],t[1]))
                                                          else:
                                          Severity: Major
                                          Found in src/tools/gromacs.py - About 45 mins to fix

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

                                            def convertTable(gro_in_file, esp_out_file, sigma=1.0, epsilon=1.0, c6=1.0, c12=1.0):
                                            Severity: Minor
                                            Found in src/tools/gromacs.py - About 45 mins to fix

                                              Avoid deeply nested control flow statements.
                                              Open

                                                                  if i in bondtypes:
                                                                      bondtypes[i].update({j:bdtypeid})
                                                                  else:
                                                                      bondtypes.update({i:{j:bdtypeid}})
                                              
                                              
                                              Severity: Major
                                              Found in src/tools/gromacs.py - About 45 mins to fix

                                                Avoid deeply nested control flow statements.
                                                Open

                                                                    if i in impropertypes:
                                                                        if j in impropertypes[i]:
                                                                            if k in impropertypes[i][j]:
                                                                                if l in impropertypes[i][j][k]:
                                                                                    impropertypes[i][j][k][l]+=(dtypeid,) #not strictly speaking necessary
                                                Severity: Major
                                                Found in src/tools/gromacs.py - About 45 mins to fix

                                                  Avoid deeply nested control flow statements.
                                                  Open

                                                                      if dtypeid==None:
                                                                          dtypeid=len(impropertypeparams)
                                                                          impropertypeparams.update({dtypeid:p})
                                                                      if i in impropertypes:
                                                  Severity: Major
                                                  Found in src/tools/gromacs.py - About 45 mins to fix

                                                    Avoid deeply nested control flow statements.
                                                    Open

                                                                        if len(molecules) == 0:
                                                                            molecules.append({'name':mol, 'count':int(nrmol)})
                                                                        elif molecules[-1]['name'] == mol: #check if mol was added earlier already
                                                                            molecules[-1]['count'] = molecules[-1]['count'] + int(nrmol) #update count
                                                                        else: molecules.append({'name':mol, 'count':int(nrmol)}) #if mol newly added
                                                    Severity: Major
                                                    Found in src/tools/gromacs.py - About 45 mins to fix

                                                      Avoid deeply nested control flow statements.
                                                      Open

                                                                          if len(fields)==5:
                                                                              defaults={"nbtype":fields[0], "combinationrule":fields[1],
                                                                              "genpairs":fields[2], "fudgeLJ":fields[3], "fudgeQQ":fields[4]}
                                                                          else:
                                                                              defaults={"nbtype":fields[0], "combinationrule":fields[1]}
                                                      Severity: Major
                                                      Found in src/tools/gromacs.py - About 45 mins to fix

                                                        Avoid deeply nested control flow statements.
                                                        Open

                                                                            if i in angletypes:
                                                                                if j in angletypes[i]:
                                                                                    angletypes[i][j].update({k:atypeid})
                                                                                else:
                                                                                    angletypes[i].update({j:{k:atypeid}})
                                                        Severity: Major
                                                        Found in src/tools/gromacs.py - About 45 mins to fix

                                                          Function setCoulomb14Interactions has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                          Open

                                                          def setCoulomb14Interactions(system, defaults, onefourlist, rc, types):
                                                          Severity: Minor
                                                          Found in src/tools/gromacs.py - About 35 mins to fix

                                                            Function setLennardJones14Interactions has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                            Open

                                                            def setLennardJones14Interactions(system, defaults, atomtypeparams, onefourlist, cutoff):
                                                            Severity: Minor
                                                            Found in src/tools/gromacs.py - About 35 mins to fix

                                                              Function storeMolecules has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                              Open

                                                              def storeMolecules(f, molecules, mol=""):
                                                                  nrexcl=0
                                                                  line = ''
                                                                  line=f.readlastline()
                                                                  while not 'moleculetype' in line:
                                                              Severity: Minor
                                                              Found in src/tools/gromacs.py - About 35 mins to fix

                                                              Cognitive Complexity

                                                              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                                              A method's cognitive complexity is based on a few simple rules:

                                                              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                                              • Code is considered more complex for each "break in the linear flow of the code"
                                                              • Code is considered more complex when "flow breaking structures are nested"

                                                              Further reading

                                                              Function setTabulatedInteractions has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                              Open

                                                              def setTabulatedInteractions(potentials, particleTypes, system, interaction):
                                                                  """Set interactions for all given particle types.
                                                                  Return value is a system with all interactions added.
                                                              
                                                                  Keyword arguments:
                                                              Severity: Minor
                                                              Found in src/tools/gromacs.py - About 25 mins to fix

                                                              Cognitive Complexity

                                                              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                                              A method's cognitive complexity is based on a few simple rules:

                                                              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                                              • Code is considered more complex for each "break in the linear flow of the code"
                                                              • Code is considered more complex when "flow breaking structures are nested"

                                                              Further reading

                                                              Function setDihedralInteractionsAdress has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                              Open

                                                              def setDihedralInteractionsAdress(system, dihedrals, dihedraltypeparams, ftpl):
                                                                  dihedral_interactions = {}
                                                              
                                                                  for idlist, dihedrallist in dihedrals.items():
                                                                      fpl = espressopp.FixedQuadrupleListAdress(system.storage, ftpl)
                                                              Severity: Minor
                                                              Found in src/tools/gromacs.py - About 25 mins to fix

                                                              Cognitive Complexity

                                                              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                                              A method's cognitive complexity is based on a few simple rules:

                                                              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                                              • Code is considered more complex for each "break in the linear flow of the code"
                                                              • Code is considered more complex when "flow breaking structures are nested"

                                                              Further reading

                                                              Function setImproperInteractions has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                              Open

                                                              def setImproperInteractions(system, impropers, impropertypeparams):
                                                                  improper_interactions = {}
                                                              
                                                                  for idlist, improperlist in list(impropers.items()):
                                                                      fpl = espressopp.FixedQuadrupleList(system.storage)
                                                              Severity: Minor
                                                              Found in src/tools/gromacs.py - About 25 mins to fix

                                                              Cognitive Complexity

                                                              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                                              A method's cognitive complexity is based on a few simple rules:

                                                              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                                              • Code is considered more complex for each "break in the linear flow of the code"
                                                              • Code is considered more complex when "flow breaking structures are nested"

                                                              Further reading

                                                              Function setImproperInteractionsAdress has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                              Open

                                                              def setImproperInteractionsAdress(system, impropers, impropertypeparams, ftpl):
                                                                  improper_interactions = {}
                                                              
                                                                  for idlist, improperlist in impropers.items():
                                                                      fpl = espressopp.FixedQuadrupleListAdress(system.storage, ftpl)
                                                              Severity: Minor
                                                              Found in src/tools/gromacs.py - About 25 mins to fix

                                                              Cognitive Complexity

                                                              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                                              A method's cognitive complexity is based on a few simple rules:

                                                              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                                              • Code is considered more complex for each "break in the linear flow of the code"
                                                              • Code is considered more complex when "flow breaking structures are nested"

                                                              Further reading

                                                              Function setDihedralInteractions has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                              Open

                                                              def setDihedralInteractions(system, dihedrals, dihedraltypeparams):
                                                                  dihedral_interactions = {}
                                                              
                                                                  for idlist, dihedrallist in dihedrals.items():
                                                                      fpl = espressopp.FixedQuadrupleList(system.storage)
                                                              Severity: Minor
                                                              Found in src/tools/gromacs.py - About 25 mins to fix

                                                              Cognitive Complexity

                                                              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                                              A method's cognitive complexity is based on a few simple rules:

                                                              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                                              • Code is considered more complex for each "break in the linear flow of the code"
                                                              • Code is considered more complex when "flow breaking structures are nested"

                                                              Further reading

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

                                                                          if readimptypes:
                                                                              if line.strip() == "" or '[' in line: # end of impropertypes section
                                                                                  readimptypes = False
                                                                              else:
                                                                                  tmp = line.split()
                                                              Severity: Major
                                                              Found in src/tools/gromacs.py and 1 other location - About 3 days to fix
                                                              src/tools/gromacs.py on lines 411..438

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

                                                              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

                                                                          if readdhtypes:
                                                                              if line.strip() == "" or '[' in line: # end of dihedraltypes section
                                                                                  readdhtypes = False
                                                                              else:
                                                                                  tmp = line.split()
                                                              Severity: Major
                                                              Found in src/tools/gromacs.py and 1 other location - About 3 days to fix
                                                              src/tools/gromacs.py on lines 385..409

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

                                                              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

                                                                  for i in range(num_molecule_copies):
                                                                      for j in range(dihedrals_per_mol):
                                                                          pid1, pid2, pid3, pid4, dihtypeid = dihedrals_tmp[j][0:5]
                                                                          ia=molstartindex+pid1 + (i * num_atoms_molecule) # index of copy atom i
                                                                          ib=molstartindex+pid2 + (i * num_atoms_molecule) # index of copy atom j
                                                              Severity: Major
                                                              Found in src/tools/gromacs.py and 1 other location - About 1 day to fix
                                                              src/tools/gromacs.py on lines 939..949

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

                                                              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

                                                                  for i in range(num_molecule_copies):
                                                                      for j in range(impropers_per_mol):
                                                                          pid1, pid2, pid3, pid4, dihtypeid = impropers_tmp[j][0:5]
                                                                          ia=molstartindex+pid1 + (i * num_atoms_molecule) # index of copy atom i
                                                                          ib=molstartindex+pid2 + (i * num_atoms_molecule) # index of copy atom j
                                                              Severity: Major
                                                              Found in src/tools/gromacs.py and 1 other location - About 1 day to fix
                                                              src/tools/gromacs.py on lines 857..867

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

                                                              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 int(defaults['combinationrule'])==1:
                                                                          for atnr, at in atomtypeparams.items():
                                                                              c6=float(at['sig'])
                                                                              c12=float(at['eps'])
                                                                              if c6==0: continue
                                                              Severity: Major
                                                              Found in src/tools/gromacs.py and 1 other location - About 1 day to fix
                                                              src/tools/gromacs.py on lines 1152..1162

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

                                                              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 defaults:
                                                                      if int(defaults['combinationrule'])==1:
                                                                          for atnr, at in atomtypeparams.items():
                                                                              c6=float(at['sig'])
                                                                              c12=float(at['eps'])
                                                              Severity: Major
                                                              Found in src/tools/gromacs.py and 1 other location - About 1 day to fix
                                                              src/tools/gromacs.py on lines 1190..1199

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

                                                              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 setDihedralInteractionsAdress(system, dihedrals, dihedraltypeparams, ftpl):
                                                                  dihedral_interactions = {}
                                                              
                                                                  for idlist, dihedrallist in dihedrals.items():
                                                                      fpl = espressopp.FixedQuadrupleListAdress(system.storage, ftpl)
                                                              Severity: Major
                                                              Found in src/tools/gromacs.py and 1 other location - About 1 day to fix
                                                              src/tools/gromacs.py on lines 1065..1080

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

                                                              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 setImproperInteractionsAdress(system, impropers, impropertypeparams, ftpl):
                                                                  improper_interactions = {}
                                                              
                                                                  for idlist, improperlist in impropers.items():
                                                                      fpl = espressopp.FixedQuadrupleListAdress(system.storage, ftpl)
                                                              Severity: Major
                                                              Found in src/tools/gromacs.py and 1 other location - About 1 day to fix
                                                              src/tools/gromacs.py on lines 1047..1062

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

                                                              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

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

                                                                  for idlist, improperlist in list(impropers.items()):
                                                                      fpl = espressopp.FixedQuadrupleList(system.storage)
                                                                      fpl.addQuadruples(improperlist)
                                                                      for i in range(len(idlist)):
                                                                          interaction_id = idlist[i]
                                                              Severity: Major
                                                              Found in src/tools/gromacs.py and 1 other location - About 6 hrs to fix
                                                              src/tools/gromacs.py on lines 985..996

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

                                                              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

                                                                  for idlist, dihedrallist in dihedrals.items():
                                                                      fpl = espressopp.FixedQuadrupleList(system.storage)
                                                                      fpl.addQuadruples(dihedrallist)
                                                                      for i in range(len(idlist)):
                                                                          interaction_id = idlist[i]
                                                              Severity: Major
                                                              Found in src/tools/gromacs.py and 1 other location - About 6 hrs to fix
                                                              src/tools/gromacs.py on lines 1003..1014

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

                                                              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 i in range(max(types)+1):
                                                                      for k in range(i, max(types)+1):
                                                                          if (hadress or adress):
                                                                              interaction.setPotentialAT(type1=i, type2=k, potential=pot)
                                                                          else:
                                                              Severity: Major
                                                              Found in src/tools/gromacs.py and 1 other location - About 4 hrs to fix
                                                              src/tools/gromacs.py on lines 1281..1286

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

                                                              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 i in range(max(types)+1):
                                                                      for k in range(i, max(types)+1):
                                                                          if (hadress or adress):
                                                                              interaction.setPotentialAT(type1=i, type2=k, potential=pot)
                                                                          else:
                                                              Severity: Major
                                                              Found in src/tools/gromacs.py and 1 other location - About 4 hrs to fix
                                                              src/tools/gromacs.py on lines 1246..1251

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

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

                                                                                          t1, t2, t3, t4 = types[pid4-1], types[pid2-1], types[pid3-1], types[pid1-1]
                                                              Severity: Major
                                                              Found in src/tools/gromacs.py and 3 other locations - About 3 hrs to fix
                                                              src/tools/gromacs.py on lines 825..825
                                                              src/tools/gromacs.py on lines 892..892
                                                              src/tools/gromacs.py on lines 918..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 63.

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

                                                                          t1, t2, t3, t4 = types[pid1-1], types[pid2-1], types[pid3-1], types[pid4-1] # get types of particles
                                                              Severity: Major
                                                              Found in src/tools/gromacs.py and 3 other locations - About 3 hrs to fix
                                                              src/tools/gromacs.py on lines 892..892
                                                              src/tools/gromacs.py on lines 913..913
                                                              src/tools/gromacs.py on lines 918..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 63.

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

                                                                          t1, t2, t3, t4 = types[pid1-1], types[pid2-1], types[pid3-1], types[pid4-1] # get types of particles
                                                              Severity: Major
                                                              Found in src/tools/gromacs.py and 3 other locations - About 3 hrs to fix
                                                              src/tools/gromacs.py on lines 825..825
                                                              src/tools/gromacs.py on lines 913..913
                                                              src/tools/gromacs.py on lines 918..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 63.

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

                                                                                              t1, t2, t3, t4 = types[pid4-1], types[pid3-1], types[pid2-1], types[pid1-1]
                                                              Severity: Major
                                                              Found in src/tools/gromacs.py and 3 other locations - About 3 hrs to fix
                                                              src/tools/gromacs.py on lines 825..825
                                                              src/tools/gromacs.py on lines 892..892
                                                              src/tools/gromacs.py on lines 913..913

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

                                                              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

                                                                      if lookup:
                                                                          t1, t2, t3, t4 = types[pid1-1], types[pid2-1], types[pid3-1], types[pid4-1] # get types of particles
                                                                          try:
                                                                              dihtypeid = impropertypes[t1][t2][t3][t4] #dihtypeid is now a tuple
                                                              #                print t1, t2, t3, t4, 'found'
                                                              Severity: Major
                                                              Found in src/tools/gromacs.py and 1 other location - About 2 hrs to fix
                                                              src/tools/gromacs.py on lines 824..850

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

                                                              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

                                                                      if lookup:
                                                                          t1, t2, t3, t4 = types[pid1-1], types[pid2-1], types[pid3-1], types[pid4-1] # get types of particles
                                                                          try:
                                                                              dihtypeid = dihedraltypes[t1][t2][t3][t4] #dihtypeid is now a tuple
                                                                          #if t1 not in dihedraltypes: # interactions in the other way
                                                              Severity: Major
                                                              Found in src/tools/gromacs.py and 1 other location - About 2 hrs to fix
                                                              src/tools/gromacs.py on lines 891..932

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

                                                              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

                                                                      if len(fields) > 7:
                                                                          # also has a special mass
                                                                          mass_tmp.append(float(fields[7]))
                                                                      else:
                                                                          mass_tmp.append(atomtypeparams[attypeid]['mass'])
                                                              Severity: Major
                                                              Found in src/tools/gromacs.py and 1 other location - About 2 hrs to fix
                                                              src/tools/gromacs.py on lines 647..652

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

                                                              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

                                                                      if len(fields) > 6:
                                                                          # this atom has a charge different from its atomtype
                                                                          charge_tmp.append(float(fields[6]))
                                                                      else:
                                                                          #look up default values for this atom type
                                                              Severity: Major
                                                              Found in src/tools/gromacs.py and 1 other location - About 2 hrs to fix
                                                              src/tools/gromacs.py on lines 653..657

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

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

                                                                  while not 'bonds' in line:
                                                                      line = f.readline()
                                                                      if 'moleculetype' in line or not line:
                                                                          f.seek(pos)
                                                                          return bonds
                                                              Severity: Major
                                                              Found in src/tools/gromacs.py and 3 other locations - About 2 hrs to fix
                                                              src/tools/gromacs.py on lines 757..761
                                                              src/tools/gromacs.py on lines 810..814
                                                              src/tools/gromacs.py on lines 876..880

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

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

                                                                  while not 'angles' in line:
                                                                      line = f.readline()
                                                                      if 'moleculetype' in line or not line:
                                                                          f.seek(pos)
                                                                          return angles
                                                              Severity: Major
                                                              Found in src/tools/gromacs.py and 3 other locations - About 2 hrs to fix
                                                              src/tools/gromacs.py on lines 679..683
                                                              src/tools/gromacs.py on lines 810..814
                                                              src/tools/gromacs.py on lines 876..880

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

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

                                                                  while not 'impropers' in line:
                                                                      line = f.readline()
                                                                      if 'moleculetype' in line or not line:
                                                                          f.seek(pos)
                                                                          return impropers
                                                              Severity: Major
                                                              Found in src/tools/gromacs.py and 3 other locations - About 2 hrs to fix
                                                              src/tools/gromacs.py on lines 679..683
                                                              src/tools/gromacs.py on lines 757..761
                                                              src/tools/gromacs.py on lines 810..814

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

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

                                                                  while not 'dihedrals' in line:
                                                                      line = f.readline()
                                                                      if 'moleculetype' in line or not line:
                                                                          f.seek(pos)
                                                                          return dihedrals
                                                              Severity: Major
                                                              Found in src/tools/gromacs.py and 3 other locations - About 2 hrs to fix
                                                              src/tools/gromacs.py on lines 679..683
                                                              src/tools/gromacs.py on lines 757..761
                                                              src/tools/gromacs.py on lines 876..880

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

                                                              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

                                                                      if lookup:
                                                                          t1, t2, t3 = types[pid1-1], types[pid2-1], types[pid3-1]
                                                                          try:
                                                                              antypeid = angletypes[t1][t2][t3]
                                                                          except KeyError:
                                                              Severity: Major
                                                              Found in src/tools/gromacs.py and 1 other location - About 2 hrs to fix
                                                              src/tools/gromacs.py on lines 693..706

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

                                                              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

                                                                      if lookup:
                                                                          # based on atom names: potential has to be defined in bondtypes already
                                                                          # this is for tabulated bond potentials specified based on type
                                                                          t1, t2 = types[pid1-1], types[pid2-1]
                                                                          if t1 > t2: # interactions in the other way
                                                              Severity: Major
                                                              Found in src/tools/gromacs.py and 1 other location - About 2 hrs to fix
                                                              src/tools/gromacs.py on lines 771..785

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

                                                              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

                                                                  if (hadress):
                                                                      interaction=espressopp.interaction.VerletListHadressReactionFieldGeneralized(verletlist, ftpl)
                                                                  elif (adress):
                                                                      interaction=espressopp.interaction.VerletListAdressReactionFieldGeneralized(verletlist, ftpl)
                                                                  else:
                                                              Severity: Major
                                                              Found in src/tools/gromacs.py and 2 other locations - About 2 hrs to fix
                                                              src/tools/gromacs.py on lines 1088..1095
                                                              src/tools/gromacs.py on lines 1238..1243

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

                                                              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

                                                                  if (hadress):
                                                                      interaction=espressopp.interaction.VerletListHadressReactionFieldGeneralized(verletlist, ftpl)
                                                                  elif (adress):
                                                                      interaction=espressopp.interaction.VerletListAdressReactionFieldGeneralized(verletlist, ftpl)
                                                                  else:
                                                              Severity: Major
                                                              Found in src/tools/gromacs.py and 2 other locations - About 2 hrs to fix
                                                              src/tools/gromacs.py on lines 1088..1095
                                                              src/tools/gromacs.py on lines 1304..1309

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

                                                              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

                                                                  if (hadress):
                                                                      interaction = espressopp.interaction.VerletListHadressLennardJones(
                                                                          verletlist, ftpl)
                                                                  elif (adress):
                                                                      interaction = espressopp.interaction.VerletListAdressLennardJones(
                                                              Severity: Major
                                                              Found in src/tools/gromacs.py and 2 other locations - About 2 hrs to fix
                                                              src/tools/gromacs.py on lines 1238..1243
                                                              src/tools/gromacs.py on lines 1304..1309

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

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

                                                                  if len(dihedraltypeparams) != 0:
                                                                      print("Found ", len(dihedraltypeparams), " dihedral type parameters")
                                                                      unpackvars.append("dihedraltypeparams")
                                                                      params.append(dihedraltypeparams)
                                                              Severity: Major
                                                              Found in src/tools/gromacs.py and 10 other locations - About 1 hr to fix
                                                              src/tools/gromacs.py on lines 532..535
                                                              src/tools/gromacs.py on lines 536..539
                                                              src/tools/gromacs.py on lines 540..543
                                                              src/tools/gromacs.py on lines 544..547
                                                              src/tools/gromacs.py on lines 548..551
                                                              src/tools/gromacs.py on lines 552..555
                                                              src/tools/gromacs.py on lines 556..559
                                                              src/tools/gromacs.py on lines 572..575
                                                              src/tools/gromacs.py on lines 576..579
                                                              src/tools/gromacs.py on lines 580..583

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

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

                                                                  if len(exclusions) != 0:
                                                                      print("Found ", len(exclusions), "bond exclusions")
                                                                      unpackvars.append("exclusions")
                                                                      params.append(exclusions)
                                                              Severity: Major
                                                              Found in src/tools/gromacs.py and 10 other locations - About 1 hr to fix
                                                              src/tools/gromacs.py on lines 532..535
                                                              src/tools/gromacs.py on lines 536..539
                                                              src/tools/gromacs.py on lines 540..543
                                                              src/tools/gromacs.py on lines 544..547
                                                              src/tools/gromacs.py on lines 548..551
                                                              src/tools/gromacs.py on lines 552..555
                                                              src/tools/gromacs.py on lines 556..559
                                                              src/tools/gromacs.py on lines 564..567
                                                              src/tools/gromacs.py on lines 572..575
                                                              src/tools/gromacs.py on lines 580..583

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

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

                                                                  if len(onefourpairs) != 0:
                                                                      print("Found ", len(onefourpairs), "1-4 pairs")
                                                                      unpackvars.append("onefourpairs")
                                                                      params.append(onefourpairs)
                                                              Severity: Major
                                                              Found in src/tools/gromacs.py and 10 other locations - About 1 hr to fix
                                                              src/tools/gromacs.py on lines 532..535
                                                              src/tools/gromacs.py on lines 536..539
                                                              src/tools/gromacs.py on lines 540..543
                                                              src/tools/gromacs.py on lines 544..547
                                                              src/tools/gromacs.py on lines 548..551
                                                              src/tools/gromacs.py on lines 552..555
                                                              src/tools/gromacs.py on lines 556..559
                                                              src/tools/gromacs.py on lines 564..567
                                                              src/tools/gromacs.py on lines 572..575
                                                              src/tools/gromacs.py on lines 576..579

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

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

                                                                  if len(charges) != 0:
                                                                      print("Found ", len(charges), "charges")
                                                                      unpackvars.append("charges")
                                                                      params.append(charges)
                                                              Severity: Major
                                                              Found in src/tools/gromacs.py and 10 other locations - About 1 hr to fix
                                                              src/tools/gromacs.py on lines 532..535
                                                              src/tools/gromacs.py on lines 540..543
                                                              src/tools/gromacs.py on lines 544..547
                                                              src/tools/gromacs.py on lines 548..551
                                                              src/tools/gromacs.py on lines 552..555
                                                              src/tools/gromacs.py on lines 556..559
                                                              src/tools/gromacs.py on lines 564..567
                                                              src/tools/gromacs.py on lines 572..575
                                                              src/tools/gromacs.py on lines 576..579
                                                              src/tools/gromacs.py on lines 580..583

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

                                                              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

                                                                  if len(impropers) != 0:
                                                                      unpackvars.append("impropertypes")
                                                                      print("Found ", len(impropers), " improper types")
                                                                      params.append(impropers)
                                                              Severity: Major
                                                              Found in src/tools/gromacs.py and 1 other location - About 1 hr to fix
                                                              src/tools/gromacs.py on lines 560..563

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

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

                                                                  if len(bondtypeparams) !=0:
                                                                      print("Found ", len(bondtypeparams), " bondtypeparams")
                                                                      unpackvars.append("bondtypeparams")
                                                                      params.append(bondtypeparams)
                                                              Severity: Major
                                                              Found in src/tools/gromacs.py and 10 other locations - About 1 hr to fix
                                                              src/tools/gromacs.py on lines 532..535
                                                              src/tools/gromacs.py on lines 536..539
                                                              src/tools/gromacs.py on lines 540..543
                                                              src/tools/gromacs.py on lines 544..547
                                                              src/tools/gromacs.py on lines 552..555
                                                              src/tools/gromacs.py on lines 556..559
                                                              src/tools/gromacs.py on lines 564..567
                                                              src/tools/gromacs.py on lines 572..575
                                                              src/tools/gromacs.py on lines 576..579
                                                              src/tools/gromacs.py on lines 580..583

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

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

                                                                  if len(impropertypeparams) != 0:
                                                                      print("Found ", len(impropertypeparams), " improper type parameters")
                                                                      unpackvars.append("impropertypeparams")
                                                                      params.append(impropertypeparams)
                                                              Severity: Major
                                                              Found in src/tools/gromacs.py and 10 other locations - About 1 hr to fix
                                                              src/tools/gromacs.py on lines 532..535
                                                              src/tools/gromacs.py on lines 536..539
                                                              src/tools/gromacs.py on lines 540..543
                                                              src/tools/gromacs.py on lines 544..547
                                                              src/tools/gromacs.py on lines 548..551
                                                              src/tools/gromacs.py on lines 552..555
                                                              src/tools/gromacs.py on lines 556..559
                                                              src/tools/gromacs.py on lines 564..567
                                                              src/tools/gromacs.py on lines 576..579
                                                              src/tools/gromacs.py on lines 580..583

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

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

                                                                  if len(bonds) != 0:
                                                                      print("Found ", len(bonds), " bond types")
                                                                      unpackvars.append("bondtypes")
                                                                      params.append(bonds)
                                                              Severity: Major
                                                              Found in src/tools/gromacs.py and 10 other locations - About 1 hr to fix
                                                              src/tools/gromacs.py on lines 532..535
                                                              src/tools/gromacs.py on lines 536..539
                                                              src/tools/gromacs.py on lines 540..543
                                                              src/tools/gromacs.py on lines 548..551
                                                              src/tools/gromacs.py on lines 552..555
                                                              src/tools/gromacs.py on lines 556..559
                                                              src/tools/gromacs.py on lines 564..567
                                                              src/tools/gromacs.py on lines 572..575
                                                              src/tools/gromacs.py on lines 576..579
                                                              src/tools/gromacs.py on lines 580..583

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

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

                                                                  if len(atomtypeparams) !=0:
                                                                      print("Found ", len(atomtypeparams), " atomtypeparameters")
                                                                      unpackvars.append("atomtypeparameters")
                                                                      params.append(atomtypeparams)
                                                              Severity: Major
                                                              Found in src/tools/gromacs.py and 10 other locations - About 1 hr to fix
                                                              src/tools/gromacs.py on lines 532..535
                                                              src/tools/gromacs.py on lines 536..539
                                                              src/tools/gromacs.py on lines 544..547
                                                              src/tools/gromacs.py on lines 548..551
                                                              src/tools/gromacs.py on lines 552..555
                                                              src/tools/gromacs.py on lines 556..559
                                                              src/tools/gromacs.py on lines 564..567
                                                              src/tools/gromacs.py on lines 572..575
                                                              src/tools/gromacs.py on lines 576..579
                                                              src/tools/gromacs.py on lines 580..583

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

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

                                                                  if len(masses) != 0:
                                                                      print("Found ", len(masses), "masses")
                                                                      unpackvars.append("masses")
                                                                      params.append(masses)
                                                              Severity: Major
                                                              Found in src/tools/gromacs.py and 10 other locations - About 1 hr to fix
                                                              src/tools/gromacs.py on lines 536..539
                                                              src/tools/gromacs.py on lines 540..543
                                                              src/tools/gromacs.py on lines 544..547
                                                              src/tools/gromacs.py on lines 548..551
                                                              src/tools/gromacs.py on lines 552..555
                                                              src/tools/gromacs.py on lines 556..559
                                                              src/tools/gromacs.py on lines 564..567
                                                              src/tools/gromacs.py on lines 572..575
                                                              src/tools/gromacs.py on lines 576..579
                                                              src/tools/gromacs.py on lines 580..583

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

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

                                                                  if len(angletypeparams) != 0:
                                                                      print("Found ", len(angletypeparams), " angle type parameters")
                                                                      unpackvars.append("angletypeparams")
                                                                      params.append(angletypeparams)
                                                              Severity: Major
                                                              Found in src/tools/gromacs.py and 10 other locations - About 1 hr to fix
                                                              src/tools/gromacs.py on lines 532..535
                                                              src/tools/gromacs.py on lines 536..539
                                                              src/tools/gromacs.py on lines 540..543
                                                              src/tools/gromacs.py on lines 544..547
                                                              src/tools/gromacs.py on lines 548..551
                                                              src/tools/gromacs.py on lines 552..555
                                                              src/tools/gromacs.py on lines 564..567
                                                              src/tools/gromacs.py on lines 572..575
                                                              src/tools/gromacs.py on lines 576..579
                                                              src/tools/gromacs.py on lines 580..583

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

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

                                                                  if len(angles) != 0:
                                                                      print("Found ", len(angles), " angle types")
                                                                      unpackvars.append("angletypes")
                                                                      params.append(angles)
                                                              Severity: Major
                                                              Found in src/tools/gromacs.py and 10 other locations - About 1 hr to fix
                                                              src/tools/gromacs.py on lines 532..535
                                                              src/tools/gromacs.py on lines 536..539
                                                              src/tools/gromacs.py on lines 540..543
                                                              src/tools/gromacs.py on lines 544..547
                                                              src/tools/gromacs.py on lines 548..551
                                                              src/tools/gromacs.py on lines 556..559
                                                              src/tools/gromacs.py on lines 564..567
                                                              src/tools/gromacs.py on lines 572..575
                                                              src/tools/gromacs.py on lines 576..579
                                                              src/tools/gromacs.py on lines 580..583

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

                                                              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

                                                                  if len(dihedrals) != 0:
                                                                      unpackvars.append("dihedraltypes")
                                                                      print("Found ", len(dihedrals), " dihedral types") #doesn't count when several potentials per dihedral
                                                                      params.append(dihedrals)
                                                              Severity: Major
                                                              Found in src/tools/gromacs.py and 1 other location - About 1 hr to fix
                                                              src/tools/gromacs.py on lines 568..571

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

                                                              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

                                                                  pot = espressopp.interaction.ReactionFieldGeneralizedTI(prefactor=pref, kappa=kappa, epsilon1=epsilon1, epsilon2=epsilon2, cutoff=rc, lambdaTI=lambdaTI, annihilate=annihilate)
                                                              Severity: Minor
                                                              Found in src/tools/gromacs.py and 1 other location - About 35 mins to fix
                                                              examples/stillinger_weber_Si/stillinger_weber_silicon.py on lines 132..132

                                                              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

                                                                  if (hadress):
                                                                      #interaction=espressopp.interaction.VerletListHadressLennardJonesSoftcoreTI(verletlist, ftpl)
                                                                      print("Error! TI not implemented in VerletListHadressInteractionTemplate yet")
                                                                      return
                                                                  elif (adress):
                                                              Severity: Minor
                                                              Found in src/tools/gromacs.py and 1 other location - About 30 mins to fix
                                                              src/tools/gromacs.py on lines 1270..1278

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

                                                              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

                                                                  while not 'moleculetype' in line:
                                                                      line = f.readline()
                                                                      if not line: break # break out of while if EOF
                                                              Severity: Minor
                                                              Found in src/tools/gromacs.py and 1 other location - About 30 mins to fix
                                                              src/tools/gromacs.py on lines 636..638

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

                                                              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

                                                                  while not 'atoms' in line:
                                                                      line = f.readline()
                                                                      if not line: break # break out of while if EOF
                                                              Severity: Minor
                                                              Found in src/tools/gromacs.py and 1 other location - About 30 mins to fix
                                                              src/tools/gromacs.py on lines 613..615

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

                                                              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

                                                                  if (hadress):
                                                                      print("Error! TI not implemented in VerletListHadressInteractionTemplate yet")
                                                                      return
                                                                      #interaction=espressopp.interaction.VerletListHadressReactionFieldGeneralized(verletlist, ftpl)
                                                                  elif (adress):
                                                              Severity: Minor
                                                              Found in src/tools/gromacs.py and 1 other location - About 30 mins to fix
                                                              src/tools/gromacs.py on lines 1140..1148

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

                                                              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