q-optimize/c3

View on GitHub

Showing 303 of 330 total issues

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

def ode_solver(
Severity: Minor
Found in c3/libraries/propagation.py - About 45 mins to fix

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

        def __init__(
    Severity: Minor
    Found in c3/signal/pulse.py - About 45 mins to fix

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

          loglkhs = multi.log_prob(exp_values * shots) - multi.log_prob(sim_values * shots)
      Severity: Minor
      Found in c3/libraries/estimators.py and 1 other location - About 45 mins to fix
      c3/libraries/estimators.py on lines 102..102

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 35.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

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

          loglkhs = binom.log_prob(exp_values * shots) - binom.log_prob(sim_values * shots)
      Severity: Minor
      Found in c3/libraries/estimators.py and 1 other location - About 45 mins to fix
      c3/libraries/estimators.py on lines 201..201

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 35.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

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

          multi = tfp.distributions.Multinomial(
              total_count=tf.reshape(shots, [shots.shape[0]]), probs=sim_values
      Severity: Minor
      Found in c3/libraries/estimators.py and 1 other location - About 45 mins to fix
      c3/libraries/estimators.py on lines 198..199

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 35.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

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

          multi = tfp.distributions.Multinomial(
              total_count=tf.reshape(shots, [shots.shape[0]]), probs=sim_values
      Severity: Minor
      Found in c3/libraries/estimators.py and 1 other location - About 45 mins to fix
      c3/libraries/estimators.py on lines 181..182

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 35.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

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

      def adaptive_scan(x_init, fun=None, fun_grad=None, grad_lookup=None, options={}):
      Severity: Minor
      Found in c3/libraries/algorithms.py - About 35 mins to fix

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

        def epc_analytical(propagators: dict, index, dims, proj: bool, cliffords=False):
        Severity: Minor
        Found in c3/libraries/fidelities.py - About 35 mins to fix

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

          def rk38(func, rho, h, dt, col=None):
          Severity: Minor
          Found in c3/libraries/propagation.py - About 35 mins to fix

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

                def __init__(
            Severity: Minor
            Found in c3/libraries/tasks.py - About 35 mins to fix

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

              def lbfgs_grad_free(x_init, fun=None, fun_grad=None, grad_lookup=None, options={}):
              Severity: Minor
              Found in c3/libraries/algorithms.py - About 35 mins to fix

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

                def gcmaes(x_init, fun=None, fun_grad=None, grad_lookup=None, options={}):
                Severity: Minor
                Found in c3/libraries/algorithms.py - About 35 mins to fix

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

                  def tf_rmsprop(
                  Severity: Minor
                  Found in c3/libraries/algorithms.py - About 35 mins to fix

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

                    def lbfgs(x_init, fun=None, fun_grad=None, grad_lookup=None, options={}):
                    Severity: Minor
                    Found in c3/libraries/algorithms.py - About 35 mins to fix

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

                      def tf_dU_of_t_lind(h0, hks, col_ops, cflds_t, dt):
                      Severity: Minor
                      Found in c3/libraries/propagation.py - About 35 mins to fix

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

                        def lindbladian_average_infid_set(
                        Severity: Minor
                        Found in c3/libraries/fidelities.py - About 35 mins to fix

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

                          def state_transfer_from_states(states: tf.Tensor, index, dims, params, n_eval=-1):
                          Severity: Minor
                          Found in c3/libraries/fidelities.py - About 35 mins to fix

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

                            def cmaes(x_init, fun=None, fun_grad=None, grad_lookup=None, options={}):
                            Severity: Minor
                            Found in c3/libraries/algorithms.py - About 35 mins to fix

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

                              def unitary_infid_set(propagators: dict, instructions: dict, index, dims, n_eval=-1):
                              Severity: Minor
                              Found in c3/libraries/fidelities.py - About 35 mins to fix

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

                                    def __init__(
                                Severity: Minor
                                Found in c3/libraries/tasks.py - About 35 mins to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language