xchem/XChemExplorer

View on GitHub

Showing 1,077 of 1,077 total issues

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

    def StartGUI(self):
        self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
        self.window.connect("delete_event", gtk.main_quit)
        self.window.set_border_width(10)
        self.window.set_default_size(400, 800)
Severity: Major
Found in xce/lib/XChemCootTwin.py and 1 other location - About 1 mo to fix
xce/lib/XChemCootBuster.py on lines 179..608

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

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

    def StartGUI(self):
        self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
        self.window.connect("delete_event", gtk.main_quit)
        self.window.set_border_width(10)
        self.window.set_default_size(400, 800)
Severity: Major
Found in xce/lib/XChemCootBuster.py and 1 other location - About 1 mo to fix
xce/lib/XChemCootTwin.py on lines 173..603

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

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 RefreshData(self):
        # reset spider plot image
        spider_plot_pic = gtk.gdk.pixbuf_new_from_file(
            os.path.join(
                os.getenv("XChemExplorer_DIR"),
Severity: Major
Found in xce/lib/XChemCootBuster.py and 1 other location - About 3 wks to fix
xce/lib/XChemCootTwin.py on lines 915..1296

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

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 RefreshData(self):
        # reset spider plot image
        spider_plot_pic = gtk.gdk.pixbuf_new_from_file(
            os.path.join(
                os.getenv("XChemExplorer_DIR"),
Severity: Major
Found in xce/lib/XChemCootTwin.py and 1 other location - About 3 wks to fix
xce/lib/XChemCootBuster.py on lines 924..1304

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

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

File XChemExplorer.py has 5159 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import getpass
import glob
import math
import os
import pickle
Severity: Major
Found in xce/XChemExplorer.py - About 2 wks to fix

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

        def RefreshSiteData(self):
            if self.pandda_index == -1:
                self.merge_ligand_button.set_sensitive(True)
                self.place_ligand_here_button.set_sensitive(True)
            else:
    Severity: Major
    Found in xce/lib/XChemCootBuster.py and 2 other locations - About 1 wk to fix
    xce/lib/XChemCootNew.py on lines 764..889
    xce/lib/XChemCootTwin.py on lines 744..869

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

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

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

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

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

    Refactorings

    Further Reading

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

        def RefreshSiteData(self):
            if self.pandda_index == -1:
                self.merge_ligand_button.set_sensitive(True)
                self.place_ligand_here_button.set_sensitive(True)
            else:
    Severity: Major
    Found in xce/lib/XChemCootTwin.py and 2 other locations - About 1 wk to fix
    xce/lib/XChemCootBuster.py on lines 749..873
    xce/lib/XChemCootNew.py on lines 764..889

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

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

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

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

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

    Refactorings

    Further Reading

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

        def RefreshSiteData(self):
            if self.pandda_index == -1:
                self.merge_ligand_button.set_sensitive(True)
                self.place_ligand_here_button.set_sensitive(True)
            else:
    Severity: Major
    Found in xce/lib/XChemCootNew.py and 2 other locations - About 1 wk to fix
    xce/lib/XChemCootBuster.py on lines 749..873
    xce/lib/XChemCootTwin.py on lines 744..869

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

    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

    File XChemThread.py has 2862 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import csv
    import glob
    import math
    import os
    import pickle
    Severity: Major
    Found in xce/lib/XChemThread.py - About 1 wk to fix

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

          def RefinementParams(self, RefmacParams):
              self.RefmacParams = RefmacParams
              self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
              self.window.connect("delete_event", gtk.main_quit)
              self.window.set_border_width(10)
      Severity: Major
      Found in xce/lib/XChemRefine.py and 1 other location - About 1 wk to fix
      xce/lib/XChemRefine.py on lines 1197..1263

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

      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

          def RefinementParams(self, RefmacParams):
              self.RefmacParams = RefmacParams
              self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
              self.window.connect("delete_event", gtk.main_quit)
              self.window.set_border_width(10)
      Severity: Major
      Found in xce/lib/XChemRefine.py and 1 other location - About 1 wk to fix
      xce/lib/XChemRefine.py on lines 2170..2236

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

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

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

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

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

      Refactorings

      Further Reading

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

          def merge_ligand_into_protein(self, widget):
              cpd = str(self.select_cpd_cb.get_active_text())
              for imol in coot_utils_XChem.molecule_number_list():
                  if imol not in self.mol_dict["ligand_stereo"]:
                      continue
      Severity: Major
      Found in xce/lib/XChemCootTwin.py and 2 other locations - About 5 days to fix
      xce/lib/XChemCootBuster.py on lines 1545..1622
      xce/lib/XChemCootNew.py on lines 1703..1780

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

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

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

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

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

      Refactorings

      Further Reading

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

          def merge_ligand_into_protein(self, widget):
              cpd = str(self.select_cpd_cb.get_active_text())
              for imol in coot_utils_XChem.molecule_number_list():
                  if imol not in self.mol_dict["ligand_stereo"]:
                      continue
      Severity: Major
      Found in xce/lib/XChemCootBuster.py and 2 other locations - About 5 days to fix
      xce/lib/XChemCootNew.py on lines 1703..1780
      xce/lib/XChemCootTwin.py on lines 1534..1611

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

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

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

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

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

      Refactorings

      Further Reading

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

          def merge_ligand_into_protein(self, widget):
              cpd = str(self.select_cpd_cb.get_active_text())
              for imol in coot_utils_XChem.molecule_number_list():
                  if imol not in self.mol_dict["ligand_stereo"]:
                      continue
      Severity: Major
      Found in xce/lib/XChemCootNew.py and 2 other locations - About 5 days to fix
      xce/lib/XChemCootBuster.py on lines 1545..1622
      xce/lib/XChemCootTwin.py on lines 1534..1611

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

      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

      File XChemRefine.py has 2129 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import getpass
      import glob
      import os
      from datetime import datetime
      
      
      Severity: Major
      Found in xce/lib/XChemRefine.py - About 5 days to fix

        File XChemUtils.py has 2038 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import bz2
        import gzip
        import json
        import math
        import os
        Severity: Major
        Found in xce/lib/XChemUtils.py - About 5 days to fix

          File XChemPANDDA.py has 1814 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import csv
          import glob
          import os
          from datetime import datetime
          import subprocess
          Severity: Major
          Found in xce/lib/XChemPANDDA.py - About 4 days to fix

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

                def show_potential_link(self, *clicks):
                    # first find imol of protein molecule
                    # it's a prerequisite that the ligand is merged into the protein
                    imol_protein = None
                    for imol in coot_utils_XChem.molecule_number_list():
            Severity: Major
            Found in xce/lib/XChemCootNew.py and 2 other locations - About 4 days to fix
            xce/lib/XChemCootBuster.py on lines 1399..1469
            xce/lib/XChemCootTwin.py on lines 1388..1458

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

            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 show_potential_link(self, *clicks):
                    # first find imol of protein molecule
                    # it's a prerequisite that the ligand is merged into the protein
                    imol_protein = None
                    for imol in coot_utils_XChem.molecule_number_list():
            Severity: Major
            Found in xce/lib/XChemCootBuster.py and 2 other locations - About 4 days to fix
            xce/lib/XChemCootNew.py on lines 1557..1627
            xce/lib/XChemCootTwin.py on lines 1388..1458

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

            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 show_potential_link(self, *clicks):
                    # first find imol of protein molecule
                    # it's a prerequisite that the ligand is merged into the protein
                    imol_protein = None
                    for imol in coot_utils_XChem.molecule_number_list():
            Severity: Major
            Found in xce/lib/XChemCootTwin.py and 2 other locations - About 4 days to fix
            xce/lib/XChemCootBuster.py on lines 1399..1469
            xce/lib/XChemCootNew.py on lines 1557..1627

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

            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

            Severity
            Category
            Status
            Source
            Language