datanator/core/data_source.py
File data_source.py
has 480 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
"""
:Author: Jonathan Karr <jonrkarr@gmail.com>
:Date: 2017-05-08
:Copyright: 2017, Karr Lab
:License: MIT
Function upload_backups
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
Open
def upload_backups(self):
""" Backup the local sqlite database to Quilt """
# create temporary directory to checkout package
tmp_dirname = tempfile.mkdtemp()
- 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 14 (exceeds 5 allowed). Consider refactoring. Open
Open
def __init__(self, name=None, cache_dirname=None, clear_content=False, load_content=False, max_entries=float('inf'),
commit_intermediate_results=False, download_backups=True, verbose=False,
quilt_owner=None, quilt_package=None):
"""
Args:
- 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 12 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(self, name=None, cache_dirname=None, clear_content=False, load_content=False, max_entries=float('inf'),
Function __init__
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(self, name=None,
Function __init__
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(self, name=None, cache_dirname=None, clear_content=False, load_content=False, max_entries=float('inf'),
Avoid deeply nested control flow statements. Open
Open
if rel_dirname == '.':
rel_filename = filename
else:
rel_filename = os.path.join(rel_dirname, filename)
os.symlink(os.path.join(root_cache_path, rel_filename),
Avoid deeply nested control flow statements. Open
Open
if rel_dirname == '.':
rel_subdirname = subdirname
else:
rel_subdirname = os.path.join(rel_dirname, subdirname)
os.makedirs(os.path.join(root_tmp_path, rel_subdirname))