KarrLab/bpforms

View on GitHub
bpforms/alphabet/dna.py

Summary

Maintainability
F
2 wks
Test Coverage
A
95%

Function build_pdb_ccd has a Cognitive Complexity of 113 (exceeds 5 allowed). Consider refactoring.
Open

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

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

""" Alphabet and BpForm to represent modified DNA

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

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

        def build_dnamod(self, alphabet, ph=None, major_tautomer=False, dearomatize=False):
            """ Build monomeric forms from DNAmod
    
            Args:
                alphabet (:obj:`Alphabet`): alphabet
    Severity: Minor
    Found in bpforms/alphabet/dna.py - About 1 day to fix

    Cognitive Complexity

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

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

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

    Further reading

    Function build_repairtoire has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
    Open

        def build_repairtoire(self, alphabet, ph=None, major_tautomer=False, dearomatize=False):
            """ Build monomeric forms from DNAmod
    
            Args:
                alphabet (:obj:`Alphabet`): alphabet
    Severity: Minor
    Found in bpforms/alphabet/dna.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

    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/dna.py - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                              if monomer.comments:
                                  monomer.comments += ' ' + comments
                              else:
                                  monomer.comments = comments
      
      
      Severity: Major
      Found in bpforms/alphabet/dna.py - About 45 mins to fix

        Function build has a Cognitive Complexity of 8 (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/dna.py - About 45 mins to fix

        Cognitive Complexity

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

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

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

        Further reading

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

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

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

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

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

                def run(self, ph=None, major_tautomer=False, dearomatize=False, path=filename):
            Severity: Minor
            Found in bpforms/alphabet/dna.py - About 35 mins to fix

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

                  def build_repairtoire(self, alphabet, ph=None, major_tautomer=False, dearomatize=False):
              Severity: Minor
              Found in bpforms/alphabet/dna.py - About 35 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/dna.py and 1 other location - About 3 days to fix
                bpforms/alphabet/rna.py on lines 811..851

                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/dna.py and 1 other location - About 1 day to fix
                bpforms/alphabet/rna.py on lines 641..653

                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/dna.py and 1 other location - About 1 day to fix
                bpforms/alphabet/rna.py on lines 688..697

                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 CanonicalDnaForm(BpForm):
                    """ Canonical DNA form """
                
                    DEFAULT_FASTA_CODE = 'N'
                
                
                Severity: Major
                Found in bpforms/alphabet/dna.py and 3 other locations - About 1 day to fix
                bpforms/alphabet/dna.py on lines 725..743
                bpforms/alphabet/rna.py on lines 1136..1154
                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 DnaForm(BpForm):
                    """ DNA form """
                
                    DEFAULT_FASTA_CODE = 'N'
                
                
                Severity: Major
                Found in bpforms/alphabet/dna.py and 3 other locations - About 1 day to fix
                bpforms/alphabet/dna.py on lines 747..765
                bpforms/alphabet/rna.py on lines 1136..1154
                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

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

                            if pdb_monomer.id not in ['A3A', 'DNR']:
                                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/dna.py and 1 other location - About 6 hrs to fix
                bpforms/alphabet/rna.py on lines 783..793

                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/dna.py and 1 other location - About 5 hrs to fix
                bpforms/alphabet/rna.py on lines 736..740

                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

                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/dna.py and 1 other location - About 2 hrs to fix
                bpforms/alphabet/rna.py on lines 741..743

                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

                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/dna.py and 3 other locations - About 2 hrs to fix
                bpforms/alphabet/dna.py on lines 506..509
                bpforms/alphabet/rna.py on lines 635..638
                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 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/dna.py and 3 other locations - About 2 hrs to fix
                bpforms/alphabet/dna.py on lines 485..488
                bpforms/alphabet/rna.py on lines 635..638
                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

                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/dna.py and 1 other location - About 2 hrs to fix
                bpforms/alphabet/rna.py on lines 858..862

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 55.

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

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

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

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

                Refactorings

                Further Reading

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

                                if smiles != monomers[monomer.id]['nucleotide']:
                                    raise Exception('Structure and atom indices may need to be updated for {}\n  {}\n  {}'.format(
                                        monomer.id, smiles, monomers[monomer.id]['nucleotide']))
                Severity: Major
                Found in bpforms/alphabet/dna.py and 1 other location - About 2 hrs to fix
                bpforms/alphabet/dna.py on lines 298..300

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 55.

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

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

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

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

                Refactorings

                Further Reading

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

                                if smiles != monomers[monomer.id]['nucleobase']:
                                    raise Exception('Structure and atom indices may need to be updated for {}\n  {}\n  {}'.format(
                                        monomer.id, smiles, monomers[monomer.id]['nucleobase']))
                Severity: Major
                Found in bpforms/alphabet/dna.py and 1 other location - About 2 hrs to fix
                bpforms/alphabet/dna.py on lines 313..315

                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

                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/dna.py and 1 other location - About 2 hrs to fix
                bpforms/alphabet/rna.py on lines 805..808

                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/dna.py and 1 other location - About 2 hrs to fix
                bpforms/alphabet/rna.py on lines 701..703

                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/dna.py and 1 other location - About 2 hrs to fix
                bpforms/alphabet/rna.py on lines 721..723

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 51.

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

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

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

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

                Refactorings

                Further Reading

                Similar blocks of code found in 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/dna.py and 5 other locations - About 1 hr to fix
                bpforms/alphabet/dna.py on lines 575..577
                bpforms/alphabet/dna.py on lines 581..583
                bpforms/alphabet/rna.py on lines 725..727
                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_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/dna.py and 5 other locations - About 1 hr to fix
                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
                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/dna.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/rna.py on lines 725..727
                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

                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/dna.py and 1 other location - About 1 hr to fix
                bpforms/alphabet/rna.py on lines 801..804

                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/dna.py and 2 other locations - About 1 hr to fix
                bpforms/alphabet/protein.py on lines 49..61
                bpforms/alphabet/rna.py on lines 46..58

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 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 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/dna.py and 3 other locations - About 1 hr to fix
                bpforms/alphabet/dna.py on lines 715..717
                bpforms/alphabet/rna.py on lines 865..867
                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/dna.py and 1 other location - About 1 hr to fix
                bpforms/alphabet/rna.py on lines 854..856

                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 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/dna.py and 3 other locations - About 1 hr to fix
                bpforms/alphabet/dna.py on lines 720..722
                bpforms/alphabet/rna.py on lines 865..867
                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

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

                    class CovMod(DeclarativeBase):
                        """"""
                        __tablename__ = 'covmod'
                        __table_args__ = {'autoload': True, 'extend_existing': True}
                        cmodid = sqlalchemy.Column(primary_key=True)
                Severity: Major
                Found in bpforms/alphabet/dna.py and 2 other locations - About 50 mins to fix
                bpforms/alphabet/dna.py on lines 78..82
                bpforms/alphabet/dna.py on lines 84..88

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

                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

                    class ModBase(DeclarativeBase):
                        """"""
                        __tablename__ = 'modbase'
                        __table_args__ = {'autoload': True, 'extend_existing': True}
                        nameid = sqlalchemy.Column(primary_key=True)
                Severity: Major
                Found in bpforms/alphabet/dna.py and 2 other locations - About 50 mins to fix
                bpforms/alphabet/dna.py on lines 84..88
                bpforms/alphabet/dna.py on lines 90..94

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

                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

                    class ModBaseParents(DeclarativeBase):
                        """"""
                        __tablename__ = 'modbase_parents'
                        __table_args__ = {'autoload': True, 'extend_existing': True}
                        nameid = sqlalchemy.Column(primary_key=True)
                Severity: Major
                Found in bpforms/alphabet/dna.py and 2 other locations - About 50 mins to fix
                bpforms/alphabet/dna.py on lines 78..82
                bpforms/alphabet/dna.py on lines 90..94

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

                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/dna.py and 1 other location - About 45 mins to fix
                bpforms/alphabet/rna.py on lines 795..797

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

                                monomer.r_displaced_atoms = [Atom(Monomer, element='H', position=monomers[monomer.id]['r_bond_atom'])]
                Severity: Major
                Found in bpforms/alphabet/dna.py and 2 other locations - About 40 mins to fix
                bpforms/alphabet/dna.py on lines 318..318
                bpforms/alphabet/dna.py on lines 321..321

                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

                                monomer.l_bond_atoms = [Atom(Monomer, element='P', position=monomers[monomer.id]['l_bond_atom'])]
                Severity: Major
                Found in bpforms/alphabet/dna.py and 2 other locations - About 40 mins to fix
                bpforms/alphabet/dna.py on lines 321..321
                bpforms/alphabet/dna.py on lines 322..322

                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

                                monomer.r_bond_atoms = [Atom(Monomer, element='O', position=monomers[monomer.id]['r_bond_atom'])]
                Severity: Major
                Found in bpforms/alphabet/dna.py and 2 other locations - About 40 mins to fix
                bpforms/alphabet/dna.py on lines 318..318
                bpforms/alphabet/dna.py on lines 322..322

                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

                There are no issues that match your filters.

                Category
                Status