gwastro/gwin

View on GitHub

Showing 41 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

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

    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

      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

            Function create_axes_grid has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
            Open

            def create_axes_grid(parameters, labels=None, height_ratios=None,
            width_ratios=None, no_diagonals=False):
            """Given a list of parameters, creates a figure with an axis for
            every possible combination of the parameters.
             
             
            Severity: Minor
            Found in gwin/results/scatter_histograms.py - About 3 hrs to fix

            File base.py has 567 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/models/base.py - About 3 hrs to fix

              Function compute_acfs has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
              Open

              def compute_acfs(cls, fp, start_index=None, end_index=None,
              per_walker=False, walkers=None, parameters=None,
              temps=None):
              """Computes the autocorrleation function of the model params in the
              given file.
              Severity: Minor
              Found in gwin/sampler/emcee.py - About 3 hrs to fix

              Function create_density_plot has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
              Open

              def create_density_plot(xparam, yparam, samples, plot_density=True,
              plot_contours=True, percentiles=None, cmap='viridis',
              contour_color=None, xmin=None, xmax=None,
              ymin=None, ymax=None, exclude_region=None,
              fig=None, ax=None, use_kombine=False):
              Severity: Minor
              Found in gwin/results/scatter_histograms.py - About 3 hrs to fix

              Function _read_fields has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
              Open

              def _read_fields(fp, fields_group, fields, array_class,
              thin_start=None, thin_interval=None, thin_end=None,
              iteration=None, temps=None, walkers=None, flatten=True):
              """Base function for reading samples and model stats. See
              `read_samples` and `read_model_stats` for details.
              Severity: Minor
              Found in gwin/sampler/emcee.py - About 2 hrs to fix

              Function create_multidim_plot has 27 arguments (exceeds 10 allowed). Consider refactoring.
              Open

              def create_multidim_plot(parameters, samples, labels=None,
              Severity: Major
              Found in gwin/results/scatter_histograms.py - About 2 hrs to fix

                Function results_from_cli has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                Open

                def results_from_cli(opts, load_samples=True, **kwargs):
                """
                Loads an inference result file along with any labels associated with it
                from the command line options.
                 
                 
                Severity: Minor
                Found in gwin/option_utils.py - About 1 hr to fix

                Function write_metadata has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                Open

                def write_metadata(self, fp, **kwargs):
                """Writes metadata about this sampler to the given file. Metadata is
                written to the file's `attrs`.
                 
                Parameters
                Severity: Minor
                Found in gwin/sampler/base.py - About 1 hr to fix

                Function data_from_cli has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                def data_from_cli(opts):
                """Loads the data needed for a model from the given
                command-line options. Gates specifed on the command line are also applied.
                 
                Parameters
                Severity: Minor
                Found in gwin/option_utils.py - About 1 hr to fix

                Function write_samples_group has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                Open

                def write_samples_group(fp, samples_group, parameters, samples,
                start_iteration=None, max_iterations=None):
                """Writes samples to the given file.
                 
                Results are written to:
                Severity: Minor
                Found in gwin/sampler/base.py - About 1 hr to fix

                Function write_samples_group has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                Open

                def write_samples_group(fp, samples_group, parameters, samples,
                start_iteration=None, max_iterations=None):
                """Writes samples to the given file.
                 
                Results are written to:
                Severity: Minor
                Found in gwin/sampler/emcee.py - About 1 hr to fix

                Function validate_checkpoint_files has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                Open

                def validate_checkpoint_files(checkpoint_file, backup_file):
                """Checks if the given checkpoint and/or backup files are valid.
                 
                The checkpoint file is considered valid if:
                 
                 
                Severity: Minor
                Found in gwin/option_utils.py - About 1 hr to fix

                Function create_density_plot has 16 arguments (exceeds 10 allowed). Consider refactoring.
                Open

                def create_density_plot(xparam, yparam, samples, plot_density=True,
                Severity: Major
                Found in gwin/results/scatter_histograms.py - About 1 hr to fix
                  Severity
                  Category
                  Status
                  Source
                  Language