neurodata/ndmg

View on GitHub

Showing 44 of 78 total issues

Function group_level has 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

def group_level(inDir, outDir, dataset=None, atlas=None, minimal=False,
Severity: Major
Found in ndmg/scripts/ndmg_bids.py - About 1 hr to fix

    Function group_level has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    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
    Severity: Minor
    Found in ndmg/scripts/ndmg_bids.py - About 55 mins to fix

    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_bucket has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

    def crawl_bucket(bucket, path, group=False):
        """
        Gets subject list for a given S3 bucket and path
        """
        if group:
    Severity: Minor
    Found in ndmg/scripts/ndmg_cloud.py - About 55 mins to fix

    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 a Cognitive Complexity of 9 (exceeds 5 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
        """
    Severity: Minor
    Found in ndmg/scripts/ndmg_dwi_pipeline.py - About 55 mins to fix

    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 loadGraphs has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

    def loadGraphs(filenames, verb=False):
        """
        Given a list of files, returns a dictionary of graphs
    
        Required parameters:
    Severity: Minor
    Found in ndmg/utils/loadGraphs.py - About 55 mins to fix

    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 dwi2atlas has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def dwi2atlas(self, dwi, gtab, t1w, atlas,
    Severity: Major
    Found in ndmg/register/register.py - About 50 mins to fix

      Function make_panel_plot has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def make_panel_plot(basepath, outf, dataset=None, atlas=None, minimal=True,
      Severity: Major
      Found in ndmg/stats/qa_graphs_plotting.py - About 50 mins to fix

        Function session_level has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        def session_level(inDir, outDir, subjs, sesh=None, debug=False,
        Severity: Major
        Found in ndmg/scripts/ndmg_bids.py - About 50 mins to fix

          Function reg_mri_pngs has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          def reg_mri_pngs(mri, atlas, outdir, loc=0, mean=False, dim=4):
          Severity: Minor
          Found in ndmg/stats/qa_reg.py - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                if verbose:
                                    print "Saving slice:", slices
                                imsave(dirname + '/%04d.png' % slices,
            Severity: Major
            Found in ndmg/utils/nifti_to_png.py - About 45 mins to fix

              Avoid deeply nested control flow statements.
              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))
              Severity: Major
              Found in ndmg/scripts/ndmg_bids.py - About 45 mins to fix

                Function apply_warp has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    def apply_warp(self, inp, out, ref, warp, xfm=None, mask=None):
                Severity: Minor
                Found in ndmg/register/register.py - About 45 mins to fix

                  Function visualize_fibs has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  def visualize_fibs(fibs, fibfile, atlasfile, outdir, opacity, num_samples):
                  Severity: Minor
                  Found in ndmg/stats/qa_fibers.py - About 45 mins to fix

                    Function plot_density has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                    def plot_density(xs, ys, name=None, ylab=None, xlab=None):
                    Severity: Minor
                    Found in ndmg/stats/plotly_helper.py - About 35 mins to fix

                      Function tensor2fa has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                      def tensor2fa(tensors, tensor_name, dwi, derivdir, qcdir):
                      Severity: Minor
                      Found in ndmg/stats/qa_tensor.py - About 35 mins to fix

                        Function plot_degrees has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                        def plot_degrees(dats, name=None, ylab=None, xlab=None, hemi=True):
                        Severity: Minor
                        Found in ndmg/stats/plotly_helper.py - About 35 mins to fix

                          Function setup has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                          def setup(inDir, dwiListFile, bvalListFile, bvecListFile, mprageListFile):
                          Severity: Minor
                          Found in ndmg/scripts/ndmg_setup.py - About 35 mins to fix

                            Function s3_push_data has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                            def s3_push_data(bucket, remote, outDir, modifier, creds=True):
                            Severity: Minor
                            Found in ndmg/utils/bids.py - About 35 mins to fix

                              Function align_nonlinear has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                  def align_nonlinear(self, inp, ref, xfm, warp, mask=None):
                              Severity: Minor
                              Found in ndmg/register/register.py - About 35 mins to fix

                                Function plot_series has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                def plot_series(dats, name=None, ylab=None, xlab=None, sort=False):
                                Severity: Minor
                                Found in ndmg/stats/plotly_helper.py - About 35 mins to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language