Showing 44 of 78 total issues
Function create_json
has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring. Open
def create_json(bucket, path, threads, jobdir, group=False, credentials=None,
debug=False, dataset=None, log=False):
"""
Takes parameters to make jsons
"""
- 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 make_panel_plot
has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring. Open
def make_panel_plot(basepath, outf, dataset=None, atlas=None, minimal=True,
log=True, hemispheres=True):
fnames = [name for name in os.listdir(basepath)
if os.path.splitext(name)[1] == '.pkl']
fnames = sorted(fnames)
- 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 a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. 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 convert
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
def convert(indir, outdir, verbose=False):
"""
Takes in nifti images, creates directory structure desired by ndstore
ingest, and then converts niftis to png stacks. This script should be
called prior to ingesting MR data into ndstore.
- 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
File register.py
has 278 lines of code (exceeds 250 allowed). Consider refactoring. Open
#!/usr/bin/env python
# Copyright 2016 NeuroData (http://neurodata.io)
#
# Licensed under the Apache License, Version 2.0 (the "License");
File ndmg_cloud.py
has 263 lines of code (exceeds 250 allowed). Consider refactoring. Open
#!/usr/bin/env python
# Copyright 2016 NeuroData (http://neurodata.io)
#
# Licensed under the Apache License, Version 2.0 (the "License");
Function compute_metrics
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
def compute_metrics(fs, outdir, atlas, verb=False):
"""
Given a set of files and a directory to put things, loads graphs and
performs set of analyses on them, storing derivatives in a pickle format
in the desired output location.
Function make_graph
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def make_graph(self, streamlines, attr=None):
"""
Takes streamlines and produces a graph
**Positional Arguments:**
- 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_rgb
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def plot_rgb(im):
plt.rcParams.update({'axes.labelsize': 'x-large',
'axes.titlesize': 'x-large'})
if im.shape == (182, 218, 182):
- 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_overlays
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def plot_overlays(atlas, b0, cmaps):
plt.rcParams.update({'axes.labelsize': 'x-large',
'axes.titlesize': 'x-large'})
if b0.shape == (182, 218, 182):
- 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 crawl_bids_directory
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def crawl_bids_directory(inDir, subjs, sesh):
"""
Given a BIDS directory and optionally list of sessions and subjects,
crawls the path and returns pointers to all relevant files for analysis.
"""
- 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 ndmg_dwi_pipeline
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def ndmg_dwi_pipeline(dwi, bvals, bvecs, mprage, atlas, mask, labels, outdir,
clean=False, fmt='edgelist'):
"""
Creates a brain graph from MRI data
"""
Function main
has 33 lines of code (exceeds 25 allowed). Consider refactoring. 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 ndmg_dwi_pipeline
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def ndmg_dwi_pipeline(dwi, bvals, bvecs, mprage, atlas, mask, labels, outdir,
Function main
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def main():
ni = NI.NDIngest()
"""
Function create_json
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_json(bucket, path, threads, jobdir, group=False, credentials=None,
Function align
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def align(self, inp, ref, xfm=None, out=None, dof=12, searchrad=True,
Function main
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def main():
parser = ArgumentParser(description="This is an end-to-end connectome \
estimation pipeline from sMRI and DTI images")
parser.add_argument('state', choices=['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 func2atlas
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def func2atlas(self, func, t1w, atlas, atlas_brain, atlas_mask,
Function group_level
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def group_level(inDir, outDir, dataset=None, atlas=None, minimal=False,