owncloud/core

View on GitHub
settings/js/users/groups.js

Summary

Maintainability
C
1 day
Test Coverage

File groups.js has 319 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * Copyright (c) 2014, Raghu Nayyar <beingminimal@gmail.com>
 * Copyright (c) 2014, Arthur Schiwon <blizzz@owncloud.com>
 * This file is licensed under the Affero General Public License version 3 or later.
 * See the COPYING-README file.
Severity: Minor
Found in settings/js/users/groups.js - About 3 hrs to fix

    Function update has 41 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            update: function () {
                if (GroupList.updating) {
                    return;
                }
                GroupList.updating = true;
    Severity: Minor
    Found in settings/js/users/groups.js - About 1 hr to fix

      Function sortGroups has 39 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              sortGroups: function () {
                  var lis = this.$userGroupList.find('.isgroup').get();
      
                  lis.sort(function (a, b) {
                      // "Everyone" always at the top
      Severity: Minor
      Found in settings/js/users/groups.js - About 1 hr to fix

        Avoid too many return statements within this function.
        Open

                        return UserList.alphanum(
                            $(a).find('a span').text(),
                            $(b).find('a span').text()
                        );
        Severity: Major
        Found in settings/js/users/groups.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                                  return 1;
          Severity: Major
          Found in settings/js/users/groups.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                                    return -1;
            Severity: Major
            Found in settings/js/users/groups.js - About 30 mins to fix

              There are no issues that match your filters.

              Category
              Status