File objects.py
has 1326 lines of code (exceeds 1000 allowed). Consider refactoring. Open
"""
Object oriented interface to geodesic functions
===============================================
"""
Consider using '{rtol
: rtol, atol
: atol}' instead of a call to 'dict'. Open
options = dict(rtol=rtol, atol=atol)
- Read upRead up
- Exclude checks
Emitted when using dict() to create a dictionary instead of a literal '{ ... }'. The literal is faster as it avoids an additional function call.
Class 'GeoPath' inherits from object, can be safely removed from bases in python3 Open
class GeoPath(object):
- Read upRead up
- Exclude checks
Used when a class inherit from object, which under python3 is implicit, hence can be safely removed from bases.
Too many arguments (8/5) Open
def direct(self, lat_a, lon_a, azimuth, distance, z=0, long_unroll=False, degrees=False):
- Read upRead up
- Exclude checks
Used when a function or method takes too many arguments.
Too many arguments (6/5) Open
def __init__(self, point, yaw=0, pitch=0, roll=0, degrees=False):
- Read upRead up
- Exclude checks
Used when a function or method takes too many arguments.
Too many arguments (6/5) Open
def __init__(self, latitude, longitude, z=0, frame=None, degrees=False):
- Read upRead up
- Exclude checks
Used when a function or method takes too many arguments.
Too many arguments (8/5) Open
def interpolate(self, t_i, t, kind='linear', window_length=0, polyorder=2,
- Read upRead up
- Exclude checks
Used when a function or method takes too many arguments.
Too many arguments (6/5) Open
def displace(self, distance, azimuth, long_unroll=False, degrees=False, method='ellipsoid'):
- Read upRead up
- Exclude checks
Used when a function or method takes too many arguments.
Consider using '{rtol
: rtol, atol
: atol}' instead of a call to 'dict'. Open
options = dict(rtol=rtol, atol=atol)
- Read upRead up
- Exclude checks
Emitted when using dict() to create a dictionary instead of a literal '{ ... }'. The literal is faster as it avoids an additional function call.
Too many arguments (7/5) Open
def inverse(self, lat_a, lon_a, lat_b, lon_b, z=0, degrees=False):
- Read upRead up
- Exclude checks
Used when a function or method takes too many arguments.
Class '_Common' inherits from object, can be safely removed from bases in python3 Open
class _Common(object):
- Read upRead up
- Exclude checks
Used when a class inherit from object, which under python3 is implicit, hence can be safely removed from bases.
Consider using '{rtol
: rtol, atol
: atol}' instead of a call to 'dict'. Open
options = dict(rtol=rtol, atol=atol)
- Read upRead up
- Exclude checks
Emitted when using dict() to create a dictionary instead of a literal '{ ... }'. The literal is faster as it avoids an additional function call.
Consider using Python 3 style super() without arguments Open
super(ECEFvector, self).__init__(pvector, _default_frame(frame), scalar)
- Read upRead up
- Exclude checks
Emitted when calling the super() builtin with the current class and instance. On Python 3 these arguments are the default and they can be omitted.
Consider using Python 3 style super() without arguments Open
super(FrameL, self).__init__(point)
- Read upRead up
- Exclude checks
Emitted when calling the super() builtin with the current class and instance. On Python 3 these arguments are the default and they can be omitted.
Too many local variables (16/15) Open
def direct(self, lat_a, lon_a, azimuth, distance, z=0, long_unroll=False, degrees=False):
- Read upRead up
- Exclude checks
Used when a function or method has too many local variables.
Too few public methods (1/2) Open
class _LocalFrame(_Common):
- Read upRead up
- Exclude checks
Used when class has too few public methods, so be sure it's really worth it.
TODO: vectorize this Open
# TODO: vectorize this
- Read upRead up
- Exclude checks
Used when a warning note as FIXME or XXX is detected.
Unable to import 'numpy' Open
import numpy as np
- Read upRead up
- Exclude checks
Used when pylint has been unable to import a module.
TODO: remove this: Open
# TODO: remove this:
- Read upRead up
- Exclude checks
Used when a warning note as FIXME or XXX is detected.
Unused partial imported from functools Open
from functools import partial
- Read upRead up
- Exclude checks
Used when an imported module or variable is not used.
Unable to import 'geographiclib.geodesic' Open
from geographiclib.geodesic import Geodesic as _Geodesic
- Read upRead up
- Exclude checks
Used when pylint has been unable to import a module.
TODO: remove this: Open
# TODO: remove this:
- Read upRead up
- Exclude checks
Used when a warning note as FIXME or XXX is detected.
Unable to import 'numpy.linalg' Open
from numpy.linalg import norm
- Read upRead up
- Exclude checks
Used when pylint has been unable to import a module.
TODO found Open
# TODO: vectorize this
- Exclude checks
TODO found Open
# TODO: remove this:
- Exclude checks
TODO found Open
# TODO: remove this:
- Exclude checks
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__)
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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)
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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)
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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)
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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)
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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)
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Missing whitespace around arithmetic operator Open
return np.mod(angle_rad + np.pi, 2*np.pi) - np.pi
- Read upRead up
- Exclude checks
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
- Read upRead up
- Exclude checks
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)
Formatting a regular string which could be a f-string Open
return '{}({})'.format(cname, params)
- Read upRead up
- Exclude checks
Used when we detect a string that is being formatted with format() or % which could potentially be a f-string. The use of f-strings is preferred. Requires Python 3.6 and py-version >= 3.6
.
Formatting a regular string which could be a f-string Open
params = fmt.join(['{}={!r}'.format(name, dict_params[name])
- Read upRead up
- Exclude checks
Used when we detect a string that is being formatted with format() or % which could potentially be a f-string. The use of f-strings is preferred. Requires Python 3.6 and py-version >= 3.6
.
Too many lines in module (1664/1000) Open
"""
- Read upRead up
- Exclude checks
Used when a module has too many lines, reducing its readability.