Showing 160 of 330 total issues
Function eng_num
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def eng_num(val: float) -> Tuple[float, str]:
"""Convert a number to engineering notation by returning number and prefix."""
if np.array(val).size > 1:
return np.array(val), ""
if np.isnan(val):
- Read upRead up
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 log_parameters
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def log_parameters(self, evaluation, optim_status):
if self.store_better_iterations_only:
if optim_status["goal"] > self.best_iteration:
return
else:
- Read upRead up
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 RB
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def RB(
Consider simplifying this complex logical expression. Open
if isinstance(data, dict):
return {str(k): jsonify_list(v) for k, v in data.items()}
elif isinstance(data, list):
return [jsonify_list(v) for v in data]
elif isinstance(data, tuple):
Function __init__
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def __init__(
self, value, unit="undefined", min_val=None, max_val=None, symbol=r"\alpha"
):
pref = 1.0
value = np.array(value)
- Read upRead up
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 get_Lindbladian
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def get_Lindbladian(self, dims):
"""
Compute the Lindbladian, based on relaxation, dephasing constants and finite
temperature.
- Read upRead up
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 grid2D
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def grid2D(x_init, fun=None, fun_grad=None, grad_lookup=None, options={}):
"""
Two dimensional scan of the function values around the initial point.
Parameters
- Read upRead up
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 initialise
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def initialise(self, drift_ham, lindbladian=False, init_temp=None):
"""
Prepare the initial state of the system. At the moment finite temperature requires open system dynamics.
Parameters
- Read upRead up
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 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function leakage_RB
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def leakage_RB(
Function __init__
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function orbit_infid
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def orbit_infid(
Function state_transfer_infid_set
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def state_transfer_infid_set(
Function tf_batch_propagate
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def tf_batch_propagate(
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
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,
- Read upRead up
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:
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
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):