q-optimize/c3

View on GitHub

Showing 303 of 330 total issues

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

    def __init__(
Severity: Major
Found in c3/signal/gates.py - About 50 mins to fix

    Function leakage_RB has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def leakage_RB(
    Severity: Major
    Found in c3/libraries/fidelities.py - About 50 mins to fix

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

          def __init__(
      Severity: Major
      Found in c3/libraries/chip.py - About 50 mins to fix

        Function orbit_infid has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        def orbit_infid(
        Severity: Major
        Found in c3/libraries/fidelities.py - About 50 mins to fix

          Function state_transfer_infid_set has 7 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          def state_transfer_infid_set(
          Severity: Major
          Found in c3/libraries/fidelities.py - About 50 mins to fix

            Function tf_batch_propagate has 7 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            def tf_batch_propagate(
            Severity: Major
            Found in c3/libraries/propagation.py - About 50 mins to fix

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

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

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

                    def __init__(
                        self,
                        name: str,
                        desc: str = None,
                        comment: str = None,
                Severity: Minor
                Found in c3/libraries/chip.py - About 45 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 quick_setup has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    def quick_setup(self, chan, qubit_freq, gate_time, v2hz=1, sideband=None) -> None:
                Severity: Minor
                Found in c3/signal/gates.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

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

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

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

                      def tf_propagation_lind(h0, hks, col_ops, cflds_t, dt, history=False):
                      Severity: Minor
                      Found in c3/libraries/propagation.py - About 45 mins to fix

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

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

                          Avoid deeply nested control flow statements.
                          Open

                                                  for par, val in props["params"].items():
                                                      instr.comps[drive_chan][comp].params[par].set_value(val)
                                      else:
                          Severity: Major
                          Found in c3/parametermap.py - About 45 mins to fix

                            Function set_ideal has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                            Open

                                def set_ideal(self, ideal):
                                    if ideal is not None:
                                        self.ideal = ideal
                                    else:
                                        gate_list = []
                            Severity: Minor
                            Found in c3/signal/gates.py - About 45 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 __topological_ordering has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                            Open

                                def __topological_ordering(self, predecessors: Dict[str, List[str]]) -> List[str]:
                                    """
                                    Computes the topological ordering of a directed acyclic graph.
                            
                                    Parameters
                            Severity: Minor
                            Found in c3/generator/generator.py - About 45 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 reorder_frame has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                            Open

                                def reorder_frame(
                                    self, e: tf.constant, v: tf.constant, ordered: bool
                                ) -> Tuple[tf.constant, tf.constant, tf.constant]:
                                    """Reorders the new basis states according to their overlap with bare qubit states."""
                                    if ordered:
                            Severity: Minor
                            Found in c3/model.py - About 45 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

                            Avoid deeply nested control flow statements.
                            Open

                                                        if ctrl.params["amp"] != 0.0:
                                                            offset = ctrl.params["freq_offset"].get_value()
                                                freqs[line] = tf.cast(
                            Severity: Major
                            Found in c3/experiment.py - About 45 mins to fix

                              Function get_init_state has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  def get_init_state(self) -> tf.Tensor:
                                      """Get an initial state. If a task to compute a thermal state is set, return that."""
                                      if self.init_state is None:
                                          if "init_ground" in self.tasks:
                                              print(
                              Severity: Minor
                              Found in c3/model.py - About 45 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 6 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

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