dwhswenson/contact_map

View on GitHub
contact_map/contact_map.py

Summary

Maintainability
A
2 hrs
Test Coverage

ContactObject has 37 functions (exceeds 20 allowed). Consider refactoring.
Wontfix

class ContactObject(object):
    """
    Generic object for contact map related analysis. Effectively abstract.

    Much of what we need to do the contact map analysis is the same for all
Severity: Minor
Found in contact_map/contact_map.py - About 4 hrs to fix

    File contact_map.py has 786 lines of code (exceeds 750 allowed). Consider refactoring.
    Confirmed

    """
    Contact map analysis.
    """
    # Maintainer: David W.H. Swenson (dwhs@hyperblazer.net)
    # Licensed under LGPL, version 2.1 or greater
    Severity: Major
    Found in contact_map/contact_map.py - About 2 hrs to fix

      Function from_contacts has 9 arguments (exceeds 5 allowed). Consider refactoring.
      Wontfix

          def from_contacts(cls, atom_contacts, residue_contacts, n_frames,
      Severity: Major
      Found in contact_map/contact_map.py - About 1 hr to fix

        Function from_contacts has 8 arguments (exceeds 5 allowed). Consider refactoring.
        Wontfix

            def from_contacts(cls, atom_contacts, residue_contacts, topology,
        Severity: Major
        Found in contact_map/contact_map.py - About 50 mins to fix

          TODO found
          Open

          # TODO:
          Severity: Info
          Found in contact_map/contact_map.py by fixme

          TODO found
          Open

                  # TODO: add searching for subclasses (http://code.activestate.com/recipes/576949-find-all-subclasses-of-a-given-class/)
          Severity: Info
          Found in contact_map/contact_map.py by fixme

          TODO found
          Open

              # TODO: adding a separate object for these frozenset counters will be
          Severity: Info
          Found in contact_map/contact_map.py by fixme

          TODO found
          Open

                  # TODO: this whole thing should be cleaned up and should replace
          Severity: Info
          Found in contact_map/contact_map.py by fixme

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

              @property
              def residue_contacts(self):
                  """Residue pairs mapped to fraction of trajectory with that contact"""
                  return ContactCount(collections.Counter({
                      item[0]: float(item[1])/self.n_frames
          Severity: Major
          Found in contact_map/contact_map.py and 1 other location - About 4 hrs to fix
          contact_map/contact_map.py on lines 783..790

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

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

              @property
              def atom_contacts(self):
                  """Atoms pairs mapped to fraction of trajectory with that contact"""
                  return ContactCount(collections.Counter({
                      item[0]: float(item[1])/self.n_frames
          Severity: Major
          Found in contact_map/contact_map.py and 1 other location - About 4 hrs to fix
          contact_map/contact_map.py on lines 792..799

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

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

              @property
              def atom_contacts(self):
                  return self._get_filtered_sub(pos_count=self.positive.atom_contacts,
                                                neg_count=self.negative.atom_contacts,
                                                selection=self._all_atoms_intersect,
          Severity: Major
          Found in contact_map/contact_map.py and 1 other location - About 1 hr to fix
          contact_map/contact_map.py on lines 898..904

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

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

              @property
              def residue_contacts(self):
                  return self._get_filtered_sub(pos_count=self.positive.residue_contacts,
                                                neg_count=self.negative.residue_contacts,
                                                selection=self._all_residues_intersect,
          Severity: Major
          Found in contact_map/contact_map.py and 1 other location - About 1 hr to fix
          contact_map/contact_map.py on lines 890..896

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

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

              @classmethod
              def from_file(cls, filename):
                  warnings.warn(cls._pending_dep_msg, PendingDeprecationWarning)
                  return super(ContactFrequency, cls).from_file(filename)
          Severity: Minor
          Found in contact_map/contact_map.py and 1 other location - About 30 mins to fix
          contact_map/contact_map.py on lines 688..691

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

              @classmethod
              def from_dict(cls, dct):
                  warnings.warn(cls._pending_dep_msg, PendingDeprecationWarning)
                  return super(ContactFrequency, cls).from_dict(dct)
          Severity: Minor
          Found in contact_map/contact_map.py and 1 other location - About 30 mins to fix
          contact_map/contact_map.py on lines 693..696

          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

          There are no issues that match your filters.

          Category
          Status