QInfer/python-qinfer

View on GitHub

Showing 73 of 3,465 total issues

File distributions.py has 1036 lines of code (exceeds 250 allowed). Consider refactoring.
Open

#!/usr/bin/python
# -*- coding: utf-8 -*-
##
# distributions.py: module for probability distributions.
##
Severity: Major
Found in src/qinfer/distributions.py - About 2 days to fix

    File smc.py has 784 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    #!/usr/bin/python
    # -*- coding: utf-8 -*-
    ##
    # smc.py: Sequential Monte Carlo module
    ##
    Severity: Major
    Found in src/qinfer/smc.py - About 1 day to fix

      File derived_models.py has 673 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      #!/usr/bin/python
      # -*- coding: utf-8 -*-
      ##
      # derived_models.py: Models that decorate and extend other models.
      ##
      Severity: Major
      Found in src/qinfer/derived_models.py - About 1 day to fix

        File test_distributions.py has 656 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        #!/usr/bin/python
        # -*- coding: utf-8 -*-
        ##
        # test_distributions.py: Checks that distribution objects act as expected.
        ##
        Severity: Major
        Found in src/qinfer/tests/test_distributions.py - About 1 day to fix

          File abstract_model.py has 551 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          #!/usr/bin/python
          # -*- coding: utf-8 -*-
          ##
          # abstract_model.py: Abstract interfaces for models with different levels of
          #     functionality.
          Severity: Major
          Found in src/qinfer/abstract_model.py - About 1 day to fix

            File domains.py has 501 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            #!/usr/bin/python
            # -*- coding: utf-8 -*-
            ##
            # domains.py: module for domains of model outcomes
            ##
            Severity: Major
            Found in src/qinfer/domains.py - About 1 day to fix

              File utils.py has 479 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              #!/usr/bin/python
              # -*- coding: utf-8 -*-
              ##
              # utils.py : some auxiliary functions
              ##
              Severity: Minor
              Found in src/qinfer/utils.py - About 7 hrs to fix

                Function __init__ has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
                Open

                    def __init__(
                            self, underlying_model, random_walk_idxs='all', 
                            fixed_covariance=None, diagonal=True, 
                            scale_mult=None, model_transformation=None
                        ):
                Severity: Minor
                Found in src/qinfer/derived_models.py - About 6 hrs 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

                File base_test.py has 419 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                #!/usr/bin/python
                # -*- coding: utf-8 -*-
                ##
                # base_test.py: Base class for derandomized test classes.
                ##
                Severity: Minor
                Found in src/qinfer/tests/base_test.py - About 6 hrs to fix

                  File test_concrete_models.py has 418 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  #!/usr/bin/python
                  # -*- coding: utf-8 -*-
                  ##
                  # test_concrete_models.py: Checks that built-in instances of Model work properly.
                  ##
                  Severity: Minor
                  Found in src/qinfer/tests/test_concrete_models.py - About 6 hrs to fix

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

                        def design_expparams_field(self,
                                guess, field,
                                cost_scale_k=1.0, disp=False,
                                maxiter=None, maxfun=None,
                                store_guess=False, grad_h=None, cost_mult=False
                    Severity: Minor
                    Found in src/qinfer/expdesign.py - About 4 hrs 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

                    File test_models.py has 290 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    #!/usr/bin/python
                    # -*- coding: utf-8 -*-
                    ##
                    # test_models.py: Simple models for testing inference engines.
                    ##
                    Severity: Minor
                    Found in src/qinfer/test_models.py - About 2 hrs to fix

                      File expdesign.py has 289 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      #!/usr/bin/python
                      # -*- coding: utf-8 -*-
                      ##
                      # expdesign.py: Adaptive experimental design algorithms.
                      ##
                      Severity: Minor
                      Found in src/qinfer/expdesign.py - About 2 hrs to fix

                        Function __call__ has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def __call__(self, model, particle_dist,
                                n_particles=None,
                                precomputed_mean=None, precomputed_cov=None
                            ):
                                """
                        Severity: Minor
                        Found in src/qinfer/resamplers.py - About 2 hrs 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

                        SMCUpdater has 23 functions (exceeds 20 allowed). Consider refactoring.
                        Open

                        class SMCUpdater(ParticleDistribution):
                            r"""
                            Creates a new Sequential Monte carlo updater, using the algorithm of
                            [GFWC12]_.
                        
                        
                        Severity: Minor
                        Found in src/qinfer/smc.py - About 2 hrs to fix

                          Function perf_test_multiple has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                          Open

                          def perf_test_multiple(
                                  n_trials,
                                  model, n_particles, prior,
                                  n_exp, heuristic_class,
                                  true_model=None, true_prior=None, true_mps=None,
                          Severity: Minor
                          Found in src/qinfer/perf_testing.py - About 2 hrs 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

                          File perf_testing.py has 261 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          #!/usr/bin/python
                          # -*- coding: utf-8 -*-
                          ##
                          # perf_testing.py: Tests the performance of SMC estimation and likelihood
                          #     calls.
                          Severity: Minor
                          Found in src/qinfer/perf_testing.py - About 2 hrs to fix

                            File bases.py has 259 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            #!/usr/bin/python
                            # -*- coding: utf-8 -*-
                            ##
                            # bases.py: Representations of Hermitian bases for tomography.
                            ##
                            Severity: Minor
                            Found in src/qinfer/tomography/bases.py - About 2 hrs to fix

                              File legacy.py has 257 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              #!/usr/bin/python
                              # -*- coding: utf-8 -*-
                              ##
                              # SMC.py: Tomgraphic models module
                              ##
                              Severity: Minor
                              Found in src/qinfer/tomography/legacy.py - About 2 hrs to fix

                                Simulatable has 21 functions (exceeds 20 allowed). Consider refactoring.
                                Open

                                class Simulatable(with_metaclass(abc.ABCMeta, object)):
                                    r"""
                                    Represents a system which can be simulated according to
                                    various model parameters and experimental control parameters
                                    in order to produce representative data.
                                Severity: Minor
                                Found in src/qinfer/abstract_model.py - About 2 hrs to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language