pbrod/Nvector

View on GitHub

Showing 343 of 343 total issues

File objects.py has 1326 lines of code (exceeds 1000 allowed). Consider refactoring.
Open

"""
Object oriented interface to geodesic functions
===============================================

"""
Severity: Major
Found in src/nvector/objects.py - About 1 day to fix

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

    C1_COEFFICIENTS = (
        (-1. / 32., 3. / 16., -1. / 2, ),  # C11
        (-9. / 2048., 1. / 32., -1. / 16.),  # C12
        (3. / 256, -1. / 48.),  # C13
        (3. / 512., -5. / 512.),  # C14
    Severity: Major
    Found in src/nvector/karney.py and 2 other locations - About 6 hrs to fix
    src/nvector/karney.py on lines 36..42
    src/nvector/karney.py on lines 48..54

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

    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

    CM1_COEFFICIENTS = (
        (205. / 1536., -9. / 32., 1. / 2, ),  # CM11
        (1335. / 4096, -37. / 96., 5. / 16.),  # CM12
        (-75. / 128, 29. / 96.),  # CM13
        (-2391. / 2560., 539. / 1536.),  # CM14
    Severity: Major
    Found in src/nvector/karney.py and 2 other locations - About 6 hrs to fix
    src/nvector/karney.py on lines 27..33
    src/nvector/karney.py on lines 48..54

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

    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

    C2_COEFFICIENTS = (
        (1. / 32., 1. / 16., 1./2.),  # C21
        (35. / 2048, 1./32., 3. / 16.),  # C22
        (5. / 256, 5. / 48.),  # C23
        (7. / 512., 35. / 512.),  # C24
    Severity: Major
    Found in src/nvector/karney.py and 2 other locations - About 6 hrs to fix
    src/nvector/karney.py on lines 27..33
    src/nvector/karney.py on lines 36..42

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

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

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

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

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

    Refactorings

    Further Reading

    File core.py has 1063 lines of code (exceeds 1000 allowed). Consider refactoring.
    Open

    """
    Core geodesic functions
    =======================
    This file is part of NavLab and is available from www.navlab.net/nvector
    
    
    Severity: Major
    Found in src/nvector/core.py - About 3 hrs to fix

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

      def deg(*rad_angles):
          """
          Converts angle in radians to degrees.
      
          Parameters
      Severity: Major
      Found in src/nvector/util.py and 1 other location - About 2 hrs to fix
      src/nvector/util.py on lines 354..383

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

      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 rad(*deg_angles):
          """
          Converts angle in degrees to radians.
      
          Parameters
      Severity: Major
      Found in src/nvector/util.py and 1 other location - About 2 hrs to fix
      src/nvector/util.py on lines 322..351

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

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

      __doc__ = (__doc__  # @ReservedAssignment
                 + _make_summary(dict((n, _odict[n]) for n in __all__))
                 + 'License\n-------\n'
                 + _license.__doc__)
      Severity: Major
      Found in src/nvector/rotation.py and 3 other locations - About 2 hrs to fix
      src/nvector/core.py on lines 1351..1354
      src/nvector/objects.py on lines 1657..1660
      src/nvector/util.py on lines 599..602

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

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

      __doc__ = (__doc__  # @ReservedAssignment
                 + _make_summary(dict((n, _odict[n]) for n in __all__))
                 + 'License\n-------\n'
                 + _license.__doc__)
      Severity: Major
      Found in src/nvector/core.py and 3 other locations - About 2 hrs to fix
      src/nvector/objects.py on lines 1657..1660
      src/nvector/rotation.py on lines 571..574
      src/nvector/util.py on lines 599..602

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

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

      __doc__ = (__doc__  # @ReservedAssignment
                 + _make_summary(dict((n, _ODICT[n]) for n in __all__))
                 + 'License\n-------\n'
                 + _license.__doc__)
      Severity: Major
      Found in src/nvector/objects.py and 3 other locations - About 2 hrs to fix
      src/nvector/core.py on lines 1351..1354
      src/nvector/rotation.py on lines 571..574
      src/nvector/util.py on lines 599..602

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

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

      __doc__ = (__doc__  # @ReservedAssignment
                 + _make_summary(dict((n, _odict[n]) for n in __all__))
                 + 'License\n-------\n'
                 + _license.__doc__)
      Severity: Major
      Found in src/nvector/util.py and 3 other locations - About 2 hrs to fix
      src/nvector/core.py on lines 1351..1354
      src/nvector/objects.py on lines 1657..1660
      src/nvector/rotation.py on lines 571..574

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

      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 geodesic_distance has 41 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      def geodesic_distance(lat_a, lon_a, lat_b, lon_b, a=6378137, f=1.0 / 298.257223563):
          """
          Returns surface distance between positions A and B on an ellipsoid.
      
          Parameters
      Severity: Minor
      Found in src/nvector/karney.py - About 1 hr to fix

        Function __astroid has 29 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        def __astroid(x, y):
            """
            ASTROID  Solve the astroid equation
        
            K = ASTROID(X, Y) solves the quartic polynomial Eq. (55)
        Severity: Minor
        Found in src/nvector/karney.py - About 1 hr to fix

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

                  if np.ndim(radius) == 0 and result.size == 1:
                      return result[0]  # scalar outout
          Severity: Major
          Found in src/nvector/objects.py and 1 other location - About 1 hr to fix
          src/nvector/objects.py on lines 990..991

          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

                  if np.ndim(radius) == 0 and distance.size == 1:
                      return distance[0]  # scalar cross track distance
          Severity: Major
          Found in src/nvector/objects.py and 1 other location - About 1 hr to fix
          src/nvector/objects.py on lines 1077..1078

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

              @use_docstring_from(ECEFvector)
              def ECEFvector(self, *args, **kwds):
                  "{super}"
                  kwds.pop('frame', None)
                  return ECEFvector(*args, frame=self, **kwds)
          Severity: Major
          Found in src/nvector/objects.py and 2 other locations - About 1 hr to fix
          src/nvector/objects.py on lines 1461..1465
          src/nvector/objects.py on lines 1467..1471

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

              @use_docstring_from(GeoPoint)
              def GeoPoint(self, *args, **kwds):
                  "{super}"
                  kwds.pop('frame', None)
                  return GeoPoint(*args, frame=self, **kwds)
          Severity: Major
          Found in src/nvector/objects.py and 2 other locations - About 1 hr to fix
          src/nvector/objects.py on lines 1467..1471
          src/nvector/objects.py on lines 1473..1477

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

              @use_docstring_from(Nvector)
              def Nvector(self, *args, **kwds):
                  "{super}"
                  kwds.pop('frame', None)
                  return Nvector(*args, frame=self, **kwds)
          Severity: Major
          Found in src/nvector/objects.py and 2 other locations - About 1 hr to fix
          src/nvector/objects.py on lines 1461..1465
          src/nvector/objects.py on lines 1473..1477

          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

          Function array_to_list_dict has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

          def array_to_list_dict(data):
              """
              Convert dict arrays to dict of lists.
          
              Parameters
          Severity: Minor
          Found in src/nvector/util.py - About 55 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

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

          GETTING_STARTED_FUNCTIONAL = """
          Functional examples
          ===================
          
          Below the functional solution to some common geodesic problems are given.
          Severity: Minor
          Found in src/nvector/_examples.py and 1 other location - About 40 mins to fix
          src/nvector/_examples.py on lines 780..794

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

          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