Showing 64 of 64 total issues
Function ptx_temperature
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def ptx_temperature(r0, r, standard=ptxITS90, poly=None) -> Unit("°C"):
"""
Compute the PTx temperature at a given temperature.
Accepts an additive correction polynomial that is applied to the resistance.
- 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 hash_directory
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def hash_directory(directory, recursive=True, hash_type=hashlib.sha256, binary=False, relative_paths=True, buffer_size=65536, concurrency=os.cpu_count()):
"""
List all files in a directory (recursively, depending on options)
and compute the hash of each file.
- 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 auto_strptime
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def auto_strptime(s):
"""
Parses a datetime in a number of formats,
automatically recognizing which format is correct.
- 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 __getitem__
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def __getitem__(self, arg):
"""
Select a frequency range:
fft[1.0:100.0] selects the 1.0 ... 100.0 Hz frequency range
fft[1.0:] selects everything from 1.0 Hz to the max frequency
- 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 simple_fft_reduce
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def simple_fft_reduce(fn, arr, samplerate, fftsize, shiftsize=None, nthreads=4, **kwargs):
Function hash_directory
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def hash_directory(directory, recursive=True, hash_type=hashlib.sha256, binary=False, relative_paths=True, buffer_size=65536, concurrency=os.cpu_count()):
Function extract_numeric_column
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def extract_numeric_column(flo, isline=__standard_isline, postproc=functoolz.identity,
Function value_range_over_temperature
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def value_range_over_temperature(nominal, coefficient="100ppm", tolerance="0 %", tmin="-40 °C", tmax="85 °C", tref="25 °C", significant_digits=4):
Function aggregate
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def aggregate(gen):
"""
Takes any iterable and aggregates subsequent values
yielded by the iterable into a single value with a counter.
- 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 numpy_resize_insert
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def numpy_resize_insert(arr, val, index, growth_factor=1.5, min_growth=1000, max_growth=1000000):
Function select_by_datetime
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def select_by_datetime(timestamps, time, factor=1.0, around=None, ofs=0.0, side="left"):
Function normalize_temperature
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def normalize_temperature(t, default_unit="°C") -> Unit("K"):
"""
Normalize a temperature to kelvin.
If it is a number or it has no unit, assume it is a default unit
Else, evaluate the unit(K, °C, °F, C, F)
- 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 summing_amplifier_noninv
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def summing_amplifier_noninv(v1, v2, r1, r2, rfb1, rfb2) -> Unit("V"):
Function _check_filter_type
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _check_filter_type(btype, freqs):
if btype == "lowpass" or btype == "highpass":
if not isinstance(freqs, numbers.Number):
raise ValueError("Pass-type {0} requires a single critical frequency, not {1}".format(btype, freqs))
elif btype == "bandpass" or btype == "bandstop":
- 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 __getitem__
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def __getitem__(self, key):
"""
Get:
- A numpy linrange slice
"""
- 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 __hysteresis_threshold_voltages
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __hysteresis_threshold_voltages(r1, r2, rh, vcc, fn):
Function __fft_reduce_worker
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __fft_reduce_worker(chunkgen, i, window, fftsize, removeDC):
Function overlapping_chunks
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def overlapping_chunks(arr, chunksize, shiftsize, func=None, copy=False):
Function find_sorted_extrema
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def find_sorted_extrema(x, y, comparator=np.greater, order=1, mode='clip'):
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, start, stop, n, endpoint=True, dtype=float):