pbrod/Nvector

View on GitHub

Showing 343 of 343 total issues

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

GETTING_STARTED = """
Getting Started
===============

Below the object-oriented 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 797..810

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

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

                 arctan2(-R_AB[1, 2, ...], R_AB[2, 2, ...]),
Severity: Minor
Found in src/nvector/rotation.py and 1 other location - About 40 mins to fix
src/nvector/rotation.py on lines 145..145

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

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

                 arctan2(-R_AB[0, 1, ...], R_AB[0, 0, ...]),
Severity: Minor
Found in src/nvector/rotation.py and 1 other location - About 40 mins to fix
src/nvector/rotation.py on lines 139..139

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

Function _interp_vectors has 8 arguments (exceeds 7 allowed). Consider refactoring.
Open

def _interp_vectors(t_i, t, nvectors, kind, window_length, polyorder, mode, cval):
Severity: Major
Found in src/nvector/core.py - About 35 mins to fix

    Function interp_nvectors has 8 arguments (exceeds 7 allowed). Consider refactoring.
    Open

    def interp_nvectors(t_i, t, nvectors, kind='linear', window_length=0, polyorder=2, mode='interp',
    Severity: Major
    Found in src/nvector/core.py - About 35 mins to fix

      Function _solve_alpha1 has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

      def _solve_alpha1(alpha1, blat1, blat2, true_lamda12, a, f, tol=1e-15):
          b = polar_radius(a, f)
          eta = third_flattening(f)
          e_2, e2m = eccentricity2(f)
      
      
      Severity: Minor
      Found in src/nvector/karney.py - About 35 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

          @property
          def positionA(self):
              """positionA is deprecated, use point_a instead!"""  # @ReservedAssignment
              warnings.warn("positionA is deprecated, use point_a instead!",
                            category=DeprecationWarning, stacklevel=2)
      Severity: Minor
      Found in src/nvector/objects.py and 1 other location - About 30 mins to fix
      src/nvector/objects.py on lines 931..936

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

      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

          @property
          def positionB(self):
              """positionB is deprecated, use point_b instead!"""  # @ReservedAssignment
              warnings.warn("positionB is deprecated, use point_b instead!",
                            category=DeprecationWarning, stacklevel=2)
      Severity: Minor
      Found in src/nvector/objects.py and 1 other location - About 30 mins to fix
      src/nvector/objects.py on lines 924..929

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

      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 use_docstring has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

      def use_docstring(docstring):
          """This decorator modifies the decorated function's docstring with supplied docstring.
      
          If the function's docstring is None it is replaced with the supplied docstring.
          otherwise it is set to old_docstring.format(super=docstring)
      Severity: Minor
      Found in src/nvector/_common.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

      Missing whitespace around arithmetic operator
      Open

              y_0 = factor * y_1 - y_0 + c[k-1]
      Severity: Minor
      Found in src/nvector/karney.py by pep8

      Surround operators with a single space on either side.

      - Always surround these binary operators with a single space on
        either side: assignment (=), augmented assignment (+=, -= etc.),
        comparisons (==, <, >, !=, <=, >=, in, not in, is, is not),
        Booleans (and, or, not).
      
      - If operators with different priorities are used, consider adding
        whitespace around the operators with the lowest priorities.
      
      Okay: i = i + 1
      Okay: submitted += 1
      Okay: x = x * 2 - 1
      Okay: hypot2 = x * x + y * y
      Okay: c = (a + b) * (a - b)
      Okay: foo(bar, key='word', *args, **kwargs)
      Okay: alpha[:-i]
      
      E225: i=i+1
      E225: submitted +=1
      E225: x = x /2 - 1
      E225: z = x **y
      E225: z = 1and 1
      E226: c = (a+b) * (a-b)
      E226: hypot2 = x*x + y*y
      E227: c = a|b
      E228: msg = fmt%(errno, errmsg)

      Missing whitespace around arithmetic operator
      Open

      INFO = importlib.import_module(PACKAGE_NAME+'._info','./src')
      Severity: Minor
      Found in build_package.py by pep8

      Surround operators with a single space on either side.

      - Always surround these binary operators with a single space on
        either side: assignment (=), augmented assignment (+=, -= etc.),
        comparisons (==, <, >, !=, <=, >=, in, not in, is, is not),
        Booleans (and, or, not).
      
      - If operators with different priorities are used, consider adding
        whitespace around the operators with the lowest priorities.
      
      Okay: i = i + 1
      Okay: submitted += 1
      Okay: x = x * 2 - 1
      Okay: hypot2 = x * x + y * y
      Okay: c = (a + b) * (a - b)
      Okay: foo(bar, key='word', *args, **kwargs)
      Okay: alpha[:-i]
      
      E225: i=i+1
      E225: submitted +=1
      E225: x = x /2 - 1
      E225: z = x **y
      E225: z = 1and 1
      E226: c = (a+b) * (a-b)
      E226: hypot2 = x*x + y*y
      E227: c = a|b
      E228: msg = fmt%(errno, errmsg)

      Missing whitespace around arithmetic operator
      Open

              a1, f = self.a-z, self.f
      Severity: Minor
      Found in src/nvector/objects.py by pep8

      Surround operators with a single space on either side.

      - Always surround these binary operators with a single space on
        either side: assignment (=), augmented assignment (+=, -= etc.),
        comparisons (==, <, >, !=, <=, >=, in, not in, is, is not),
        Booleans (and, or, not).
      
      - If operators with different priorities are used, consider adding
        whitespace around the operators with the lowest priorities.
      
      Okay: i = i + 1
      Okay: submitted += 1
      Okay: x = x * 2 - 1
      Okay: hypot2 = x * x + y * y
      Okay: c = (a + b) * (a - b)
      Okay: foo(bar, key='word', *args, **kwargs)
      Okay: alpha[:-i]
      
      E225: i=i+1
      E225: submitted +=1
      E225: x = x /2 - 1
      E225: z = x **y
      E225: z = 1and 1
      E226: c = (a+b) * (a-b)
      E226: hypot2 = x*x + y*y
      E227: c = a|b
      E228: msg = fmt%(errno, errmsg)

      Missing whitespace around arithmetic operator
      Open

          sin_alpha2_cos_blat2 = sin(alpha1)*cos_blat1
      Severity: Minor
      Found in src/nvector/karney.py by pep8

      Surround operators with a single space on either side.

      - Always surround these binary operators with a single space on
        either side: assignment (=), augmented assignment (+=, -= etc.),
        comparisons (==, <, >, !=, <=, >=, in, not in, is, is not),
        Booleans (and, or, not).
      
      - If operators with different priorities are used, consider adding
        whitespace around the operators with the lowest priorities.
      
      Okay: i = i + 1
      Okay: submitted += 1
      Okay: x = x * 2 - 1
      Okay: hypot2 = x * x + y * y
      Okay: c = (a + b) * (a - b)
      Okay: foo(bar, key='word', *args, **kwargs)
      Okay: alpha[:-i]
      
      E225: i=i+1
      E225: submitted +=1
      E225: x = x /2 - 1
      E225: z = x **y
      E225: z = 1and 1
      E226: c = (a+b) * (a-b)
      E226: hypot2 = x*x + y*y
      E227: c = a|b
      E228: msg = fmt%(errno, errmsg)

      Missing whitespace around arithmetic operator
      Open

          cos_alpha2_cos_blat2 = sgn*np.sqrt(cos(alpha1)**2 * cos_blat1**2
      Severity: Minor
      Found in src/nvector/karney.py by pep8

      Surround operators with a single space on either side.

      - Always surround these binary operators with a single space on
        either side: assignment (=), augmented assignment (+=, -= etc.),
        comparisons (==, <, >, !=, <=, >=, in, not in, is, is not),
        Booleans (and, or, not).
      
      - If operators with different priorities are used, consider adding
        whitespace around the operators with the lowest priorities.
      
      Okay: i = i + 1
      Okay: submitted += 1
      Okay: x = x * 2 - 1
      Okay: hypot2 = x * x + y * y
      Okay: c = (a + b) * (a - b)
      Okay: foo(bar, key='word', *args, **kwargs)
      Okay: alpha[:-i]
      
      E225: i=i+1
      E225: submitted +=1
      E225: x = x /2 - 1
      E225: z = x **y
      E225: z = 1and 1
      E226: c = (a+b) * (a-b)
      E226: hypot2 = x*x + y*y
      E227: c = a|b
      E228: msg = fmt%(errno, errmsg)

      Missing whitespace around arithmetic operator
      Open

              k_sin_s1 = sqrt(1+k_2*sin_sigma1**2)
      Severity: Minor
      Found in src/nvector/karney.py by pep8

      Surround operators with a single space on either side.

      - Always surround these binary operators with a single space on
        either side: assignment (=), augmented assignment (+=, -= etc.),
        comparisons (==, <, >, !=, <=, >=, in, not in, is, is not),
        Booleans (and, or, not).
      
      - If operators with different priorities are used, consider adding
        whitespace around the operators with the lowest priorities.
      
      Okay: i = i + 1
      Okay: submitted += 1
      Okay: x = x * 2 - 1
      Okay: hypot2 = x * x + y * y
      Okay: c = (a + b) * (a - b)
      Okay: foo(bar, key='word', *args, **kwargs)
      Okay: alpha[:-i]
      
      E225: i=i+1
      E225: submitted +=1
      E225: x = x /2 - 1
      E225: z = x **y
      E225: z = 1and 1
      E226: c = (a+b) * (a-b)
      E226: hypot2 = x*x + y*y
      E227: c = a|b
      E228: msg = fmt%(errno, errmsg)

      Missing whitespace after ','
      Open

      LICENSE = importlib.import_module(PACKAGE_NAME+'.license','./src')
      Severity: Minor
      Found in build_package.py by pep8

      Each comma, semicolon or colon should be followed by whitespace.

      Okay: [a, b]
      Okay: (3,)
      Okay: a[1:4]
      Okay: a[:4]
      Okay: a[1:]
      Okay: a[1:4:2]
      E231: ['a','b']
      E231: foo(bar,baz)
      E231: [{'a':'b'}]

      Missing whitespace around arithmetic operator
      Open

      LICENSE = importlib.import_module(PACKAGE_NAME+'.license','./src')
      Severity: Minor
      Found in build_package.py by pep8

      Surround operators with a single space on either side.

      - Always surround these binary operators with a single space on
        either side: assignment (=), augmented assignment (+=, -= etc.),
        comparisons (==, <, >, !=, <=, >=, in, not in, is, is not),
        Booleans (and, or, not).
      
      - If operators with different priorities are used, consider adding
        whitespace around the operators with the lowest priorities.
      
      Okay: i = i + 1
      Okay: submitted += 1
      Okay: x = x * 2 - 1
      Okay: hypot2 = x * x + y * y
      Okay: c = (a + b) * (a - b)
      Okay: foo(bar, key='word', *args, **kwargs)
      Okay: alpha[:-i]
      
      E225: i=i+1
      E225: submitted +=1
      E225: x = x /2 - 1
      E225: z = x **y
      E225: z = 1and 1
      E226: c = (a+b) * (a-b)
      E226: hypot2 = x*x + y*y
      E227: c = a|b
      E228: msg = fmt%(errno, errmsg)

      Missing whitespace around arithmetic operator
      Open

          alpha11 = np.where((f < 0)*np.ones(shape), alpha1p, alpha1o)
      Severity: Minor
      Found in src/nvector/karney.py by pep8

      Surround operators with a single space on either side.

      - Always surround these binary operators with a single space on
        either side: assignment (=), augmented assignment (+=, -= etc.),
        comparisons (==, <, >, !=, <=, >=, in, not in, is, is not),
        Booleans (and, or, not).
      
      - If operators with different priorities are used, consider adding
        whitespace around the operators with the lowest priorities.
      
      Okay: i = i + 1
      Okay: submitted += 1
      Okay: x = x * 2 - 1
      Okay: hypot2 = x * x + y * y
      Okay: c = (a + b) * (a - b)
      Okay: foo(bar, key='word', *args, **kwargs)
      Okay: alpha[:-i]
      
      E225: i=i+1
      E225: submitted +=1
      E225: x = x /2 - 1
      E225: z = x **y
      E225: z = 1and 1
      E226: c = (a+b) * (a-b)
      E226: hypot2 = x*x + y*y
      E227: c = a|b
      E228: msg = fmt%(errno, errmsg)

      Missing whitespace around arithmetic operator
      Open

          cos_a1 = cos_b1*sin_b2-sin_b1*cos_b2*cos_w
      Severity: Minor
      Found in src/nvector/karney.py by pep8

      Surround operators with a single space on either side.

      - Always surround these binary operators with a single space on
        either side: assignment (=), augmented assignment (+=, -= etc.),
        comparisons (==, <, >, !=, <=, >=, in, not in, is, is not),
        Booleans (and, or, not).
      
      - If operators with different priorities are used, consider adding
        whitespace around the operators with the lowest priorities.
      
      Okay: i = i + 1
      Okay: submitted += 1
      Okay: x = x * 2 - 1
      Okay: hypot2 = x * x + y * y
      Okay: c = (a + b) * (a - b)
      Okay: foo(bar, key='word', *args, **kwargs)
      Okay: alpha[:-i]
      
      E225: i=i+1
      E225: submitted +=1
      E225: x = x /2 - 1
      E225: z = x **y
      E225: z = 1and 1
      E226: c = (a+b) * (a-b)
      E226: hypot2 = x*x + y*y
      E227: c = a|b
      E228: msg = fmt%(errno, errmsg)

      Missing whitespace around arithmetic operator
      Open

          lat2 = arctan(tan(blat2)/(1-f))  # Eq. 6
      Severity: Minor
      Found in src/nvector/karney.py by pep8

      Surround operators with a single space on either side.

      - Always surround these binary operators with a single space on
        either side: assignment (=), augmented assignment (+=, -= etc.),
        comparisons (==, <, >, !=, <=, >=, in, not in, is, is not),
        Booleans (and, or, not).
      
      - If operators with different priorities are used, consider adding
        whitespace around the operators with the lowest priorities.
      
      Okay: i = i + 1
      Okay: submitted += 1
      Okay: x = x * 2 - 1
      Okay: hypot2 = x * x + y * y
      Okay: c = (a + b) * (a - b)
      Okay: foo(bar, key='word', *args, **kwargs)
      Okay: alpha[:-i]
      
      E225: i=i+1
      E225: submitted +=1
      E225: x = x /2 - 1
      E225: z = x **y
      E225: z = 1and 1
      E226: c = (a+b) * (a-b)
      E226: hypot2 = x*x + y*y
      E227: c = a|b
      E228: msg = fmt%(errno, errmsg)
      Severity
      Category
      Status
      Source
      Language