ihavalyova/DiAtomic

View on GitHub

Showing 129 of 135 total issues

Function retranslateUi has 100 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def retranslateUi(self, MainWindow):
        MainWindow.setWindowTitle(QCoreApplication.translate("MainWindow", u"MainWindow", None))
        self.actionNew.setText(QCoreApplication.translate("MainWindow", u"New", None))
        self.groupBox.setTitle(QCoreApplication.translate("MainWindow", u"Levels, Fit and Spectrum", None))
        self.paramsFileLabel.setText(QCoreApplication.translate("MainWindow", u"Parameters file:", None))
Severity: Major
Found in diatomic/ui_diatom.py - About 4 hrs to fix

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

        def calculate_radial_function_on_grid(self, ypar):
    
            if self.model in ['pw', 'pointwise']:
                self._calculate_pointwise_coupling_on_grid(ypar)
    
    
    Severity: Major
    Found in diatomic/operator.py and 6 other locations - About 3 hrs to fix
    diatomic/operator.py on lines 109..118
    diatomic/operator.py on lines 373..382
    diatomic/operator.py on lines 503..512
    diatomic/operator.py on lines 606..615
    diatomic/operator.py on lines 693..702
    diatomic/operator.py on lines 800..809

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

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

        def calculate_radial_function_on_grid(self, ypar):
    
            if self.model in ['pw', 'pointwise']:
                self._calculate_pointwise_coupling_on_grid(ypar)
    
    
    Severity: Major
    Found in diatomic/operator.py and 6 other locations - About 3 hrs to fix
    diatomic/operator.py on lines 109..118
    diatomic/operator.py on lines 214..223
    diatomic/operator.py on lines 373..382
    diatomic/operator.py on lines 503..512
    diatomic/operator.py on lines 606..615
    diatomic/operator.py on lines 800..809

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

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

        def calculate_radial_function_on_grid(self, ypar):
    
            if self.model in ['pw', 'pointwise']:
                self._calculate_pointwise_coupling_on_grid(ypar)
    
    
    Severity: Major
    Found in diatomic/operator.py and 6 other locations - About 3 hrs to fix
    diatomic/operator.py on lines 214..223
    diatomic/operator.py on lines 373..382
    diatomic/operator.py on lines 503..512
    diatomic/operator.py on lines 606..615
    diatomic/operator.py on lines 693..702
    diatomic/operator.py on lines 800..809

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

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

        def calculate_radial_function_on_grid(self, ypar):
    
            if self.model in ['pw', 'pointwise']:
                self._calculate_pointwise_coupling_on_grid(ypar)
    
    
    Severity: Major
    Found in diatomic/operator.py and 6 other locations - About 3 hrs to fix
    diatomic/operator.py on lines 109..118
    diatomic/operator.py on lines 214..223
    diatomic/operator.py on lines 503..512
    diatomic/operator.py on lines 606..615
    diatomic/operator.py on lines 693..702
    diatomic/operator.py on lines 800..809

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

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

        def calculate_radial_function_on_grid(self, ypar):
    
            if self.model in ['pw', 'pointwise']:
                self._calculate_pointwise_coupling_on_grid(ypar)
    
    
    Severity: Major
    Found in diatomic/operator.py and 6 other locations - About 3 hrs to fix
    diatomic/operator.py on lines 109..118
    diatomic/operator.py on lines 214..223
    diatomic/operator.py on lines 373..382
    diatomic/operator.py on lines 606..615
    diatomic/operator.py on lines 693..702
    diatomic/operator.py on lines 800..809

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

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

        def calculate_radial_function_on_grid(self, ypar):
    
            if self.model in ['pw', 'pointwise']:
                self._calculate_pointwise_coupling_on_grid(ypar)
    
    
    Severity: Major
    Found in diatomic/operator.py and 6 other locations - About 3 hrs to fix
    diatomic/operator.py on lines 109..118
    diatomic/operator.py on lines 214..223
    diatomic/operator.py on lines 373..382
    diatomic/operator.py on lines 503..512
    diatomic/operator.py on lines 693..702
    diatomic/operator.py on lines 800..809

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

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

        def calculate_radial_function_on_grid(self, ypar):
    
            if self.model in ['pw', 'pointwise']:
                self._calculate_pointwise_coupling_on_grid(ypar)
    
    
    Severity: Major
    Found in diatomic/operator.py and 6 other locations - About 3 hrs to fix
    diatomic/operator.py on lines 109..118
    diatomic/operator.py on lines 214..223
    diatomic/operator.py on lines 373..382
    diatomic/operator.py on lines 503..512
    diatomic/operator.py on lines 606..615
    diatomic/operator.py on lines 693..702

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

    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

    Function __init__ has 97 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def __init__(self):
    
            super().__init__()
            Ui_MainWindow.__init__(self)
            self.setupUi(self)
    Severity: Major
    Found in diatomic/gui.py - About 3 hrs to fix

      Function _generate_state_widgets has 95 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def _generate_state_widgets(self):
      
              global state_count
              state_count += 1
              top_margin = 30
      Severity: Major
      Found in diatomic/gui.py - About 3 hrs to fix

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

            def _calculate_pointwise_coupling_on_grid(self, ypar):
        
                xpnts = self.xpoints * self.xunits
                # The parameters in ypar are in cm-1 units
                ypnts = ypar[self.sind:self.eind]  # * self.yunits
        Severity: Major
        Found in diatomic/operator.py and 4 other locations - About 3 hrs to fix
        diatomic/operator.py on lines 384..390
        diatomic/operator.py on lines 514..520
        diatomic/operator.py on lines 704..710
        diatomic/operator.py on lines 811..817

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

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

            def _calculate_pointwise_coupling_on_grid(self, ypar):
        
                xpnts = self.xpoints * self.xunits
                # The parameters in ypar are in cm-1 units
                ypnts = ypar[self.sind:self.eind]  # * self.yunits
        Severity: Major
        Found in diatomic/operator.py and 4 other locations - About 3 hrs to fix
        diatomic/operator.py on lines 225..231
        diatomic/operator.py on lines 384..390
        diatomic/operator.py on lines 704..710
        diatomic/operator.py on lines 811..817

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

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

            def _calculate_pointwise_coupling_on_grid(self, ypar):
        
                xpnts = self.xpoints * self.xunits
                # The parameters in ypar are in cm-1 units
                ypnts = ypar[self.sind:self.eind]  # * self.yunits
        Severity: Major
        Found in diatomic/operator.py and 4 other locations - About 3 hrs to fix
        diatomic/operator.py on lines 225..231
        diatomic/operator.py on lines 514..520
        diatomic/operator.py on lines 704..710
        diatomic/operator.py on lines 811..817

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

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

            def _calculate_pointwise_coupling_on_grid(self, ypar):
        
                xpnts = self.xpoints * self.xunits
                # The parameters in ypar are in cm-1 units
                ypnts = ypar[self.sind:self.eind]  # * self.yunits
        Severity: Major
        Found in diatomic/operator.py and 4 other locations - About 3 hrs to fix
        diatomic/operator.py on lines 225..231
        diatomic/operator.py on lines 384..390
        diatomic/operator.py on lines 514..520
        diatomic/operator.py on lines 811..817

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

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

            def _calculate_pointwise_coupling_on_grid(self, ypar):
        
                xpnts = self.xpoints * self.xunits
                # The parameters in ypar are in cm-1 units
                ypnts = ypar[self.sind:self.eind]  # * self.yunits
        Severity: Major
        Found in diatomic/operator.py and 4 other locations - About 3 hrs to fix
        diatomic/operator.py on lines 225..231
        diatomic/operator.py on lines 384..390
        diatomic/operator.py on lines 514..520
        diatomic/operator.py on lines 704..710

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

        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 calculate_coeff_C(self, xgrid, xi, xi1):
        
                ai = self.calculate_coeff_A(xgrid, xi, xi1)
        
                return (ai ** 3 - ai) * ((xi - xi1) ** 2) * (1.0 / 6.0)
        Severity: Major
        Found in diatomic/interpolator.py and 1 other location - About 3 hrs to fix
        diatomic/interpolator.py on lines 130..134

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 67.

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

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

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

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

        Refactorings

        Further Reading

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

            def _on_preview_output_button_clicked(self):
        
                if self.calc_eigenenr:
                    try:
                        cal_eignenr = np.genfromtxt(self.file_eigenenr, comments='#', autostrip=True)
        Severity: Minor
        Found in diatomic/gui.py - About 3 hrs to fix

        Cognitive Complexity

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

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

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

        Further reading

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

            def calculate_coeff_D(self, xgrid, xi, xi1):
        
                bi = self.calculate_coeff_B(xgrid, xi, xi1)
        
                return (bi ** 3 - bi) * ((xi - xi1) ** 2) * (1.0 / 6.0)
        Severity: Major
        Found in diatomic/interpolator.py and 1 other location - About 3 hrs to fix
        diatomic/interpolator.py on lines 124..128

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 67.

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

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

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

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

        Refactorings

        Further Reading

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

            def rule_so_diag(self):
        
                if self.state1._lambda == self.state2._lambda and \
                   self.state1.sigma == self.state2.sigma and \
                   self.state1.omega == self.state2.omega:
        Severity: Major
        Found in diatomic/operator.py and 1 other location - About 3 hrs to fix
        diatomic/operator.py on lines 877..884

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

        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 _rule_spin_spin_diag(self):
        
                if self.state1.omega == self.state2.omega and \
                   self.state1.spin == self.state2.spin and \
                   self.state1.sigma == self.state2.sigma:
        Severity: Major
        Found in diatomic/operator.py and 1 other location - About 3 hrs to fix
        diatomic/operator.py on lines 156..163

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

        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