Showing 56 of 141 total issues
Function _unpack_standard
has a Cognitive Complexity of 29 (exceeds 15 allowed). Consider refactoring. Open
def _unpack_standard(self, sfcno):
"""Unpack a standard surface data file."""
stations = []
for irow, icol in sfcno:
row_head = self.row_headers[irow]
- 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 _unpack_ship
has a Cognitive Complexity of 29 (exceeds 15 allowed). Consider refactoring. Open
def _unpack_ship(self, sfcno):
"""Unpack ship (moving observation) surface data file."""
stations = []
for irow, icol in sfcno: # irow should always be zero
col_head = self.column_headers[icol]
- 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 _unpack_climate
has a Cognitive Complexity of 29 (exceeds 15 allowed). Consider refactoring. Open
def _unpack_climate(self, sfcno):
"""Unpack a climate surface data file."""
stations = []
for irow, icol in sfcno:
col_head = self.column_headers[icol]
- 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 _unpack_unmerged
has a Cognitive Complexity of 29 (exceeds 15 allowed). Consider refactoring. Open
def _unpack_unmerged(self, sndno):
"""Unpack unmerged sounding data."""
soundings = []
for irow, icol in sndno:
row_head = self.row_headers[irow]
- 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
IOBuffer
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
class IOBuffer:
"""Holds bytes from a buffer to simplify parsing and random access."""
def __init__(self, source):
"""Initialize the IOBuffer with the source data."""
Function __init__
has a Cognitive Complexity of 27 (exceeds 15 allowed). Consider refactoring. Open
def __init__(self, file):
"""Instantiate GempakFile object from file."""
fobj = open_as_needed(file)
with contextlib.closing(fobj):
- 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 __init__
has a Cognitive Complexity of 26 (exceeds 15 allowed). Consider refactoring. Open
def __init__(self, file, *args, **kwargs):
super().__init__(file)
datetime_names = ['GDT1', 'GDT2']
level_names = ['GLV1', 'GLV2']
- 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 _interp_parameters
has a Cognitive Complexity of 22 (exceeds 15 allowed). Consider refactoring. Open
def _interp_parameters(vlev, adata, bdata, missing=-9999):
"""General interpolation with respect to log-p.
See the PC_INTP subroutine in GEMPAK.
"""
- 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 _unpack_merged
has a Cognitive Complexity of 21 (exceeds 15 allowed). Consider refactoring. Open
def _unpack_merged(self, sndno):
"""Unpack merged sounding data."""
soundings = []
for irow, icol in sndno:
row_head = self.row_headers[irow]
- 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 thickness_hydrostatic
has a Cognitive Complexity of 21 (exceeds 15 allowed). Consider refactoring. Open
def thickness_hydrostatic(pressure, temperature, mixing_ratio=None,
molecular_weight_ratio=mpconsts.nounit.epsilon, bottom=None,
depth=None):
r"""Calculate the thickness of a layer via the hypsometric equation.
- 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 _merge_mandatory_temps
has a Cognitive Complexity of 21 (exceeds 15 allowed). Consider refactoring. Open
def _merge_mandatory_temps(self, merged, parts, section, qcman, bgl, plast):
"""Process and merge mandatory temperature sections."""
num_levels = len(parts[section]['PRES'])
start_level = {
'TTAA': 1,
- 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 find_axis_number
has a Cognitive Complexity of 19 (exceeds 15 allowed). Consider refactoring. Open
def find_axis_number(self, axis):
"""Return the dimension number of the axis corresponding to the given identifier.
Parameters
----------
- 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 plot
has a Cognitive Complexity of 19 (exceeds 15 allowed). Consider refactoring. Open
def plot(self, plotter, data_dict):
"""Plot a collection of data using this layout for a station plot.
This function iterates through the entire specified layout, pulling the fields named
in the layout from `data_dict` and plotting them using `plotter` as specified
- 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 advection
has 13 arguments (exceeds 10 allowed). Consider refactoring. Open
def advection(
Function __init__
has a Cognitive Complexity of 18 (exceeds 15 allowed). Consider refactoring. Open
def __init__(self, prod):
"""Initialize the values and labels from the product."""
# Don't worry about super() since we're using our own lut assembled sequentially
self.labels = []
self.lut = []
- 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 obsdata
has a Cognitive Complexity of 18 (exceeds 15 allowed). Consider refactoring. Open
def obsdata(self):
"""Return the internal cached data."""
if getattr(self, '_obsdata', None) is None:
# Use a copy of data so we retain all of the original data passed in unmodified
data = self.data
- 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
Avoid deeply nested control flow statements. Open
if var2 is not None:
sounding[var2][i] = outdata[var2]
i += 1
Avoid deeply nested control flow statements. Open
if (self.grid_meta_int.missing_flag and idat == imiss):
grid[j, i] = self.prod_desc.missing_float
else:
if first:
grid[j, i] = self.grid_meta_real.reference
Avoid deeply nested control flow statements. Open
if ibit > 32:
ibit -= 32
iword += 1
Function _decode_msg13
has a Cognitive Complexity of 18 (exceeds 15 allowed). Consider refactoring. Open
def _decode_msg13(self, msg_hdr):
data = self._buffer_segment(msg_hdr)
if data:
data = struct.Struct(f'>{len(data) // 2:d}h').unpack(data)
# Legacy format doesn't have date/time and has fewer azimuths
- 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"