tp7309 / TTPassGen

Function with cyclomatic complexity higher than threshold PY-R1000
Anti-pattern
Minor
7 months ago7 months old
product_rule_words has a cyclomatic complexity of 17 with "high" risk
449    return WordProductor(word_count_list, word_size_list, word_productors)
450
451
452def product_rule_words(result, rules, dict_cache_limit, part_size, append_mode,453                       separator, inencoding, outencoding, output):
454    productor = generate_words_productor(rules, dict_cache_limit, inencoding)
455    result[1] = int(productor.total_count())
extract_rules has a cyclomatic complexity of 28 with "very-high" risk
300    echo("generate dict complete.")
301
302
303def extract_rules(dictList, rule, global_repeat_mode):304    splited_dict = re.split(r',\s*', dictList) if dictList else []
305    dict_count = len(splited_dict)
306    re_char_array = r"(\[([^\]]+?)\](\?|(\{-?\d+:-?\d+(:[\?\*])?\})|(\{-?\d+(:[\?\*])?\}))?)"
generate_dict_by_rule has a cyclomatic complexity of 16 with "high" risk
237        return f.read().splitlines()
238
239
240def generate_dict_by_rule(mode, dictlist, rule, dict_cache, global_repeat_mode,241                          part_size, append_mode, separator, debug_mode, inencoding,
242                          outencoding, output):
243    if not dictlist and not rule: