ndmg/scripts/ndmg_bids.py
Function main
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
Open
def main():
parser = ArgumentParser(description="This is an end-to-end connectome \
estimation pipeline from sMRI and DTI images")
parser.add_argument('bids_dir', help='The directory with the input dataset'
- 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 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def main():
parser = ArgumentParser(description="This is an end-to-end connectome \
estimation pipeline from sMRI and DTI images")
parser.add_argument('bids_dir', help='The directory with the input dataset'
Function group_level
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def group_level(inDir, outDir, dataset=None, atlas=None, minimal=False,
Function group_level
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Open
def group_level(inDir, outDir, dataset=None, atlas=None, minimal=False,
log=False, hemispheres=False, dwi=True):
"""
Crawls the output directory from ndmg and computes qc metrics on the
derivatives produced
- 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 session_level
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def session_level(inDir, outDir, subjs, sesh=None, debug=False,
Avoid deeply nested control flow statements. Open
Open
if sesh is not None:
tpath = op.join(remo, 'sub-{}'.format(sub), 'ses-{}'.format(sesh))
tindir = op.join(inDir, 'sub-{}'.format(sub), 'ses-{}'.format(sesh))
else:
tpath = op.join(remo, 'sub-{}'.format(sub))