Showing 458 of 458 total issues
Function _sample_hubo_old
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
def _sample_hubo_old(
Function _cxxjij_sampling
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def _cxxjij_sampling(
self,
model,
init_generator,
algorithm,
- 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 se_success_probability
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def se_success_probability(
response, solutions, ref_energy=0, measure_with_energy=False
):
"""Calculate success probability's standard error from openjij.response
- 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 success_probability
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def success_probability(response, solutions, ref_energy=0, measure_with_energy=False):
"""Calculate success probability from openjij.response
Args:
response (openjij.Response): response from solver (or sampler).
- 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 _convert_validation_schedule
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def _convert_validation_schedule(self, schedule, beta):
if not isinstance(schedule, (list, np.array)):
raise ValueError("schedule should be list or numpy.array")
if isinstance(schedule[0], cxxjij.utility.TransverseFieldSchedule):
- 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 solver_benchmark
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def solver_benchmark(
Function sample
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def sample(self, bqm, **parameters):
"""Sample from a binary quadratic model.
Args:
bqm (openjij.BinaryQuadraticModel):
- 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 base_sample_hubo
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def base_sample_hubo(
hubo: dict[tuple, float],
vartype: Optional[str] = None,
num_sweeps: int = 1000,
num_reads: int = 1,
- 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 _cxxjij_sampling
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def _cxxjij_sampling(
Function KingGraph
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def KingGraph(
Function _make_BinaryPolynomialModel_from_hising_from_list
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _make_BinaryPolynomialModel_from_hising_from_list(keys: list, values: list):
if len(keys) == 0:
return make_BinaryPolynomialModel({}).from_hising(keys, values)
i = 0
- 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
Avoid deeply nested control flow statements. Open
if v != -1 and v != 1:
raise RuntimeError(
"The initial variables must be -1 or +1."
)
temp_initial_state.append(v)
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Avoid deeply nested control flow statements. Open
if v != 0 and v != 1:
raise RuntimeError("The initial variables must be 0 or 1.")
temp_initial_state.append(2 * v - 1)
Function _make_BinaryPolynomialModel_from_hubo_from_list
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _make_BinaryPolynomialModel_from_hubo_from_list(keys: list, values: list):
if len(keys) == 0:
return make_BinaryPolynomialModel({}).from_hubo(keys, values)
i = 0
- 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
Avoid deeply nested control flow statements. Open
if v != -1 and v != 1:
raise RuntimeError(
"The initial variables must be -1 or +1."
)
temp_initial_state.append(v)
Function _BinaryPolynomialModel_from_list
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _BinaryPolynomialModel_from_list(keys: list, values: list, vartype):
if len(keys) == 0:
Model = make_BinaryPolynomialModel({})
return Model(keys, values, _to_cxxcimod(vartype))
i = 0
- 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 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function ChimeraModel
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def ChimeraModel(
Avoid deeply nested control flow statements. Open
if v != 0 and v != 1:
raise RuntimeError("The initial variables must be 0 or 1.")
temp_initial_state.append(2 * v - 1)