andry81/tacklelib

View on GitHub

Showing 45 of 64 total issues

Function tkl_import_module has 7 arguments (exceeds 4 allowed). Consider refactoring.
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):
Severity: Major
Found in python/tacklelib/tacklelib.py - About 50 mins to fix

    Avoid deeply nested control flow statements.
    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:
    Severity: Major
    Found in python/tacklelib/tacklelib.yaml.py - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                for url in urls:
                  if not is_file_path_printed:
                    print('{0}:'.format(file_path))
                    is_file_path_printed = True
      
      Severity: Major
      Found in python/tacklelib/tools/list_urls_in_files.py - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                  if is_to_module:
                    setattr(to, from_key, to_value)
                  else:
                    to[from_key] = to_value
                else:
        Severity: Major
        Found in python/tacklelib/tacklelib.py - About 45 mins to fix

          Avoid deeply nested control flow statements.
          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__)
          
          Severity: Major
          Found in python/tacklelib/tacklelib.py - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                      if qualname is None or isinstance(qualname, str):
                        return tkl_classcopy(x, from_globals, to_globals)
            
            Severity: Major
            Found in python/tacklelib/tacklelib.py - About 45 mins to fix

              Avoid deeply nested control flow statements.
              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
              Severity: Major
              Found in python/tacklelib/tacklelib.py - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                              if retry_count % 10 == 0:
                                # give to scheduler a break
                                time.sleep(0.02)
                              continue
                Severity: Major
                Found in python/tacklelib/tacklelib.cache.py - About 45 mins to fix

                  Function __init__ has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      def __init__(self, appname, flag='c', mode=0o666, keyencoding='utf-8',
                  Severity: Minor
                  Found in python_patches/fcache/cache.py - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    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)
                    
                    Severity: Major
                    Found in python/tacklelib/tacklelib.py - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      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:
                      Severity: Major
                      Found in python/tacklelib/tacklelib.yaml.py - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                      if retry_count % 10 == 0:
                                        # give to scheduler a break
                                        time.sleep(0.02)
                                      continue
                        Severity: Major
                        Found in python/tacklelib/tacklelib.cache.py - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                        if retry_count % 10 == 0:
                                          # give to scheduler a break
                                          time.sleep(0.02)
                                        continue
                          Severity: Major
                          Found in python/tacklelib/tacklelib.cache.py - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            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:
                            Severity: Major
                            Found in python/tacklelib/tacklelib.yaml.py - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                          if c.isspace():
                                            has_spaces = True
                                            break
                              
                              Severity: Major
                              Found in python/tacklelib/tacklelib.yaml.py - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                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:
                                Severity: Major
                                Found in python/tacklelib/tacklelib.py - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  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)
                                  Severity: Major
                                  Found in python/tacklelib/tacklelib.yaml.py - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    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(): 
                                    Severity: Major
                                    Found in python/tacklelib/tacklelib.py - About 45 mins to fix

                                      Avoid deeply nested control flow statements.
                                      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)
                                      Severity: Major
                                      Found in python/tacklelib/tacklelib.yaml.py - About 45 mins to fix

                                        Function expand_dict has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                        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):
                                        Severity: Minor
                                        Found in python/tacklelib/tacklelib.yaml.py - About 35 mins to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language