aburrell/apexpy

View on GitHub

Showing 90 of 90 total issues

File test_Apex.py has 1419 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
"""Test the apexpy.Apex class

Notes
-----
Severity: Major
Found in apexpy/tests/test_Apex.py - About 3 days to fix

    File apex.py has 997 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    # -*- coding: utf-8 -*-
    """Classes that make up the core of apexpy."""
    
    import datetime as dt
    import numpy as np
    Severity: Major
    Found in apexpy/apex.py - About 2 days to fix

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

          @pytest.mark.parametrize("mlon,test_mlt",
                                   [([0, 180], [23.019261, 11.019261]),
                                    (np.array([0, 180]), [23.019261, 11.019261]),
                                    (np.array([[0], [180]]),
                                     np.array([[23.019261], [11.019261]])),
      Severity: Major
      Found in apexpy/tests/test_Apex.py and 1 other location - About 1 day to fix
      apexpy/tests/test_Apex.py on lines 1028..1055

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

      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

          @pytest.mark.parametrize("mlt,test_mlon",
                                   [([0, 12], [14.705551, 194.705551]),
                                    (np.array([0, 12]), [14.705551, 194.705551]),
                                    (np.array([[0], [12]]),
                                     np.array([[14.705551], [194.705551]])),
      Severity: Major
      Found in apexpy/tests/test_Apex.py and 1 other location - About 1 day to fix
      apexpy/tests/test_Apex.py on lines 1000..1026

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

      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

          @pytest.mark.parametrize("in_args,test_mapped",
                                   [([60, 15, 100, 500, [1, 2, 3]],
                                     [0.71152183, 2.35624876, 0.57260784]),
                                    ([60, 15, 100, 500, [2, 3, 4]],
                                     [1.56028502, 3.43916636, 0.78235384]),
      Severity: Major
      Found in apexpy/tests/test_Apex.py and 1 other location - About 1 day to fix
      apexpy/tests/test_Apex.py on lines 1331..1357

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

      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

          @pytest.mark.parametrize("in_args,test_mapped",
                                   [([60, 15, 100, 500, [1, 2, 3]],
                                     [0.81971957, 2.84512495, 0.69545001]),
                                    ([60, 15, 100, 500, [2, 3, 4]],
                                     [1.83027746, 4.14346436, 0.94764179]),
      Severity: Major
      Found in apexpy/tests/test_Apex.py and 1 other location - About 1 day to fix
      apexpy/tests/test_Apex.py on lines 1261..1287

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

      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

          @pytest.mark.parametrize("method_name, out_comp",
                                   [("geo2apex",
                                     (55.94841766357422, 94.10684204101562)),
                                    ("apex2geo",
                                     (51.476322174072266, -66.22817993164062,
      Severity: Major
      Found in apexpy/tests/test_Apex.py and 1 other location - About 1 day to fix
      apexpy/tests/test_Apex.py on lines 1801..1833

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

      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

          @pytest.mark.parametrize("method_name, out_comp",
                                   [("geo2apex",
                                     (56.25343704223633, 92.04932403564453)),
                                    ("apex2geo",
                                     (53.84184265136719, -66.93045806884766,
      Severity: Major
      Found in apexpy/tests/test_Apex.py and 1 other location - About 1 day to fix
      apexpy/tests/test_Apex.py on lines 687..719

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

      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

          @pytest.mark.parametrize('lat,test_cos', [
              (60, 0.27735009811261463), (10, 0.94307531289434765),
              ([60, 10], [0.27735009811261463, 0.94307531289434765]),
              ([[60, 10], [60, 10]], [[0.27735009811261463, 0.94307531289434765],
                                      [0.27735009811261463, 0.94307531289434765]])])
      Severity: Major
      Found in apexpy/tests/test_helpers.py and 1 other location - About 6 hrs to fix
      apexpy/tests/test_helpers.py on lines 153..173

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

      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

          @pytest.mark.parametrize('lat,test_sin', [
              (60, 0.96076892283052284), (10, 0.33257924500670238),
              ([60, 10], [0.96076892283052284, 0.33257924500670238]),
              ([[60, 10], [60, 10]], [[0.96076892283052284, 0.33257924500670238],
                                      [0.96076892283052284, 0.33257924500670238]])])
      Severity: Major
      Found in apexpy/tests/test_helpers.py and 1 other location - About 6 hrs to fix
      apexpy/tests/test_helpers.py on lines 175..195

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

      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

          @pytest.mark.parametrize("date_str", [("201501010"), ("2015010100000")])
          def test_invalid_date(self, date_str):
              """Test raises ValueError with an invalid input date.
      
              Parameters
      Severity: Major
      Found in apexpy/tests/test_cmd.py and 1 other location - About 6 hrs to fix
      apexpy/tests/test_cmd.py on lines 185..203

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

      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

          @pytest.mark.parametrize("coords", [("foobar apex"), ("geo foobar")])
          def test_invalid_coord(self, coords):
              """Test raises error when bad coordinate input provided.
      
              Parameters
      Severity: Major
      Found in apexpy/tests/test_cmd.py and 1 other location - About 6 hrs to fix
      apexpy/tests/test_cmd.py on lines 153..171

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

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

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

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

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

      Refactorings

      Further Reading

      Function convert has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
      Open

          def convert(self, lat, lon, source, dest, height=0, datetime=None,
                      precision=1e-10, ssheight=50 * 6371):
              """Converts between geodetic, modified apex, quasi-dipole and MLT.
      
              Parameters
      Severity: Minor
      Found in apexpy/apex.py - About 5 hrs to fix

      Cognitive Complexity

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

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

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

      Further reading

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

          def test_convert_mlt(self):
              """Test magnetic local time conversion."""
              # Build and execute the apexpy command line call
              cmd = ['python', '-m', 'apexpy', 'geo', 'mlt', '20150101000000',
                     '--height', '300', '-i', self.singlefile, '-o', self.outfile]
      Severity: Major
      Found in apexpy/tests/test_cmd.py and 1 other location - About 4 hrs to fix
      apexpy/tests/test_cmd.py on lines 104..114

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

      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 test_convert_single_line(self):
              """Test command line with a single line of output."""
              # Build and execute the apexpy command line call
              cmd = ['python', '-m', 'apexpy', 'geo', 'apex', '20150101000000',
                     '--height', '300', '-i', self.singlefile, '-o', self.outfile]
      Severity: Major
      Found in apexpy/tests/test_cmd.py and 1 other location - About 4 hrs to fix
      apexpy/tests/test_cmd.py on lines 141..151

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

      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

          @pytest.mark.parametrize("mlt_kwargs,test_mlon",
                                   [({}, 14.705535888671875),
                                    ({"ssheight": 100000}, 14.599319458007812)])
          def test_mlt2mlon_scalar_inputs(self, mlt_kwargs, test_mlon):
              """Test mlt2mlon with scalar inputs.
      Severity: Major
      Found in apexpy/tests/test_Apex.py and 1 other location - About 4 hrs to fix
      apexpy/tests/test_Apex.py on lines 960..978

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

      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

          @pytest.mark.parametrize("mlon_kwargs,test_mlt",
                                   [({}, 23.019629923502603),
                                    ({"ssheight": 100000}, 23.026712036132814)])
          def test_mlon2mlt_scalar_inputs(self, mlon_kwargs, test_mlt):
              """Test mlon2mlt with scalar inputs.
      Severity: Major
      Found in apexpy/tests/test_Apex.py and 1 other location - About 4 hrs to fix
      apexpy/tests/test_Apex.py on lines 980..998

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

      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

      Cyclomatic complexity is too high in method convert. (19)
      Open

          def convert(self, lat, lon, source, dest, height=0, datetime=None,
                      precision=1e-10, ssheight=50 * 6371):
              """Converts between geodetic, modified apex, quasi-dipole and MLT.
      
              Parameters
      Severity: Minor
      Found in apexpy/apex.py by radon

      Cyclomatic Complexity

      Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

      Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

      Construct Effect on CC Reasoning
      if +1 An if statement is a single decision.
      elif +1 The elif statement adds another decision.
      else +0 The else statement does not cause a new decision. The decision is at the if.
      for +1 There is a decision at the start of the loop.
      while +1 There is a decision at the while statement.
      except +1 Each except branch adds a new conditional path of execution.
      finally +0 The finally block is unconditionally executed.
      with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
      assert +1 The assert statement internally roughly equals a conditional statement.
      Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
      Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

      Source: http://radon.readthedocs.org/en/latest/intro.html

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

                  if coords == "geo":
                      self.test_basevec = (
                          np.array([4.42368795e-05, 4.42368795e-05]),
                          np.array([[0.01047826, 0.01047826],
                                    [0.33089194, 0.33089194],
      Severity: Major
      Found in apexpy/tests/test_Apex.py and 2 other locations - About 3 hrs to fix
      apexpy/tests/test_Apex.py on lines 1414..1423
      apexpy/tests/test_Apex.py on lines 1414..1433

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

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

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

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

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

      Refactorings

      Further Reading

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

                  elif coords == "apex":
                      self.test_basevec = (
                          np.array([4.48672735e-05, 4.48672735e-05]),
                          np.array([[-0.12510721, -0.12510721],
                                    [0.28945938, 0.28945938],
      Severity: Major
      Found in apexpy/tests/test_Apex.py and 2 other locations - About 3 hrs to fix
      apexpy/tests/test_Apex.py on lines 1404..1413
      apexpy/tests/test_Apex.py on lines 1414..1433

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

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

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

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

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

      Refactorings

      Further Reading

      Severity
      Category
      Status
      Source
      Language