Showing 55 of 464 total issues
Consider simplifying this complex logical expression. Open
if "keys" in kwargs and "values" in kwargs:
key_condition = isinstance(kwargs["keys"], list) or isinstance(
kwargs["keys"], tuple
)
val_condition = isinstance(kwargs["values"], list) or isinstance(
Consider simplifying this complex logical expression. Open
if "keys" in kwargs and "values" in kwargs:
key_condition = isinstance(kwargs["keys"], list) or isinstance(
kwargs["keys"], tuple
)
val_condition = isinstance(kwargs["values"], list) or isinstance(
Function bqm_from_numpy_matrix
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def bqm_from_numpy_matrix(
Function se_upper_tts
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def se_upper_tts(tts, success_prob, computation_time, p_r, se_success_prob):
Function _annealing_schedule_setting
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _annealing_schedule_setting(
Function se_lower_tts
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def se_lower_tts(tts, success_prob, computation_time, p_r, se_success_prob):
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function make_BinaryPolynomialModel_from_JSON
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def make_BinaryPolynomialModel_from_JSON(obj):
if obj["type"] != "BinaryPolynomialModel":
raise Exception('Type must be "BinaryPolynomialModel"')
mock_polynomial = {}
if obj["index_type"] == "IndexType.INT":
- 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 too many return
statements within this function. Open
return _BinaryPolynomialModel_from_list(
Avoid too many return
statements within this function. Open
return _BinaryPolynomialModel_from_dict(
Avoid too many return
statements within this function. Open
return _BinaryPolynomialModel_from_list(
Function geometric_ising_beta_schedule
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def geometric_ising_beta_schedule(
cxxgraph: Union[openjij.cxxjij.graph.Dense, openjij.cxxjij.graph.CSRSparse],
beta_max=None,
beta_min=None,
num_sweeps=1000,
- 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 rename_kwargs
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def rename_kwargs(func_name, kwargs, aliases):
for alias, new in aliases.items():
if alias in kwargs:
if new in kwargs:
raise TypeError(f"{func_name} received both {alias} and {new}")
- 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 _set_params
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _set_params(self, **kwargs):
for key, value in kwargs.items():
if key not in self._default_params:
raise ValueError("Unknown parameters detected")
if value is 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 sample_hubo
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def sample_hubo(
self,
J: dict[tuple, float],
vartype: Optional[str] = None,
num_sweeps: int = 1000,
- 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"