Showing 29 of 67 total issues
File index_netcdf.py
has 1040 lines of code (exceeds 250 allowed). Consider refactoring. Open
# coding=utf-8
"""Functions for adding NetCDF files to the modelmeta database.
The root function is `index_netcdf_file`, which causes a NetCDF file to be
File v2.py
has 464 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""
Define v2 modelmeta database in SQLAlchemy using declarative base.
"""
__all__ = '''
Base
Function find_update_or_insert_cf_file
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def find_update_or_insert_cf_file(sesh, cf): # get.data.file.id
"""Find, update, or insert a NetCDF file in the modelmeta database,
according to whether it is already present and up to date.
:param sesh: modelmeta database session
- 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
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def create(args):
log.info("Using dsn: {}".format(args.dsn))
log.info('Writing to file: {}'.format(args.outfile))
log.info('Formatting for ncWMS version {}'.format(args.version))
- 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 get_element
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def get_element(element_name, atts={}, **kwargs):
'''
Generates a general xml element with provided name, attributes (dictionary), and basic
children with text
'''
- 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 nc_copy
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def nc_copy(source_fp, dest_fp, time_dimension, time_indices, variables):
print('nc_copy({source_fp}, {dest_fp}, {time_dimension}, {time_indices}, {variables})'.format(**locals()))
with Dataset(source_fp) as source:
with Dataset(dest_fp, mode='w') as dest:
- 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 12 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self,
datasets=None,
threddsCatalog=None,
contact=None,
server=None,
- 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 data_file_query
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def data_file_query(
session,
print_queries=False,
ensemble=None,
multi_variable=None,
- 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 _list_dirpaths
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def _list_dirpaths(
Function _list_filepaths
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def _list_filepaths(
Function insert_data_file_variable_gridded
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def insert_data_file_variable_gridded(
Function __init__
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self,
Function data_file_query
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def data_file_query(
Function find_station
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def find_station(sesh, cf, i, name, x, y):
Function insert_station
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def insert_station(sesh, cf, i, name, x, y):
Function associate_ensemble_to_filepaths
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def associate_ensemble_to_filepaths(
Function associate_ensemble_to_filepath
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def associate_ensemble_to_filepath(
Function find_or_insert_station
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def find_or_insert_station(sesh, cf, i, name, x, y):
Function _list_filepaths
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _list_filepaths(
session,
print_queries=False,
count=False,
ensemble=None,
- 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 main
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def main(