Showing 154 of 497 total issues
Function generate
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def generate(directory, propositions, voters_per_proposition, copies,
FNULL):
print("Generating " + directory + "...")
sys.stdout.flush()
Function generate
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def generate(directory, degree, copies):
print("Generating " + directory + "...")
sys.stdout.flush()
try:
Function __init__
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, weight, variable, factor, fmap, vmap,
Function add_ufo
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def add_ufo(factor, factor_pt, factor_ufo, fmap, vid, variable, var_pt, var_ufo, ufo_recv, pf_var_begin):
Function find_ufo
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def find_ufo(factor, factor_pt, factor_ufo, fmap, vid, variable, var_pt,
Function process_ufo
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def process_ufo(factor, factor_pt, factor_ufo, fmap, vid, variable, var_pt, var_ufo, pf_ufo_var_list, pf_var_begin):
Function loadFactorGraph
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def loadFactorGraph(self, weight, variable, factor, fmap, domain_mask,
edges, var_copies=1, weight_copies=1,
factors_to_skip=np.empty(0, np.int64)):
"""TODO."""
# Note: factors_to_skip must be sorted
- 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 process_pf
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def process_pf(factor, factor_pt, factor_ufo, fmap, fid, vid, variable, var_pt, var_ufo, ismaster):
Function process_ufo
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def process_ufo(factor, factor_pt, factor_ufo, fmap, vid, variable, var_pt, var_ufo, pf_ufo_var_list, pf_var_begin):
time1 = time.time()
ufo_send, ufo_recv = find_ufo(factor, factor_pt.view(np.int8), factor_ufo, fmap, vid, variable, var_pt.view(np.int8), var_ufo, pf_ufo_var_list, pf_var_begin)
time2 = time.time()
Function find_pf
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def find_pf(factor, factor_pt, factor_ufo, fmap, fid, vid, variable, var_pt, var_ufo):
Function main
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def main(application_dir, machines, threads_per_machine,
Function compute_ufo_values
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def compute_ufo_values(factor, fmap, var_value, variable, var_ufo, ufo_send, ufo_start, ufo_map, ufo):
Function get_factors_helper
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_factors_helper(row, fid, ff, factor, factor_pt, factor_ufo, fmap,
Function loadFactorGraph
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def loadFactorGraph(self, weight, variable, factor, fmap, domain_mask,
Function __init__
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def __init__(self, weight, variable, factor, fmap, vmap,
factor_index, var_copies, weight_copies, fid, workers):
"""TODO."""
self.weight = weight
self.variable = variable
Function find_pf
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def find_pf(factor, factor_pt, factor_ufo, fmap, fid, vid, variable, var_pt, var_ufo):
count = 0
for i in range(len(factor)):
if ((factor_pt[i] == 68 and not factor_ufo[i]) # "D"
or factor_pt[i] == 71): # "G"
- 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 generate
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def generate(directory, propositions, voters_per_proposition, copies,
FNULL):
print("Generating " + directory + "...")
sys.stdout.flush()
- 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 client
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def client(argv=None):
"""TODO."""
parser = argparse.ArgumentParser(
description="Run Gibbs worker",
epilog="")
Function loadFGFromFile
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def loadFGFromFile(self, directory=None, metafile=None, weightfile=None,
Function eval_factor
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def eval_factor(factor_id, var_samp, value, var_copy, variable, factor, fmap,