ihavalyova/DiAtomic

View on GitHub
diatomic/operator.py

Summary

Maintainability
F
1 mo
Test Coverage

File operator.py has 581 lines of code (exceeds 250 allowed). Consider refactoring.
Wontfix

import numpy as np

from math import sqrt as _sqrt
from scipy.interpolate import CubicSpline as _CubicSpline

Severity: Major
Found in diatomic/operator.py - About 1 day to fix

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

        def __init__(self, objs=None, pair_states=None, label='', model='pointwise',
                     rotc=0.0, multiplier=1, custom_func=None, shift_by=0.0):
    
            diatomic, grid, states = objs[0], objs[1], objs[2]
    
    
    Severity: Minor
    Found in diatomic/operator.py - About 1 hr to fix

      Function __init__ has 8 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def __init__(self, objs, pair_states, label, model='pointwise', rotc=0.0,
      Severity: Major
      Found in diatomic/operator.py - About 1 hr to fix

        Function __init__ has 8 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def __init__(self, objs, pair_states, label, model='pointwise', rotc=0.0,
        Severity: Major
        Found in diatomic/operator.py - About 1 hr to fix

          Function __init__ has 8 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def __init__(self, objs, pair_states, label, model='pointwise', rotc=0.0,
          Severity: Major
          Found in diatomic/operator.py - About 1 hr to fix

            Function __init__ has 8 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def __init__(self, objs, pair_states, label, model='pointwise', rotc=0.0,
            Severity: Major
            Found in diatomic/operator.py - About 1 hr to fix

              Function __init__ has 8 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  def __init__(self, objs=None, pair_states=None, label='', model='pointwise',
              Severity: Major
              Found in diatomic/operator.py - About 1 hr to fix

                Function __init__ has 8 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    def __init__(self, objs, pair_states, label, model='pointwise', rotc=0.0,
                Severity: Major
                Found in diatomic/operator.py - About 1 hr to fix

                  Function __init__ has 8 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      def __init__(self, objs, pair_states, label, model='pointwise', rotc=0.0,
                  Severity: Major
                  Found in diatomic/operator.py - About 1 hr to fix

                    Function __init__ has 8 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        def __init__(self, objs, pair_states, label, model='pointwise', rotc=0.0,
                    Severity: Major
                    Found in diatomic/operator.py - About 1 hr to fix

                      Function _rule_spin_spin_nondiag has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def _rule_spin_spin_nondiag(self):
                      
                              lambda_diff = self.state1._lambda - self.state2._lambda
                              sigma_diff = self.state2.sigma - self.state1.sigma
                      
                      
                      Severity: Minor
                      Found in diatomic/operator.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 _rule_lj_interaction has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def _rule_lj_interaction(self, jrotn):
                      
                              # to check the abs values
                              omega_diff = abs(self.state1.omega - self.state2.omega)
                              lambda_diff = abs(self.state1._lambda - self.state2._lambda)
                      Severity: Minor
                      Found in diatomic/operator.py - About 25 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

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

                          def __init__(self, objs, pair_states, label, model='pointwise', rotc=0.0,
                                       multiplier=1, custom_func=None, shift_by=0.0):
                      
                              Operator.__init__(self, objs, pair_states, label, model=model,
                                                rotc=rotc, multiplier=multiplier,
                      Severity: Major
                      Found in diatomic/operator.py and 6 other locations - About 1 day to fix
                      diatomic/operator.py on lines 81..99
                      diatomic/operator.py on lines 337..355
                      diatomic/operator.py on lines 472..490
                      diatomic/operator.py on lines 575..592
                      diatomic/operator.py on lines 662..679
                      diatomic/operator.py on lines 773..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 195.

                      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 __init__(self, objs, pair_states, label, model='pointwise', rotc=0.0,
                                       multiplier=1, custom_func=None, shift_by=0.0):
                      
                              Operator.__init__(self, objs, pair_states, label, model=model,
                                                rotc=rotc, multiplier=multiplier,
                      Severity: Major
                      Found in diatomic/operator.py and 6 other locations - About 1 day to fix
                      diatomic/operator.py on lines 177..195
                      diatomic/operator.py on lines 337..355
                      diatomic/operator.py on lines 472..490
                      diatomic/operator.py on lines 575..592
                      diatomic/operator.py on lines 662..679
                      diatomic/operator.py on lines 773..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 195.

                      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 __init__(self, objs, pair_states, label, model='pointwise', rotc=0.0,
                                       multiplier=1, custom_func=None, shift_by=0.0):
                      
                              Operator.__init__(self, objs, pair_states, label, model=model,
                                                rotc=rotc, multiplier=multiplier,
                      Severity: Major
                      Found in diatomic/operator.py and 6 other locations - About 1 day to fix
                      diatomic/operator.py on lines 81..99
                      diatomic/operator.py on lines 177..195
                      diatomic/operator.py on lines 337..355
                      diatomic/operator.py on lines 575..592
                      diatomic/operator.py on lines 662..679
                      diatomic/operator.py on lines 773..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 195.

                      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 __init__(self, objs, pair_states, label, model='pointwise', rotc=0.0,
                                       multiplier=1, custom_func=None, shift_by=0.0):
                      
                              Operator.__init__(self, objs, pair_states, label, model=model,
                                                rotc=rotc, multiplier=multiplier,
                      Severity: Major
                      Found in diatomic/operator.py and 6 other locations - About 1 day to fix
                      diatomic/operator.py on lines 81..99
                      diatomic/operator.py on lines 177..195
                      diatomic/operator.py on lines 337..355
                      diatomic/operator.py on lines 472..490
                      diatomic/operator.py on lines 662..679
                      diatomic/operator.py on lines 773..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 195.

                      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 __init__(self, objs, pair_states, label, model='pointwise', rotc=0.0,
                                       multiplier=1, custom_func=None, shift_by=0.0):
                      
                              Operator.__init__(self, objs, pair_states, label, model=model,
                                                rotc=rotc, multiplier=multiplier,
                      Severity: Major
                      Found in diatomic/operator.py and 6 other locations - About 1 day to fix
                      diatomic/operator.py on lines 81..99
                      diatomic/operator.py on lines 177..195
                      diatomic/operator.py on lines 472..490
                      diatomic/operator.py on lines 575..592
                      diatomic/operator.py on lines 662..679
                      diatomic/operator.py on lines 773..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 195.

                      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 __init__(self, objs, pair_states, label, model='pointwise', rotc=0.0,
                                       multiplier=1, custom_func=None, shift_by=0.0):
                      
                              Operator.__init__(self, objs, pair_states, label, model=model,
                                                rotc=rotc, multiplier=multiplier,
                      Severity: Major
                      Found in diatomic/operator.py and 6 other locations - About 1 day to fix
                      diatomic/operator.py on lines 81..99
                      diatomic/operator.py on lines 177..195
                      diatomic/operator.py on lines 337..355
                      diatomic/operator.py on lines 472..490
                      diatomic/operator.py on lines 575..592
                      diatomic/operator.py on lines 662..679

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

                      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 __init__(self, objs, pair_states, label, model='pointwise', rotc=0.0,
                                       multiplier=1, custom_func=None, shift_by=0.0):
                      
                              Operator.__init__(self, objs, pair_states, label, model=model,
                                                rotc=rotc, multiplier=multiplier,
                      Severity: Major
                      Found in diatomic/operator.py and 6 other locations - About 1 day to fix
                      diatomic/operator.py on lines 81..99
                      diatomic/operator.py on lines 177..195
                      diatomic/operator.py on lines 337..355
                      diatomic/operator.py on lines 472..490
                      diatomic/operator.py on lines 575..592
                      diatomic/operator.py on lines 773..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 195.

                      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 _rule_sj_interaction(self, jrotn):
                      
                              omega_diff = self.state1.omega - self.state2.omega
                              sigma_diff = self.state1.sigma - self.state2.sigma
                              rule_sj = \
                      Severity: Major
                      Found in diatomic/operator.py and 1 other location - About 1 day to fix
                      diatomic/operator.py on lines 754..768

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

                      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 _rule_sj_interaction(self, jrotn):
                      
                              omega_diff = self.state1.omega - self.state2.omega
                              sigma_diff = self.state1.sigma - self.state2.sigma
                              rule_sj = \
                      Severity: Major
                      Found in diatomic/operator.py and 1 other location - About 1 day to fix
                      diatomic/operator.py on lines 432..446

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

                      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_cspline_coupling_on_grid(self, ypar):
                      
                              xpnts = self.xpoints * self.xunits
                              ypnts = ypar[self.sind:self.eind] * self.yunits
                              cs = CSpline(xpnts, ypnts)
                      Severity: Major
                      Found in diatomic/operator.py and 6 other locations - About 4 hrs to fix
                      diatomic/operator.py on lines 233..238
                      diatomic/operator.py on lines 392..397
                      diatomic/operator.py on lines 522..527
                      diatomic/operator.py on lines 625..630
                      diatomic/operator.py on lines 712..717
                      diatomic/operator.py on lines 819..824

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

                      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_cspline_coupling_on_grid(self, ypar):
                      
                              xpnts = self.xpoints * self.xunits
                              ypnts = ypar[self.sind:self.eind] * self.yunits
                              cs = CSpline(xpnts, ypnts)
                      Severity: Major
                      Found in diatomic/operator.py and 6 other locations - About 4 hrs to fix
                      diatomic/operator.py on lines 128..133
                      diatomic/operator.py on lines 233..238
                      diatomic/operator.py on lines 392..397
                      diatomic/operator.py on lines 625..630
                      diatomic/operator.py on lines 712..717
                      diatomic/operator.py on lines 819..824

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

                      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_cspline_coupling_on_grid(self, ypar):
                      
                              xpnts = self.xpoints * self.xunits
                              ypnts = ypar[self.sind:self.eind] * self.yunits
                              cs = CSpline(xpnts, ypnts)
                      Severity: Major
                      Found in diatomic/operator.py and 6 other locations - About 4 hrs to fix
                      diatomic/operator.py on lines 128..133
                      diatomic/operator.py on lines 233..238
                      diatomic/operator.py on lines 522..527
                      diatomic/operator.py on lines 625..630
                      diatomic/operator.py on lines 712..717
                      diatomic/operator.py on lines 819..824

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

                      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_cspline_coupling_on_grid(self, ypar):
                      
                              xpnts = self.xpoints * self.xunits
                              ypnts = ypar[self.sind:self.eind] * self.yunits
                              cs = CSpline(xpnts, ypnts)
                      Severity: Major
                      Found in diatomic/operator.py and 6 other locations - About 4 hrs to fix
                      diatomic/operator.py on lines 128..133
                      diatomic/operator.py on lines 233..238
                      diatomic/operator.py on lines 392..397
                      diatomic/operator.py on lines 522..527
                      diatomic/operator.py on lines 625..630
                      diatomic/operator.py on lines 712..717

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

                      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_cspline_coupling_on_grid(self, ypar):
                      
                              xpnts = self.xpoints * self.xunits
                              ypnts = ypar[self.sind:self.eind] * self.yunits
                              cs = CSpline(xpnts, ypnts)
                      Severity: Major
                      Found in diatomic/operator.py and 6 other locations - About 4 hrs to fix
                      diatomic/operator.py on lines 128..133
                      diatomic/operator.py on lines 233..238
                      diatomic/operator.py on lines 392..397
                      diatomic/operator.py on lines 522..527
                      diatomic/operator.py on lines 625..630
                      diatomic/operator.py on lines 819..824

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

                      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_cspline_coupling_on_grid(self, ypar):
                      
                              xpnts = self.xpoints * self.xunits
                              ypnts = ypar[self.sind:self.eind] * self.yunits
                              cs = CSpline(xpnts, ypnts)
                      Severity: Major
                      Found in diatomic/operator.py and 6 other locations - About 4 hrs to fix
                      diatomic/operator.py on lines 128..133
                      diatomic/operator.py on lines 392..397
                      diatomic/operator.py on lines 522..527
                      diatomic/operator.py on lines 625..630
                      diatomic/operator.py on lines 712..717
                      diatomic/operator.py on lines 819..824

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

                      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_cspline_coupling_on_grid(self, ypar):
                      
                              xpnts = self.xpoints * self.xunits
                              ypnts = ypar[self.sind:self.eind] * self.yunits
                              cs = CSpline(xpnts, ypnts)
                      Severity: Major
                      Found in diatomic/operator.py and 6 other locations - About 4 hrs to fix
                      diatomic/operator.py on lines 128..133
                      diatomic/operator.py on lines 233..238
                      diatomic/operator.py on lines 392..397
                      diatomic/operator.py on lines 522..527
                      diatomic/operator.py on lines 712..717
                      diatomic/operator.py on lines 819..824

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

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

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

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

                              rule_ss2 = \
                                  (self.state1.spin - self.state2.spin) == 2.0 or \
                                  (self.state1.spin - self.state2.spin) == -2.0 and \
                                  rule_ss2_2so
                      Severity: Major
                      Found in diatomic/operator.py and 1 other location - About 2 hrs to fix
                      diatomic/operator.py on lines 862..865

                      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

                              rule_ss1 = \
                                  (self.state1.spin - self.state2.spin) == 1.0 or \
                                  (self.state1.spin - self.state2.spin) == -1.0 and \
                                  rule_ss1_1so
                      Severity: Major
                      Found in diatomic/operator.py and 1 other location - About 2 hrs to fix
                      diatomic/operator.py on lines 867..870

                      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

                          def _lambda_doubling_e_parity(self, jjrotn, mass, par):
                      
                              if par == 1:
                                  return self._lambda_doubling(jjrotn, mass, par)
                      
                      
                      Severity: Major
                      Found in diatomic/operator.py and 1 other location - About 1 hr to fix
                      diatomic/operator.py on lines 652..657

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

                          def _lambda_doubling_f_parity(self, jjrotn, mass, par):
                      
                              if par == 0:
                                  return self._lambda_doubling(jjrotn, mass, par)
                      
                      
                      Severity: Major
                      Found in diatomic/operator.py and 1 other location - About 1 hr to fix
                      diatomic/operator.py on lines 645..650

                      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

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

                          def _calculate_custom_coupling_on_grid(self, ypar):
                      
                              xpnts = self.rgrid
                              # The parameters in ypar are in au units
                              ypnts = ypar[self.sind:self.eind]  # * self.yunits
                      Severity: Major
                      Found in diatomic/operator.py and 6 other locations - About 1 hr to fix
                      diatomic/operator.py on lines 135..140
                      diatomic/operator.py on lines 240..245
                      diatomic/operator.py on lines 399..404
                      diatomic/operator.py on lines 529..534
                      diatomic/operator.py on lines 632..637
                      diatomic/operator.py on lines 719..724

                      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

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

                          def _calculate_custom_coupling_on_grid(self, ypar):
                      
                              xpnts = self.rgrid
                              # The parameters in ypar are in au units
                              ypnts = ypar[self.sind:self.eind]  # * self.yunits
                      Severity: Major
                      Found in diatomic/operator.py and 6 other locations - About 1 hr to fix
                      diatomic/operator.py on lines 135..140
                      diatomic/operator.py on lines 240..245
                      diatomic/operator.py on lines 399..404
                      diatomic/operator.py on lines 529..534
                      diatomic/operator.py on lines 719..724
                      diatomic/operator.py on lines 826..831

                      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

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

                          def _calculate_custom_coupling_on_grid(self, ypar):
                      
                              xpnts = self.rgrid
                              # The parameters in ypar are in au units
                              ypnts = ypar[self.sind:self.eind]  # * self.yunits
                      Severity: Major
                      Found in diatomic/operator.py and 6 other locations - About 1 hr to fix
                      diatomic/operator.py on lines 135..140
                      diatomic/operator.py on lines 240..245
                      diatomic/operator.py on lines 399..404
                      diatomic/operator.py on lines 529..534
                      diatomic/operator.py on lines 632..637
                      diatomic/operator.py on lines 826..831

                      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

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

                          def _calculate_custom_coupling_on_grid(self, ypar):
                      
                              xpnts = self.rgrid
                              # The parameters in ypar are in au units
                              ypnts = ypar[self.sind:self.eind]  # * self.yunits
                      Severity: Major
                      Found in diatomic/operator.py and 6 other locations - About 1 hr to fix
                      diatomic/operator.py on lines 240..245
                      diatomic/operator.py on lines 399..404
                      diatomic/operator.py on lines 529..534
                      diatomic/operator.py on lines 632..637
                      diatomic/operator.py on lines 719..724
                      diatomic/operator.py on lines 826..831

                      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

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

                          def _calculate_custom_coupling_on_grid(self, ypar):
                      
                              xpnts = self.rgrid
                              # The parameters in ypar are in au units
                              ypnts = ypar[self.sind:self.eind]  # * self.yunits
                      Severity: Major
                      Found in diatomic/operator.py and 6 other locations - About 1 hr to fix
                      diatomic/operator.py on lines 135..140
                      diatomic/operator.py on lines 399..404
                      diatomic/operator.py on lines 529..534
                      diatomic/operator.py on lines 632..637
                      diatomic/operator.py on lines 719..724
                      diatomic/operator.py on lines 826..831

                      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

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

                          def _calculate_custom_coupling_on_grid(self, ypar):
                      
                              xpnts = self.rgrid
                              # The parameters in ypar are in au units
                              ypnts = ypar[self.sind:self.eind]  # * self.yunits
                      Severity: Major
                      Found in diatomic/operator.py and 6 other locations - About 1 hr to fix
                      diatomic/operator.py on lines 135..140
                      diatomic/operator.py on lines 240..245
                      diatomic/operator.py on lines 529..534
                      diatomic/operator.py on lines 632..637
                      diatomic/operator.py on lines 719..724
                      diatomic/operator.py on lines 826..831

                      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

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

                          def _calculate_custom_coupling_on_grid(self, ypar):
                      
                              xpnts = self.rgrid
                              # The parameters in ypar are in au units
                              ypnts = ypar[self.sind:self.eind]  # * self.yunits
                      Severity: Major
                      Found in diatomic/operator.py and 6 other locations - About 1 hr to fix
                      diatomic/operator.py on lines 135..140
                      diatomic/operator.py on lines 240..245
                      diatomic/operator.py on lines 399..404
                      diatomic/operator.py on lines 632..637
                      diatomic/operator.py on lines 719..724
                      diatomic/operator.py on lines 826..831

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

                              if self.state2.omega == 0 and self.state2.sigma < 0:
                                  sg2 = abs(self.state2.sigma)
                      Severity: Major
                      Found in diatomic/operator.py and 1 other location - About 1 hr to fix
                      diatomic/operator.py on lines 289..290

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

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

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

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

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

                      Refactorings

                      Further Reading

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

                              if self.state1.omega == 0 and self.state1.sigma < 0:
                                  sg1 = abs(self.state1.sigma)
                      Severity: Major
                      Found in diatomic/operator.py and 1 other location - About 1 hr to fix
                      diatomic/operator.py on lines 293..294

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

                      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_matrix_elements(self, jrotn, par, iso):
                      
                              self.matrix[self.dd] = self.spin_orbit_interaction() * self.ygrid
                      
                              return self.matrix
                      Severity: Major
                      Found in diatomic/operator.py and 1 other location - About 1 hr to fix
                      diatomic/operator.py on lines 794..798

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

                      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_matrix_elements(self, jrotn, par, iso):
                      
                              self.matrix[self.dd] = self._spin_spin_interaction() * self.ygrid
                      
                              return self.matrix
                      Severity: Major
                      Found in diatomic/operator.py and 1 other location - About 1 hr to fix
                      diatomic/operator.py on lines 103..107

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

                      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

                              rule_omegaj = \
                                  self._rule_sj_interaction(jrotn) and \
                                  _sqrt(jjrotn - (self.state1.omega * self.state2.omega))
                      Severity: Major
                      Found in diatomic/operator.py and 1 other location - About 1 hr to fix
                      diatomic/operator.py on lines 261..262

                      Duplicated Code

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

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

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

                      Tuning

                      This issue has a mass of 40.

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

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

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

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

                      Refactorings

                      Further Reading

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

                              rule_omegaj = self._rule_lj_interaction(jrotn) and \
                                  _sqrt(jjrotn - (self.state1.omega * self.state2.omega))
                      Severity: Major
                      Found in diatomic/operator.py and 1 other location - About 1 hr to fix
                      diatomic/operator.py on lines 422..424

                      Duplicated Code

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

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

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

                      Tuning

                      This issue has a mass of 40.

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

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

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

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

                      Refactorings

                      Further Reading

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

                              rule_ss2_2so = \
                                  (lambda_diff == -1.0 * sigma_diff == 2.0) or \
                                  (lambda_diff == -1.0 * sigma_diff == -2.0)
                      Severity: Major
                      Found in diatomic/operator.py and 1 other location - About 1 hr to fix
                      diatomic/operator.py on lines 853..855

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

                      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

                              rule_ss1_1so = \
                                  (lambda_diff == -1.0 * sigma_diff == 1.0) or \
                                  (lambda_diff == -1.0 * sigma_diff == -1.0)
                      Severity: Major
                      Found in diatomic/operator.py and 1 other location - About 1 hr to fix
                      diatomic/operator.py on lines 858..860

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

                      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