QInfer/python-qinfer

View on GitHub

Showing 73 of 3,465 total issues

Function perf_test_multiple has 13 arguments (exceeds 4 allowed). Consider refactoring.
Open

def perf_test_multiple(
Severity: Major
Found in src/qinfer/perf_testing.py - About 1 hr to fix

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

    def particle_clusters(
            particle_locations, particle_weights=None,
            eps=0.5, min_particles=5, metric='euclidean',
            weighted=False, w_pow=0.5,
            quiet=True
    Severity: Minor
    Found in src/qinfer/clustering.py - About 1 hr 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 __init__ has 11 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def __init__(self,
    Severity: Major
    Found in src/qinfer/smc.py - About 1 hr to fix

      Function update has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          def update(self, outcome, expparams, check_for_resample=True):
              """
              Given an experiment and an outcome of that experiment, updates the
              posterior distribution to reflect knowledge of that experiment.
      
      
      Severity: Minor
      Found in src/qinfer/smc.py - About 1 hr 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 perf_test has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

      def perf_test(
              model, n_particles, prior, n_exp, heuristic_class,
              true_model=None, true_prior=None, true_mps=None,
              extra_updater_args=None
          ):
      Severity: Minor
      Found in src/qinfer/perf_testing.py - About 1 hr 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 __init__ has 10 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def __init__(self,
      Severity: Major
      Found in src/qinfer/smc.py - About 1 hr to fix

        Function design_expparams_field has 9 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def design_expparams_field(self,
        Severity: Major
        Found in src/qinfer/expdesign.py - About 1 hr to fix

          Function plot_rebit_posterior has 9 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          def plot_rebit_posterior(updater, prior=None, true_state=None, n_std=3, rebit_axes=REBIT_AXES, true_size=250,
          Severity: Major
          Found in src/qinfer/tomography/plotting_tools.py - About 1 hr to fix

            Function perf_test has 9 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            def perf_test(
            Severity: Major
            Found in src/qinfer/perf_testing.py - About 1 hr to fix

              Function hypothetical_update has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                  def hypothetical_update(self, outcomes, expparams, return_likelihood=False, return_normalization=False):
                      # TODO: consolidate code with SMCUpdater by breaking update logic
                      #       into private method.
              
                      # It's "hypothetical", don't want to overwrite old weights yet!
              Severity: Minor
              Found in src/qinfer/smc.py - About 1 hr 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 format_uncertainty has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

              def format_uncertainty(value, uncertianty, scinotn_break=4):
                  """
                  Given a value and its uncertianty, format as a LaTeX string
                  for pretty-printing.
              
              
              Severity: Minor
              Found in src/qinfer/utils.py - About 1 hr 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 plot_posterior_marginal has 8 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  def plot_posterior_marginal(self, idx_param=0, res=100, smoothing=0,
              Severity: Major
              Found in src/qinfer/smc.py - About 1 hr to fix

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

                def plot_rebit_prior(prior, rebit_axes=REBIT_AXES,
                Severity: Major
                Found in src/qinfer/tomography/plotting_tools.py - About 1 hr to fix

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

                      def __init__(self,
                  Severity: Major
                  Found in src/qinfer/resamplers.py - About 1 hr to fix

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

                    def particle_clusters(
                    Severity: Major
                    Found in src/qinfer/clustering.py - About 1 hr to fix

                      Function pretty_time has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                      Open

                      def pretty_time(secs, force_h=False, force_m=False):
                          if secs > 86400:
                              return "{d} days, ".format(d=int(secs//86400)) + pretty_time(secs % 86400, force_h=True)
                          elif force_h or secs > 3600:
                              return "{h}:".format(h=int(secs//3600)) + pretty_time(secs % 3600, force_m=True)
                      Severity: Minor
                      Found in src/qinfer/utils.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 __init__ has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def __init__(self,
                                  model, n_particles, prior,
                                  resample_a=None, resampler=None, resample_thresh=0.5,
                                  debug_resampling=False,
                                  track_resampling_divergence=False,
                      Severity: Minor
                      Found in src/qinfer/smc.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 __init__ has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def __init__(self, simulator,
                              error_tol=1e-2, min_samp=10, samp_step=10,
                              est_hedge=0.509, adapt_hedge=0.509
                          ):
                              
                      Severity: Minor
                      Found in src/qinfer/ale.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 update_timestep has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def update_timestep(self, modelparams, expparams):
                      
                              n_mps = modelparams.shape[0]
                              n_eps = expparams.shape[0]
                              if self._diagonal:
                      Severity: Minor
                      Found in src/qinfer/derived_models.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 hypothetical_update has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def hypothetical_update(self, outcomes, expparams, return_likelihood=False, return_normalization=False):
                              """
                              Produces the particle weights for the posterior of a hypothetical
                              experiment.
                      
                      
                      Severity: Minor
                      Found in src/qinfer/smc.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

                      Severity
                      Category
                      Status
                      Source
                      Language