linagora/openpaas-esn

View on GitHub

Showing 726 of 2,177 total issues

Function createContactSyncJob has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function createContactSyncJob() {
    var job = function(callback) {
      q.all([getAllUsers(), getAllImporterTypes()])
        .then(function(data) {
          var users = data[0];
Severity: Minor
Found in modules/linagora.esn.contact.import/backend/lib/cron/index.js - About 1 hr to fix

    Function _createInterface has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      _createInterface(topic) {
        return {
          subscribe: handler => {
            this._addCache(topic, ACTION_SUBSCRIBE, handler);
    
    
    Severity: Minor
    Found in backend/core/pubsub/global/rabbit.js - About 1 hr to fix

      Function link has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

            link: function($scope, elem) {
      
              $scope.fillPosition = function() {
                $scope.position.load = true;
                $scope.position.show = true;
      Severity: Minor
      Found in frontend/js/modules/maps.js - About 1 hr to fix

        Function link has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

              link: function(scope, element, attrs) {
                var position = 0,
                    toggled = false;
        
                var scrollHandler = function(event) {
        Severity: Minor
        Found in frontend/js/modules/scroll.js - About 1 hr to fix

          Function share has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              $scope.share = function() {
          
                if (!$scope.activitystream) {
                  $log.debug('activitystream is required');
          
          
          Severity: Minor
          Found in frontend/js/modules/message.js - About 1 hr to fix

            Function on has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    on: function(event, callback) {
                      if (!room) {
                        client.on(event, callback);
                        $log.debug(namespace + ' : subscribed');
                        return this;
            Severity: Minor
            Found in frontend/js/modules/websocket.js - About 1 hr to fix

              Function controller has 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function controller($scope) {
                    var userResolver = objectTypeResolver.resolve($scope.notification.subject.objectType, $scope.notification.subject.id);
                    var collaborationResolver = objectTypeResolver.resolve($scope.notification.complement.objectType, $scope.notification.complement.id);
              
                    this.actionDone = function(action) {

                Function synchronize has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  function synchronize(domainId) {
                    const syncTime = Date.now();
                
                    return Promise.all([
                      _getTechnicalUserAndToken(domainId),

                  Function exports has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  module.exports = function(dependencies, lib) {
                  
                    function getUser(req, res) {
                      if (!req.user) {
                        return res.status(404).json({error: {code: 404, message: 'Not found', details: 'User not found'}});

                    Function sendMessageAsEmails has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      function sendMessageAsEmails(message, recipients, callback) {
                        if (!message) {
                          return callback(new Error('Message is required'));
                        }
                    
                    
                    Severity: Minor
                    Found in modules/linagora.esn.messaging.email/lib/sender.js - About 1 hr to fix

                      Function exports has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      module.exports = dependencies => {
                        const esnConfig = dependencies('esn-config'),
                              autoconf = require('../../lib/autoconf')(dependencies);
                      
                        return {

                        Function hasContactInformationMatchQuery has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                              $scope.hasContactInformationMatchQuery = function() {
                                if ($scope.keySearch === null || angular.isUndefined($scope.keySearch)) {
                                  return false;
                                }
                        
                        
                        Severity: Minor
                        Found in modules/linagora.esn.contact/frontend/app/app.controllers.js - About 1 hr to fix

                          Function contactListItems has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            function contactListItems(
                              $timeout,
                              ContactListScrollingService,
                              contactService,
                              sharedContactDataService,

                            Function askUserForCancel has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                function askUserForCancel(text, linkText, delay) {
                                  var deferred = $q.defer();
                            
                                  var notification = notifyService({
                                    message: text

                              Function exports has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              module.exports = function(dependencies) {
                                const logger = dependencies('logger');
                                const esnConfig = dependencies('esn-config');
                                const strategies = require('./strategies')(dependencies);
                              
                              
                              Severity: Minor
                              Found in modules/linagora.esn.oauth.consumer/backend/lib/index.js - About 1 hr to fix

                                Function load has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                function load(req, res, next) {
                                  if (!dbHelper.isValidObjectId(req.params.technicalUserId)) {
                                    return res.status(400).json({
                                      error: {
                                        code: 400,
                                Severity: Minor
                                Found in backend/webserver/middleware/technicaluser.js - About 1 hr to fix

                                  Function emailExists has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  function emailExists(email, ldapConfig, callback) {
                                    if (!email || !ldapConfig) {
                                      return callback(new Error('Missing parameters'));
                                    }
                                  
                                  
                                  Severity: Minor
                                  Found in backend/core/ldap/index.js - About 1 hr to fix

                                    Function _getElasticsearchMustNotQuery has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    function _getElasticsearchMustNotQuery(options) {
                                      const result = {
                                        bool: {
                                          should: [{
                                            terms: {
                                    Severity: Minor
                                    Found in backend/core/user/search.js - About 1 hr to fix

                                      Function fileWatcherInstance has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                        return function fileWatcherInstance() {
                                          if (watchingConfig) {
                                            return false;
                                          }
                                      
                                      
                                      Severity: Minor
                                      Found in backend/core/db/mongo/file-watcher.js - About 1 hr to fix

                                        Function updateShareTargets has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                                function updateShareTargets(target) {
                                                  if (!target) {
                                                    return;
                                                  }
                                        
                                        
                                        Severity: Minor
                                        Found in frontend/js/modules/message.js - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language