Showing 154 of 497 total issues
Avoid deeply nested control flow statements. Open
if is_pf:
var = pf_ufo_var_list[local_vid - pf_var_begin]
else:
var = local_vid
# if var == -1:
Avoid deeply nested control flow statements. Open
if is_ufo:
assert(var == -1) # This must be the first seen
is_pf = (var_pt[local_vid] == 80) # check if this is a partial factor
if is_pf:
var = pf_ufo_var_list[local_vid - pf_var_begin]
Avoid deeply nested control flow statements. Open
if is_pf:
var = pf_ufo_var_list[local_vid - pf_var_begin]
else:
var = local_vid
# if var == -1:
Function burnIn
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def burnIn(self, epochs, sample_evidence, diagnostics=False,
Function send_array
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def send_array(socket, A, flags=0, copy=True, track=False):
Function generate
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def generate(directory, propositions, voters_per_proposition, copies,
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, socket_queue, message_handler, logger, *args,
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self,
Function decrease_vid
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def decrease_vid(fmap, vid, amount, begin, end):
Function apply_ufo_values
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def apply_ufo_values(factor, fmap, var_value, ufo_map, ufo_values):
Function run_pool
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def run_pool(threadpool, threads, func, args):
"""TODO."""
if threads == 1:
func(0, *args)
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 get_variables
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def get_variables(cur, views, sql_filter="True"):
"""TODO."""
op_template = "SELECT {cmd} FROM {table_name} " \
"WHERE {filter}"
- 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 prep_minions_numbskull
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def prep_minions_numbskull(self):
"""TODO."""
# send args and initialize numbskull at minion
data = {'argv': self.argv}
newEvent = self.local_client.cmd(self.minions,
- 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 close
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def close(self):
"""TODO."""
if self._socket is not None:
try:
self._socket.shutdown(socket.SHUT_RDWR)
- 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 compute_ufo_values
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def compute_ufo_values(factor, fmap, var_value, variable, var_ufo, ufo_send, ufo_start, ufo_map, ufo):
var_copy = 0
ufo_index = 0
for i in range(len(ufo)):
- 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_weights
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def get_weights(cur, views, sql_filter="True"):
"""TODO."""
op_template = "SELECT {cmd} FROM {table_name} " \
"WHERE {filter}"
- 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 -1
Avoid too many return
statements within this function. Open
return 0
Avoid too many return
statements within this function. Open
return 1
Avoid too many return
statements within this function. Open
return -1