gwastro/gwin

View on GitHub

Showing 121 of 121 total issues

Function create_multidim_plot has a Cognitive Complexity of 72 (exceeds 5 allowed). Consider refactoring.
Open

def create_multidim_plot(parameters, samples, labels=None,
mins=None, maxs=None, expected_parameters=None,
expected_parameters_color='r',
plot_marginal=True, plot_scatter=True,
marginal_percentiles=None, contour_percentiles=None,
Severity: Minor
Found in gwin/results/scatter_histograms.py - About 1 day to fix

Similar blocks of code found in 2 locations. Consider refactoring.
Open

def make_inference_prior_plot(workflow, config_file, output_dir,
sections=None, name="inference_prior",
analysis_seg=None, tags=None):
""" Sets up the corner plot of the priors in the workflow.
 
 
Severity: Major
Found in gwin/workflow.py and 1 other location - About 1 day to fix
gwin/workflow.py on lines 234..286

Similar blocks of code found in 2 locations. Consider refactoring.
Open

def make_inference_posterior_plot(
workflow, inference_file, output_dir, parameters=None,
name="inference_posterior", analysis_seg=None, tags=None):
""" Sets up the corner plot of the posteriors in the workflow.
 
 
Severity: Major
Found in gwin/workflow.py and 1 other location - About 1 day to fix
gwin/workflow.py on lines 126..178

Similar blocks of code found in 2 locations. Consider refactoring.
Open

def write_strain(self, strain_dict, group=None):
"""Writes strain for each IFO to file.
 
Parameters
-----------
Severity: Major
Found in gwin/io/hdf.py and 1 other location - About 1 day to fix
gwin/io/hdf.py on lines 437..456

Similar blocks of code found in 2 locations. Consider refactoring.
Open

def write_stilde(self, stilde_dict, group=None):
"""Writes stilde for each IFO to file.
 
Parameters
-----------
Severity: Major
Found in gwin/io/hdf.py and 1 other location - About 1 day to fix
gwin/io/hdf.py on lines 415..435

File emcee.py has 765 lines of code (exceeds 500 allowed). Consider refactoring.
Open

# Copyright (C) 2016 Collin Capano
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 3 of the License, or (at your
# option) any later version.
Severity: Major
Found in gwin/sampler/emcee.py - About 1 day to fix

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

    if self._margphase:
    bounds = self._marg_prior["phase"].bounds
    self._phase_array = numpy.linspace(bounds["phase"].min,
    bounds["phase"].max, 10**4)
    self._deltap = self._phase_array[1] - self._phase_array[0]
    Severity: Major
    Found in gwin/models/marginalized_gaussian_noise.py and 1 other location - About 1 day to fix
    gwin/models/marginalized_gaussian_noise.py on lines 367..374

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

    if self._margdist:
    bounds = self._marg_prior["distance"].bounds
    self._dist_array = numpy.linspace(bounds["distance"].min,
    bounds["distance"].max, 10**4)
    self._deltad = self._dist_array[1] - self._dist_array[0]
    Severity: Major
    Found in gwin/models/marginalized_gaussian_noise.py and 1 other location - About 1 day to fix
    gwin/models/marginalized_gaussian_noise.py on lines 382..389

    File base.py has 749 lines of code (exceeds 500 allowed). Consider refactoring.
    Open

    # Copyright (C) 2016 Christopher M. Biwer, Collin Capano
    # This program is free software; you can redistribute it and/or modify it
    # under the terms of the GNU General Public License as published by the
    # Free Software Foundation; either version 3 of the License, or (at your
    # option) any later version.
    Severity: Major
    Found in gwin/sampler/base.py - About 1 day to fix

      Cyclomatic complexity is too high in function create_multidim_plot. (47)
      Open

      def create_multidim_plot(parameters, samples, labels=None,
      mins=None, maxs=None, expected_parameters=None,
      expected_parameters_color='r',
      plot_marginal=True, plot_scatter=True,
      marginal_percentiles=None, contour_percentiles=None,
      Severity: Minor
      Found in gwin/results/scatter_histograms.py by radon

      Identical blocks of code found in 2 locations. Consider refactoring.
      Open

      def run(self, niterations, **kwargs):
      """Advance the ensemble for a number of samples.
       
      Parameters
      ----------
      Severity: Major
      Found in gwin/sampler/emcee.py and 1 other location - About 5 hrs to fix
      gwin/sampler/emcee.py on lines 407..432

      Identical blocks of code found in 2 locations. Consider refactoring.
      Open

      def run(self, niterations, **kwargs):
      """Advance the ensemble for a number of samples.
       
      Parameters
      ----------
      Severity: Major
      Found in gwin/sampler/emcee.py and 1 other location - About 5 hrs to fix
      gwin/sampler/emcee.py on lines 169..194

      File hdf.py has 647 lines of code (exceeds 500 allowed). Consider refactoring.
      Open

      # Copyright (C) 2016 Christopher M. Biwer
      # This program is free software; you can redistribute it and/or modify it
      # under the terms of the GNU General Public License as published by the
      # Free Software Foundation; either version 3 of the License, or (at your
      # self.option) any later version.
      Severity: Major
      Found in gwin/io/hdf.py - About 5 hrs to fix

        File option_utils.py has 630 lines of code (exceeds 500 allowed). Consider refactoring.
        Open

        # Copyright (C) 2016 Collin Capano
        #
        # This program is free software; you can redistribute it and/or modify it
        # under the terms of the GNU General Public License as published by the
        # Free Software Foundation; either version 3 of the License, or (at your
        Severity: Major
        Found in gwin/option_utils.py - About 5 hrs to fix

          File scatter_histograms.py has 601 lines of code (exceeds 500 allowed). Consider refactoring.
          Open

          # Copyright (C) 2016 Miriam Cabero Mueller, Collin Capano
          #
          # This program is free software; you can redistribute it and/or modify it
          # under the terms of the GNU General Public License as published by the
          # Free Software Foundation; either version 3 of the License, or (at your
          Severity: Major
          Found in gwin/results/scatter_histograms.py - About 4 hrs to fix

            Function create_marginalized_hist has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
            Open

            def create_marginalized_hist(ax, values, label, percentiles=None,
            color='k', fillcolor='gray', linecolor='navy',
            title=True, expected_value=None,
            expected_color='red', rotated=False,
            plot_min=None, plot_max=None):
            Severity: Minor
            Found in gwin/results/scatter_histograms.py - About 4 hrs to fix

            Similar blocks of code found in 3 locations. Consider refactoring.
            Open

            def write_results(self, fp, start_iteration=None,
            max_iterations=None, **metadata):
            """Writes metadata, samples, model stats, and acceptance fraction
            to the given file. Also computes and writes the autocorrleation lengths
            of the chains. See the various write function for details.
            Severity: Major
            Found in gwin/sampler/base.py and 2 other locations - About 4 hrs to fix
            gwin/sampler/emcee.py on lines 196..224
            gwin/sampler/emcee.py on lines 570..598

            Similar blocks of code found in 3 locations. Consider refactoring.
            Open

            def write_results(self, fp, start_iteration=None,
            max_iterations=None, **metadata):
            """Writes metadata, samples, model stats, and acceptance fraction
            to the given file. See the write function for each of those for
            details.
            Severity: Major
            Found in gwin/sampler/emcee.py and 2 other locations - About 4 hrs to fix
            gwin/sampler/base.py on lines 561..589
            gwin/sampler/emcee.py on lines 570..598

            Similar blocks of code found in 3 locations. Consider refactoring.
            Open

            def write_results(self, fp, start_iteration=None, max_iterations=None,
            **metadata):
            """Writes metadata, samples, model stats, and acceptance fraction
            to the given file. See the write function for each of those for
            details.
            Severity: Major
            Found in gwin/sampler/emcee.py and 2 other locations - About 4 hrs to fix
            gwin/sampler/base.py on lines 561..589
            gwin/sampler/emcee.py on lines 196..224

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

            try:
            fp_niterations = fp[dataset_name].shape[-1]
            if istart is None:
            istart = fp_niterations
            istop = istart + niterations
            Severity: Major
            Found in gwin/sampler/emcee.py and 1 other location - About 4 hrs to fix
            gwin/sampler/base.py on lines 442..449
            Severity
            Category
            Status
            Source
            Language