xybu/onedrived-dev

View on GitHub

Showing 56 of 166 total issues

Function process_events has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def process_events(self):
"""
When there is inotify events available, async loop schedules this function in MainThread. Also it seems that
async loop will not schedule it if this function is in the middle of execution.
:return:
Severity: Minor
Found in onedrived/od_watcher.py - About 35 mins to fix

Function gen_start_repo_tasks has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def gen_start_repo_tasks(all_accounts):
"""
:param dict[str, [onedrived.od_repo.OneDriveLocalRepository]] all_accounts:
"""
if task_pool.outstanding_task_count == 0:
Severity: Minor
Found in onedrived/od_main.py - About 35 mins to fix

Function authenticate_account has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def authenticate_account(get_auth_url=False, code=None, for_business=False):
if for_business:
error(translator['od_pref.authenticate_account.for_business_unsupported'])
return
authenticator = od_auth.OneDriveAuthenticator()
Severity: Minor
Found in onedrived/od_pref.py - About 35 mins to fix

Avoid too many return statements within this function.
Open

return
Severity: Major
Found in onedrived/od_pref.py - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

    return
    Severity: Major
    Found in onedrived/od_pref.py - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

      return True
      Severity: Major
      Found in onedrived/od_watcher.py - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

        return
        Severity: Major
        Found in onedrived/od_watcher.py - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

          return self._handle_unpaired_move_from(ev, flags,
          Severity: Major
          Found in onedrived/od_watcher.py - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

            return
            Severity: Major
            Found in onedrived/od_watcher.py - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

              return self._handle_file_creation(ev, repo, item_path, parent_dir)
              Severity: Major
              Found in onedrived/od_watcher.py - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                return self._handle_unpaired_move_to(ev, flags, repo, to_parent_dir=parent_dir)
                Severity: Major
                Found in onedrived/od_watcher.py - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                  return False
                  Severity: Major
                  Found in onedrived/od_watcher.py - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                    return
                    Severity: Major
                    Found in onedrived/od_watcher.py - About 30 mins to fix

                      Function _handle_local_item has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                      def _handle_local_item(self, item_name, all_records):
                      """
                      :param str item_name:
                      :param dict(str, onedrived.od_repo.ItemRecord) all_records:
                      :return:
                      Severity: Minor
                      Found in onedrived/od_tasks/merge_dir.py - About 25 mins to fix

                      Function validate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                      def validate(self):
                      for key, spec in self.config_schema_dict.items():
                      if not isinstance(spec, dict):
                      raise TypeError('Schema for key "%s" must be of dict type.' % key)
                      if 'type' not in spec:
                      Severity: Minor
                      Found in onedrived/od_models/dict_guard/__init__.py - About 25 mins to fix

                      Function _test_str_subtype_file has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                      def _test_str_subtype_file(key, value, schema):
                      if not os.path.exists(value):
                      if _test_bool_option(schema, 'create_if_missing'):
                      with open(value, 'w'):
                      pass
                      Severity: Minor
                      Found in onedrived/od_models/dict_guard/__init__.py - About 25 mins to fix
                      Severity
                      Category
                      Status
                      Source
                      Language