Showing 10 of 123 total issues
File timestamp_series.py
has 414 lines of code (exceeds 250 allowed). Consider refactoring. Open
import collections
import copy
import datetime as dt
import numbers
import warnings
TimestampSeries
has 34 functions (exceeds 20 allowed). Consider refactoring. Open
class TimestampSeries(UnitMixin, TimeZoneMixin, FrequencyMixin, BaseTimeSeries):
@staticmethod
def create_null_timeseries(start, end, freq, unit=None, time_zone='infer'):
"""
BaseTimeSeries
has 29 functions (exceeds 20 allowed). Consider refactoring. Open
class BaseTimeSeries(metaclass=ABCMeta):
# ------------------------------ properties ------------------------------ #
@property
Function map
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def map(self, func, dimensionless=True):
"""
apply a custom function to each value of the series
:param function func: a function mapping a scalar to another scalar
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function convert_unit
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def convert_unit(self, unit):
"""
convert the unit of the series
:param str/pint.Unit unit:
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function infer_freq
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def infer_freq(series):
"""
infer the frequency from a pandas Series with `DatetimeIndex`
:param pandas.Series series: a pandas Series with `DatetimeIndex`
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function _validate_unit
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _validate_unit(self):
self._unit = coerce_unit(self._unit)
if isinstance(self._series.dtype, PintType):
if self._series.pint.u != self._unit:
try:
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function create_constant_timeseries
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_constant_timeseries(start, end, value, freq, unit=None,
Function fill_gaps
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def fill_gaps(self, start=None, end=None, value=np.NaN):
"""
fill all gaps between `start` and `end` in a series with a frequency with a
constant value
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function __eq__
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def __eq__(self, other):
if not isinstance(other, TimestampSeries):
return False
self_values = self.values
other_values = other.values
- Read upRead up
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"