Showing 45 of 64 total issues
Function tkl_import_module
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def tkl_import_module(dir_path, module_file_name, ref_module_name = None, inject_attrs = {}, prefix_exec_module_pred = None, skip_stack_frames = 0, reimport_if_being_imported = False):
Avoid deeply nested control flow statements. Open
Open
if expand_undefined_var_to_value is None:
expanded_value += out_value[prev_match_index:m.start()] + expand_undefined_var_to_prefix + m.group(1) + expand_undefined_var_to_suffix
else:
expanded_value += out_value[prev_match_index:m.start()] + expand_undefined_var_to_prefix + expand_undefined_var_to_value + expand_undefined_var_to_suffix
else:
Avoid deeply nested control flow statements. Open
Open
for url in urls:
if not is_file_path_printed:
print('{0}:'.format(file_path))
is_file_path_printed = True
Avoid deeply nested control flow statements. Open
Open
if is_to_module:
setattr(to, from_key, to_value)
else:
to[from_key] = to_value
else:
Avoid deeply nested control flow statements. Open
Open
if 'nomergemodule' in target_module_attrs and target_module_attrs['nomergemodule']:
raise Exception('attempt to merge the module content to the existed module has been declared as not mergable: ' + to_value.__name__)
Avoid deeply nested control flow statements. Open
Open
if qualname is None or isinstance(qualname, str):
return tkl_classcopy(x, from_globals, to_globals)
Avoid deeply nested control flow statements. Open
Open
if from_value.__name__ not in packaged_modules and \
(not ignore_merge_imported_modules or from_value.__file__.replace('\\', '/') not in imported_modules_by_file_path):
#print('mergemodule: ->', from_.__name__, '->', from_key, id(from_value), id(to_value), type(from_value), type(to_value))
if not inspect.ismodule(to_value):
# replace by a module instance, based on: https://stackoverflow.com/questions/11170949/how-to-make-a-copy-of-a-python-module-at-runtime/11173076#11173076
Avoid deeply nested control flow statements. Open
Open
if retry_count % 10 == 0:
# give to scheduler a break
time.sleep(0.02)
continue
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(self, appname, flag='c', mode=0o666, keyencoding='utf-8',
Avoid deeply nested control flow statements. Open
Open
if not is_module_ref_already_exist:
raise Exception('The module reference must already exist as a module before the import: ' + import_module_name)
Avoid deeply nested control flow statements. Open
Open
if var_value is None:
if not search_in_expand_dict_at_second is None:
var_value = search_in_expand_dict_at_second.get(var_name)
if var_value is None:
if not search_by_pred_at_third is None:
Avoid deeply nested control flow statements. Open
Open
if retry_count % 10 == 0:
# give to scheduler a break
time.sleep(0.02)
continue
Avoid deeply nested control flow statements. Open
Open
if retry_count % 10 == 0:
# give to scheduler a break
time.sleep(0.02)
continue
Avoid deeply nested control flow statements. Open
Open
if var_value is None:
if not search_in_expand_dict_at_second is None:
var_value = search_in_expand_dict_at_second.get(var_name)
if var_value is None:
if not search_by_pred_at_third is None:
Avoid deeply nested control flow statements. Open
Open
if c.isspace():
has_spaces = True
break
Avoid deeply nested control flow statements. Open
Open
if is_module_ref_already_exist:
raise Exception('The module reference must not exist as a module before the import: ' + import_module_name)
elif module_must_exist:
Avoid deeply nested control flow statements. Open
Open
if not var_value is None:
var_value = var_value.replace('\\', '/')
if var_value is None:
if not search_in_expand_dict_at_second is None:
var_value = search_in_expand_dict_at_second.get(var_name)
Avoid deeply nested control flow statements. Open
Open
if 'nomergemodule' in target_module_attrs and target_module_attrs['nomergemodule']:
raise Exception('attempt to merge the module content to the existed module has been declared as not mergable: ' + target_module.__name__)
# export globals to a being imported module
for var, value in global_vars.items():
Avoid deeply nested control flow statements. Open
Open
if not var_value is None:
var_value = var_value.replace('\\', '/')
if var_value is None:
if not search_in_expand_dict_at_second is None:
var_value = search_in_expand_dict_at_second.get(var_name)
Function expand_dict
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def expand_dict(self, dict_value, search_in_expand_dict_at_second = None, search_by_pred_at_third = None, ignore_types = None, list_as_cmdline = False):