KarrLab/bpforms

View on GitHub
bpforms/alphabet/rna.py

Summary

Maintainability
F
1 mo
Test Coverage
F
14%

Function build_rna_mod_db has a Cognitive Complexity of 116 (exceeds 5 allowed). Consider refactoring.
Open

    def build_rna_mod_db(self, alphabet, session, ph=None, major_tautomer=False, dearomatize=False):
        """ Build alphabet from the RNA Modification Database

        Args:
            alphabet (:obj:`Alphabet`): alphabet
Severity: Minor
Found in bpforms/alphabet/rna.py - About 2 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

Function build_pdb has a Cognitive Complexity of 114 (exceeds 5 allowed). Consider refactoring.
Open

    def build_pdb(self, alphabet, session, ph=None, major_tautomer=False, dearomatize=False):
        """ Build monomeric forms from PDB CCD

        Args:
            alphabet (:obj:`Alphabet`): alphabet
Severity: Minor
Found in bpforms/alphabet/rna.py - About 2 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 rna.py has 912 lines of code (exceeds 250 allowed). Consider refactoring.
Open

""" Alphabet and BpForm to represent modified RNA

:Author: Jonathan Karr <karr@mssm.edu>
:Date: 2019-02-05
:Copyright: 2019, Karr Lab
Severity: Major
Found in bpforms/alphabet/rna.py - About 2 days to fix

    Function build_modomics has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
    Open

        def build_modomics(self, alphabet, session, ph=None, major_tautomer=False, dearomatize=False):
            """ Build alphabet from MODOMICS
    
            Args:
                alphabet (:obj:`Alphabet`): alphabet
    Severity: Minor
    Found in bpforms/alphabet/rna.py - About 6 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 build has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
    Open

        def build(self, ph=None, major_tautomer=False, dearomatize=False):
            """ Build alphabet
    
            Args:
                ph (:obj:`float`, optional): pH at which to calculate the major protonation state of each monomeric form
    Severity: Minor
    Found in bpforms/alphabet/rna.py - About 5 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 is_l_atom has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
    Open

        def is_l_atom(self, l_atom):
            """ Determine if an atom is a valid left bonding site
    
            Args:
                l_atom (:obj:`openbabel.OBAtom`): potential left atom
    Severity: Minor
    Found in bpforms/alphabet/rna.py - About 5 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 is_backbone_atom has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
    Open

        def is_backbone_atom(self, b_atom):
            """ Determine if an atom is a valid backbone bonding site
    
            Args:
                b_atom (:obj:`openbabel.OBAtom`): potential backbone atom
    Severity: Minor
    Found in bpforms/alphabet/rna.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 is_valid_nucleoside has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
    Open

        def is_valid_nucleoside(self, monomer):
            """ Determine if nucleoside should be included in alphabet
    
            Args:
                monomer (:obj:`Monomer`): monomeric form
    Severity: Minor
    Found in bpforms/alphabet/rna.py - About 2 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 is_l_atom has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def is_l_atom(self, l_atom):
            """ Determine if an atom is a valid left bonding site
    
            Args:
                l_atom (:obj:`openbabel.OBAtom`): potential left atom
    Severity: Minor
    Found in bpforms/alphabet/rna.py - About 1 hr to fix

      Function is_backbone_atom has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def is_backbone_atom(self, b_atom):
              """ Determine if an atom is a valid backbone bonding site
      
              Args:
                  b_atom (:obj:`openbabel.OBAtom`): potential backbone atom
      Severity: Minor
      Found in bpforms/alphabet/rna.py - About 1 hr to fix

        Function get_nucleoside_details_from_modomics has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

            def get_nucleoside_details_from_modomics(self, id, session):
                """ Get the structure of a nucleoside in the MODOMICS database
        
                Args:
                    id (:obj:`str`): id of nucleoside in MODOMICS database
        Severity: Minor
        Found in bpforms/alphabet/rna.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

        Avoid deeply nested control flow statements.
        Open

                                if key == 'Symbol':
                                    id = child.text
                                elif key == 'Common name':
                                    name = child.text
                                elif key == 'CA registry numbers' and child.text.startswith('ribonucleoside '):
        Severity: Major
        Found in bpforms/alphabet/rna.py - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                  if identifier.ns == 'pdb-ccd':
                                      monomer = None
                                      break
                          if monomer is not None and (\
          Severity: Major
          Found in bpforms/alphabet/rna.py - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                    for domain, cell in zip(domains, row.find_all('td')):
                                        if cell.text:
                                            domain_dist.append(domain + ' ' + rna_type)
            
            
            Severity: Major
            Found in bpforms/alphabet/rna.py - About 45 mins to fix

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

                  def build_pdb(self, alphabet, session, ph=None, major_tautomer=False, dearomatize=False):
              Severity: Minor
              Found in bpforms/alphabet/rna.py - About 35 mins to fix

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

                    def build_modomics(self, alphabet, session, ph=None, major_tautomer=False, dearomatize=False):
                Severity: Minor
                Found in bpforms/alphabet/rna.py - About 35 mins to fix

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

                      def build_rna_mod_db(self, alphabet, session, ph=None, major_tautomer=False, dearomatize=False):
                  Severity: Minor
                  Found in bpforms/alphabet/rna.py - About 35 mins to fix

                    Avoid too many return statements within this function.
                    Open

                                return False  # pragma no cover: case not used by MODOMICS or the RNA Modification Database
                    Severity: Major
                    Found in bpforms/alphabet/rna.py - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                                  return False  # pragma no cover: case not used by MODOMICS or the RNA Modification Database
                      Severity: Major
                      Found in bpforms/alphabet/rna.py - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                    return False
                        Severity: Major
                        Found in bpforms/alphabet/rna.py - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                  return r_atom_2
                          Severity: Major
                          Found in bpforms/alphabet/rna.py - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                        return False  # pragma no cover: case not used by MODOMICS or the RNA Modification Database
                            Severity: Major
                            Found in bpforms/alphabet/rna.py - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                          return False  # pragma no cover: case not used by MODOMICS or the RNA Modification Database
                              Severity: Major
                              Found in bpforms/alphabet/rna.py - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                            return False
                                Severity: Major
                                Found in bpforms/alphabet/rna.py - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                              return False
                                  Severity: Major
                                  Found in bpforms/alphabet/rna.py - About 30 mins to fix

                                    Avoid too many return statements within this function.
                                    Open

                                                return False
                                    Severity: Major
                                    Found in bpforms/alphabet/rna.py - About 30 mins to fix

                                      Avoid too many return statements within this function.
                                      Open

                                              return r_atom_2
                                      Severity: Major
                                      Found in bpforms/alphabet/rna.py - About 30 mins to fix

                                        Avoid too many return statements within this function.
                                        Open

                                                    return False  # pragma no cover: case not used by MODOMICS or the RNA Modification Database
                                        Severity: Major
                                        Found in bpforms/alphabet/rna.py - About 30 mins to fix

                                          Avoid too many return statements within this function.
                                          Open

                                                      return False  # pragma no cover: case not used by MODOMICS or the RNA Modification Database
                                          Severity: Major
                                          Found in bpforms/alphabet/rna.py - About 30 mins to fix

                                            Avoid too many return statements within this function.
                                            Open

                                                        return False
                                            Severity: Major
                                            Found in bpforms/alphabet/rna.py - About 30 mins to fix

                                              Avoid too many return statements within this function.
                                              Open

                                                          return False
                                              Severity: Major
                                              Found in bpforms/alphabet/rna.py - About 30 mins to fix

                                                Avoid too many return statements within this function.
                                                Open

                                                            return False  # pragma no cover: case not used by MODOMICS or the RNA Modification Database
                                                Severity: Major
                                                Found in bpforms/alphabet/rna.py - About 30 mins to fix

                                                  Avoid too many return statements within this function.
                                                  Open

                                                              return False
                                                  Severity: Major
                                                  Found in bpforms/alphabet/rna.py - About 30 mins to fix

                                                    Avoid too many return statements within this function.
                                                    Open

                                                                return False
                                                    Severity: Major
                                                    Found in bpforms/alphabet/rna.py - About 30 mins to fix

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

                                                                  if monomer is None:
                                                                      # add the entry to the alphabet
                                                                      alphabet.monomers[pdb_monomer.id] = pdb_monomer
                                                                      if base_monomer is not None:
                                                                          base_monomers[pdb_monomer] = base_monomer
                                                      Severity: Major
                                                      Found in bpforms/alphabet/rna.py and 1 other location - About 3 days to fix
                                                      bpforms/alphabet/dna.py on lines 661..701

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

                                                      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_o in range(1, 4):
                                                                      id_o = 'OP' + str(i_o)
                                                                      id_h = 'H' + id_o
                                                                      if id_o in atoms and id_h in atoms:
                                                                          atom_o = mol.GetAtom(atoms[id_o]['position'])
                                                      Severity: Major
                                                      Found in bpforms/alphabet/rna.py and 1 other location - About 1 day to fix
                                                      bpforms/alphabet/dna.py on lines 491..503

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

                                                      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 atom in openbabel.OBMolAtomIter(mol):
                                                                      if atom.GetAtomicNum() == 15 and atom.GetIsotope() == 1:
                                                                          i_left_p = atom.GetIdx()
                                                                          atom.SetIsotope(0)
                                                                      elif atom.GetAtomicNum() == 8 and atom.GetIsotope() == 1:
                                                      Severity: Major
                                                      Found in bpforms/alphabet/rna.py and 1 other location - About 1 day to fix
                                                      bpforms/alphabet/dna.py on lines 538..547

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

                                                      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

                                                      class RnaForm(BpForm):
                                                          """ RNA form """
                                                      
                                                          DEFAULT_FASTA_CODE = 'N'
                                                      
                                                      
                                                      Severity: Major
                                                      Found in bpforms/alphabet/rna.py and 3 other locations - About 1 day to fix
                                                      bpforms/alphabet/dna.py on lines 725..743
                                                      bpforms/alphabet/dna.py on lines 747..765
                                                      bpforms/alphabet/rna.py on lines 1158..1176

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

                                                      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

                                                      class CanonicalRnaForm(BpForm):
                                                          """ Canonical RNA form """
                                                      
                                                          DEFAULT_FASTA_CODE = 'N'
                                                      
                                                      
                                                      Severity: Major
                                                      Found in bpforms/alphabet/rna.py and 3 other locations - About 1 day to fix
                                                      bpforms/alphabet/dna.py on lines 725..743
                                                      bpforms/alphabet/dna.py on lines 747..765
                                                      bpforms/alphabet/rna.py on lines 1136..1154

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

                                                      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 pdb_monomer.id not in ['A5O', 'AP7', 'CAR', 'GAO', 'UAR']:
                                                                      monomer = smiles_to_monomer.get(can_smiles, None)
                                                                      if monomer is not None:
                                                                          for identifier in monomer.identifiers:
                                                                              if identifier.ns == 'pdb-ccd':
                                                      Severity: Major
                                                      Found in bpforms/alphabet/rna.py and 1 other location - About 6 hrs to fix
                                                      bpforms/alphabet/dna.py on lines 633..643

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

                                                      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 i_left_p is not None and i_left_o is not None and \
                                                                          ('HOP3' in atoms or mol.GetAtom(i_left_o).GetFormalCharge() == -1):
                                                                      pdb_monomer.l_bond_atoms = [Atom(Monomer, element='P', position=i_left_p)]
                                                                      pdb_monomer.l_displaced_atoms = [
                                                                          Atom(Monomer, element='O', position=i_left_o, charge=-1)]
                                                      Severity: Major
                                                      Found in bpforms/alphabet/rna.py and 1 other location - About 5 hrs to fix
                                                      bpforms/alphabet/dna.py on lines 586..590

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

                                                      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 is_terminus(self, b_atom, r_atom):
                                                              """ Determine if a pair of atoms is a valid pair of bonding sites
                                                      
                                                              Args:
                                                                  b_atom (:obj:`openbabel.OBAtom`): potential backbone atom
                                                      Severity: Major
                                                      Found in bpforms/alphabet/rna.py and 1 other location - About 3 hrs to fix
                                                      bpforms/alphabet/rna.py on lines 944..961

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

                                                      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 is_nucleotide_terminus(self, l_atom, r_atom):
                                                              """ Determine if a pair of atoms is a valid pair of bonding sites
                                                      
                                                              Args:
                                                                  l_atom (:obj:`openbabel.OBAtom`): potential left atom
                                                      Severity: Major
                                                      Found in bpforms/alphabet/rna.py and 1 other location - About 3 hrs to fix
                                                      bpforms/alphabet/rna.py on lines 925..942

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

                                                      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 i_right_o is not None and "HO3'" in atoms:
                                                                      pdb_monomer.r_bond_atoms = [Atom(Monomer, element='O', position=i_right_o)]
                                                                      pdb_monomer.r_displaced_atoms = [Atom(Monomer, element='H', position=i_right_o)]
                                                      Severity: Major
                                                      Found in bpforms/alphabet/rna.py and 1 other location - About 2 hrs to fix
                                                      bpforms/alphabet/dna.py on lines 591..593

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

                                                      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 old_monomer, new_monomer in replaced_monomers:
                                                                  for o_monomer in alphabet.monomers.values():
                                                                      if old_monomer in o_monomer.base_monomers:
                                                                          o_monomer.base_monomers.remove(old_monomer)
                                                                          o_monomer.base_monomers.add(new_monomer)
                                                      Severity: Major
                                                      Found in bpforms/alphabet/rna.py and 1 other location - About 2 hrs to fix
                                                      bpforms/alphabet/dna.py on lines 708..712

                                                      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

                                                                  if "O3'" in atoms:
                                                                      atom = mol.GetAtom(atoms["O3'"]['position'])
                                                                      assert atom.GetAtomicNum() == 8
                                                                      atom.SetIsotope(2)
                                                      Severity: Major
                                                      Found in bpforms/alphabet/rna.py and 3 other locations - About 2 hrs to fix
                                                      bpforms/alphabet/dna.py on lines 485..488
                                                      bpforms/alphabet/dna.py on lines 506..509
                                                      bpforms/alphabet/rna.py on lines 635..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 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

                                                                  if "P" in atoms:
                                                                      atom = mol.GetAtom(atoms["P"]['position'])
                                                                      assert atom.GetAtomicNum() == 15
                                                                      atom.SetIsotope(1)
                                                      Severity: Major
                                                      Found in bpforms/alphabet/rna.py and 3 other locations - About 2 hrs to fix
                                                      bpforms/alphabet/dna.py on lines 485..488
                                                      bpforms/alphabet/dna.py on lines 506..509
                                                      bpforms/alphabet/rna.py on lines 656..659

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

                                                              if '10G' in alphabet.monomers and 'G' in alphabet.monomers:
                                                                  alphabet.monomers['10G'].base_monomers.add(alphabet.monomers['G'])
                                                      Severity: Major
                                                      Found in bpforms/alphabet/rna.py and 5 other locations - About 2 hrs to fix
                                                      bpforms/alphabet/rna.py on lines 92..93
                                                      bpforms/alphabet/rna.py on lines 94..95
                                                      bpforms/alphabet/rna.py on lines 96..97
                                                      bpforms/alphabet/rna.py on lines 98..99
                                                      bpforms/alphabet/rna.py on lines 100..101

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

                                                              if '103G' in alphabet.monomers and 'G' in alphabet.monomers:
                                                                  alphabet.monomers['103G'].base_monomers.add(alphabet.monomers['G'])
                                                      Severity: Major
                                                      Found in bpforms/alphabet/rna.py and 5 other locations - About 2 hrs to fix
                                                      bpforms/alphabet/rna.py on lines 90..91
                                                      bpforms/alphabet/rna.py on lines 92..93
                                                      bpforms/alphabet/rna.py on lines 94..95
                                                      bpforms/alphabet/rna.py on lines 98..99
                                                      bpforms/alphabet/rna.py on lines 100..101

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

                                                              if 'manQ' in alphabet.monomers and '10G' in alphabet.monomers:
                                                                  alphabet.monomers['manQ'].base_monomers.add(alphabet.monomers['10G'])
                                                      Severity: Major
                                                      Found in bpforms/alphabet/rna.py and 5 other locations - About 2 hrs to fix
                                                      bpforms/alphabet/rna.py on lines 90..91
                                                      bpforms/alphabet/rna.py on lines 94..95
                                                      bpforms/alphabet/rna.py on lines 96..97
                                                      bpforms/alphabet/rna.py on lines 98..99
                                                      bpforms/alphabet/rna.py on lines 100..101

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

                                                              if '106G' in alphabet.monomers and '10G' in alphabet.monomers:
                                                                  alphabet.monomers['106G'].base_monomers.add(alphabet.monomers['10G'])
                                                      Severity: Major
                                                      Found in bpforms/alphabet/rna.py and 5 other locations - About 2 hrs to fix
                                                      bpforms/alphabet/rna.py on lines 90..91
                                                      bpforms/alphabet/rna.py on lines 92..93
                                                      bpforms/alphabet/rna.py on lines 94..95
                                                      bpforms/alphabet/rna.py on lines 96..97
                                                      bpforms/alphabet/rna.py on lines 98..99

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

                                                              if '104G' in alphabet.monomers and '10G' in alphabet.monomers:
                                                                  alphabet.monomers['104G'].base_monomers.add(alphabet.monomers['10G'])
                                                      Severity: Major
                                                      Found in bpforms/alphabet/rna.py and 5 other locations - About 2 hrs to fix
                                                      bpforms/alphabet/rna.py on lines 90..91
                                                      bpforms/alphabet/rna.py on lines 92..93
                                                      bpforms/alphabet/rna.py on lines 94..95
                                                      bpforms/alphabet/rna.py on lines 96..97
                                                      bpforms/alphabet/rna.py on lines 100..101

                                                      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

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

                                                                  if monomer is None:
                                                                      monomer_diff_case = monomer_lc_codes.get(pdb_monomer.id.lower(), None)
                                                                      if monomer_diff_case is not None:
                                                                          same_ids_case_insensitive.append((pdb_monomer.id, monomer_diff_case))
                                                      Severity: Major
                                                      Found in bpforms/alphabet/rna.py and 1 other location - About 2 hrs to fix
                                                      bpforms/alphabet/dna.py on lines 655..658

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

                                                              if '102G' in alphabet.monomers and '10G' in alphabet.monomers:
                                                                  alphabet.monomers['102G'].base_monomers.add(alphabet.monomers['10G'])
                                                      Severity: Major
                                                      Found in bpforms/alphabet/rna.py and 5 other locations - About 2 hrs to fix
                                                      bpforms/alphabet/rna.py on lines 90..91
                                                      bpforms/alphabet/rna.py on lines 92..93
                                                      bpforms/alphabet/rna.py on lines 96..97
                                                      bpforms/alphabet/rna.py on lines 98..99
                                                      bpforms/alphabet/rna.py on lines 100..101

                                                      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

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

                                                                  for atom in openbabel.OBMolAtomIter(mol):
                                                                      if atom.GetAtomicNum() > 1:
                                                                          atom_map[atom.GetIdx()] = len(atom_map) + 1
                                                      Severity: Major
                                                      Found in bpforms/alphabet/rna.py and 1 other location - About 2 hrs to fix
                                                      bpforms/alphabet/dna.py on lines 551..553

                                                      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

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

                                                                  for atom in openbabel.OBMolAtomIter(mol):
                                                                      if atom.GetAtomicNum() > 1:
                                                                          atom_map_2[len(atom_map_2) + 1] = atom.GetIdx()
                                                      Severity: Major
                                                      Found in bpforms/alphabet/rna.py and 1 other location - About 2 hrs to fix
                                                      bpforms/alphabet/dna.py on lines 571..573

                                                      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

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

                                                              for other_atom in openbabel.OBAtomAtomIter(c_2):
                                                                  if other_atom.GetAtomicNum() == 6 and other_atom.GetIdx() != c_1.GetIdx():
                                                                      c_3 = other_atom
                                                      Severity: Major
                                                      Found in bpforms/alphabet/rna.py and 1 other location - About 2 hrs to fix
                                                      bpforms/alphabet/rna.py on lines 1096..1098

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

                                                      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 other_atom in openbabel.OBAtomAtomIter(c_2):
                                                                  if other_atom.GetAtomicNum() == 6 and other_atom.GetIdx() != c_1.GetIdx():
                                                                      c_3 = other_atom
                                                      Severity: Major
                                                      Found in bpforms/alphabet/rna.py and 1 other location - About 2 hrs to fix
                                                      bpforms/alphabet/rna.py on lines 1011..1013

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

                                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                      Refactorings

                                                      Further Reading

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

                                                                  if i_left_p is not None:
                                                                      i_left_p = atom_map_2[atom_map[i_left_p]]
                                                                      assert mol.GetAtom(i_left_p).GetAtomicNum() == 15
                                                      Severity: Major
                                                      Found in bpforms/alphabet/rna.py and 5 other locations - About 1 hr to fix
                                                      bpforms/alphabet/dna.py on lines 575..577
                                                      bpforms/alphabet/dna.py on lines 578..580
                                                      bpforms/alphabet/dna.py on lines 581..583
                                                      bpforms/alphabet/rna.py on lines 728..730
                                                      bpforms/alphabet/rna.py on lines 731..733

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

                                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                      Refactorings

                                                      Further Reading

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

                                                                  if i_left_o is not None:
                                                                      i_left_o = atom_map_2[atom_map[i_left_o]]
                                                                      assert mol.GetAtom(i_left_o).GetAtomicNum() == 8
                                                      Severity: Major
                                                      Found in bpforms/alphabet/rna.py and 5 other locations - About 1 hr to fix
                                                      bpforms/alphabet/dna.py on lines 575..577
                                                      bpforms/alphabet/dna.py on lines 578..580
                                                      bpforms/alphabet/dna.py on lines 581..583
                                                      bpforms/alphabet/rna.py on lines 725..727
                                                      bpforms/alphabet/rna.py on lines 731..733

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

                                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                      Refactorings

                                                      Further Reading

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

                                                                  if i_right_o is not None:
                                                                      i_right_o = atom_map_2[atom_map[i_right_o]]
                                                                      assert mol.GetAtom(i_right_o).GetAtomicNum() == 8
                                                      Severity: Major
                                                      Found in bpforms/alphabet/rna.py and 5 other locations - About 1 hr to fix
                                                      bpforms/alphabet/dna.py on lines 575..577
                                                      bpforms/alphabet/dna.py on lines 578..580
                                                      bpforms/alphabet/dna.py on lines 581..583
                                                      bpforms/alphabet/rna.py on lines 725..727
                                                      bpforms/alphabet/rna.py on lines 728..730

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

                                                      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 monomer is None:
                                                                      monomer = monomer_codes.get(pdb_monomer.id, None)
                                                                      if monomer is not None:
                                                                          same_ids.append(pdb_monomer.id)
                                                      Severity: Major
                                                      Found in bpforms/alphabet/rna.py and 1 other location - About 1 hr to fix
                                                      bpforms/alphabet/dna.py on lines 651..654

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

                                                      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

                                                          def run(self, ph=None, major_tautomer=False, dearomatize=False, path=filename):
                                                              """ Build alphabet and, optionally, save to YAML file
                                                      
                                                              Args:
                                                                  ph (:obj:`float`, optional): pH at which calculate major protonation state of each monomeric form
                                                      Severity: Major
                                                      Found in bpforms/alphabet/rna.py and 2 other locations - About 1 hr to fix
                                                      bpforms/alphabet/dna.py on lines 103..115
                                                      bpforms/alphabet/protein.py on lines 49..61

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

                                                              print('{} entries with the similar structures were joined:\n  {}\t{}\n  {}'.format(
                                                                  len(same_structures), 'PDB CCD id', 'Alphabet code',
                                                                  '\n  '.join(sorted('\t'.join(ids) for ids in same_structures))))
                                                      Severity: Major
                                                      Found in bpforms/alphabet/rna.py and 3 other locations - About 1 hr to fix
                                                      bpforms/alphabet/dna.py on lines 715..717
                                                      bpforms/alphabet/dna.py on lines 720..722
                                                      bpforms/alphabet/rna.py on lines 870..872

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

                                                      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 monomer, base_monomer in base_monomers.items():
                                                                  if base_monomer in pdb_id_to_monomer:
                                                                      monomer.base_monomers.add(pdb_id_to_monomer[base_monomer])
                                                      Severity: Major
                                                      Found in bpforms/alphabet/rna.py and 1 other location - About 1 hr to fix
                                                      bpforms/alphabet/dna.py on lines 704..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 40.

                                                      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

                                                              print('{} entries with similar ids potentially should be joined:\n  {}\t{}\n  {}'.format(
                                                                  len(same_ids_case_insensitive), 'PDB CCD id', 'Alphabet code',
                                                                  '\n  '.join(sorted('\t'.join(ids) for ids in same_ids_case_insensitive))))
                                                      Severity: Major
                                                      Found in bpforms/alphabet/rna.py and 3 other locations - About 1 hr to fix
                                                      bpforms/alphabet/dna.py on lines 715..717
                                                      bpforms/alphabet/dna.py on lines 720..722
                                                      bpforms/alphabet/rna.py on lines 865..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 40.

                                                      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 self.is_backbone_atom(atom):
                                                                      atom_bs.append(atom)
                                                                  elif self.is_r_bond_atom(atom):
                                                                      atom_rs.append(atom)
                                                      Severity: Major
                                                      Found in bpforms/alphabet/rna.py and 1 other location - About 1 hr to fix
                                                      bpforms/alphabet/rna.py on lines 165..168

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

                                                      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 self.is_l_atom(atom):
                                                                          atom_ls.append(atom)
                                                                      elif self.is_r_bond_atom(atom):
                                                                          atom_rs.append(atom)
                                                      Severity: Major
                                                      Found in bpforms/alphabet/rna.py and 1 other location - About 1 hr to fix
                                                      bpforms/alphabet/rna.py on lines 891..894

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

                                                      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 atom_b in atom_bs:
                                                                  for atom_r in atom_rs:
                                                                      if self.is_terminus(atom_b, atom_r):
                                                                          termini.append((atom_b, atom_r))
                                                      Severity: Minor
                                                      Found in bpforms/alphabet/rna.py and 1 other location - About 45 mins to fix
                                                      bpforms/alphabet/protein.py on lines 642..645

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

                                                      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 monomer is not None:
                                                                      merge_with_new = True
                                                                      same_structures.append((pdb_monomer.id, monomer_to_codes[monomer]))
                                                      Severity: Minor
                                                      Found in bpforms/alphabet/rna.py and 1 other location - About 45 mins to fix
                                                      bpforms/alphabet/dna.py on lines 645..647

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

                                                      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 atom_b_idx:
                                                                  monomer.backbone_bond_atoms = [Atom(Monomer, 'O', atom_b_idx)]
                                                                  monomer.backbone_displaced_atoms = [Atom(Monomer, 'H', atom_b_idx)]
                                                      Severity: Minor
                                                      Found in bpforms/alphabet/rna.py and 1 other location - About 40 mins to fix
                                                      bpforms/alphabet/rna.py on lines 919..921

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

                                                      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 atom_r_idx:
                                                                  monomer.r_bond_atoms = [Atom(Monomer, 'O', atom_r_idx)]
                                                                  monomer.r_displaced_atoms = [Atom(Monomer, 'H', atom_r_idx)]
                                                      Severity: Minor
                                                      Found in bpforms/alphabet/rna.py and 1 other location - About 40 mins to fix
                                                      bpforms/alphabet/rna.py on lines 916..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 34.

                                                      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

                                                                  for other_other_atom in openbabel.OBAtomAtomIter(other_atom):
                                                                      if other_other_atom.GetAtomicNum() == 6:
                                                                          c_1 = other_other_atom
                                                                          break
                                                      Severity: Minor
                                                      Found in bpforms/alphabet/rna.py and 2 other locations - About 30 mins to fix
                                                      bpforms/alphabet/protein.py on lines 794..797
                                                      bpforms/alphabet/rna.py on lines 128..131

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

                                                                  for other_atom in openbabel.OBAtomAtomIter(monomer_backbone_o):
                                                                      if other_atom.GetAtomicNum() == 1:
                                                                          monomer_backbone_h = other_atom
                                                                          break
                                                      Severity: Minor
                                                      Found in bpforms/alphabet/rna.py and 2 other locations - About 30 mins to fix
                                                      bpforms/alphabet/protein.py on lines 794..797
                                                      bpforms/alphabet/rna.py on lines 1063..1066

                                                      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