linagora/hublin

View on GitHub

Showing 306 of 306 total issues

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

  module.exports = function(dependencies, opts) {
    var window = dependencies && dependencies.window;

    var options = {
      shimChrome: true,
Severity: Major
Found in frontend/js/thirdparty/adapter.js - About 3 hrs to fix

    Function shimGetSendersWithDtmf has 94 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        shimGetSendersWithDtmf: function(window) {
          // Overrides addTrack/removeTrack, depends on shimAddTrackRemoveTrack.
          if (typeof window === 'object' && window.RTCPeerConnection &&
              !('getSenders' in window.RTCPeerConnection.prototype) &&
              'createDTMFSender' in window.RTCPeerConnection.prototype) {
    Severity: Major
    Found in frontend/js/thirdparty/adapter.js - About 3 hrs to fix

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

      'use strict';
      
      var fs = require('fs-extra');
      var path = require('path');
      var conf_path = './test/config/';
      Severity: Minor
      Found in Gruntfile.js - About 3 hrs to fix

        Function 13 has 88 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          },{"../utils":13}],13:[function(require,module,exports){
          /*
           *  Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
           *
           *  Use of this source code is governed by a BSD-style license
        Severity: Major
        Found in frontend/js/thirdparty/adapter.js - About 3 hrs to fix

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

                    if (offerOptions.offerToReceiveAudio === false && audioTransceiver) {
                      if (audioTransceiver.direction === 'sendrecv') {
                        audioTransceiver.setDirection('sendonly');
                      } else if (audioTransceiver.direction === 'recvonly') {
                        audioTransceiver.setDirection('inactive');
          Severity: Major
          Found in frontend/js/thirdparty/adapter.js and 1 other location - About 3 hrs to fix
          frontend/js/thirdparty/adapter.js on lines 4438..4447

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 105.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

                    if (offerOptions.offerToReceiveVideo === false && videoTransceiver) {
                      if (videoTransceiver.direction === 'sendrecv') {
                        videoTransceiver.setDirection('sendonly');
                      } else if (videoTransceiver.direction === 'recvonly') {
                        videoTransceiver.setDirection('inactive');
          Severity: Major
          Found in frontend/js/thirdparty/adapter.js and 1 other location - About 3 hrs to fix
          frontend/js/thirdparty/adapter.js on lines 4423..4432

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 105.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Function liveConference has 80 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            function liveConference(
              $log,
              $timeout,
              $interval,
              session,
          Severity: Major
          Found in frontend/js/modules/live-conference/live-conference.directive.js - About 3 hrs to fix

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                  prototype.createAnswer = function(successCallback, failureCallback) {
                    var options = (arguments.length >= 2) ? arguments[2] : arguments[0];
                    var promise = createAnswer.apply(this, [options]);
                    if (!failureCallback) {
                      return promise;
            Severity: Major
            Found in frontend/js/thirdparty/adapter.js and 1 other location - About 3 hrs to fix
            frontend/js/thirdparty/adapter.js on lines 4301..4309

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 99.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                  prototype.createOffer = function(successCallback, failureCallback) {
                    var options = (arguments.length >= 2) ? arguments[2] : arguments[0];
                    var promise = createOffer.apply(this, [options]);
                    if (!failureCallback) {
                      return promise;
            Severity: Major
            Found in frontend/js/thirdparty/adapter.js and 1 other location - About 3 hrs to fix
            frontend/js/thirdparty/adapter.js on lines 4311..4319

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 99.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Function conferenceVideo has 77 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              function conferenceVideo($timeout, $window, $rootScope, drawVideo, currentConferenceState, LOCAL_VIDEO_ID, DEFAULT_AVATAR_SIZE, $state) {
                return {
                  restrict: 'E',
                  replace: true,
                  templateUrl: '/views/modules/conference/conference-video.html',
            Severity: Major
            Found in frontend/js/modules/conference/conference-video.directive.js - About 3 hrs to fix

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

              module.exports = function(dependencies) {
              
                var logger = dependencies('logger');
                var errors = require('../errors')(dependencies);
              
              
              Severity: Major
              Found in backend/webserver/middlewares/user.js - About 3 hrs to fix

                Function setLocalDescription has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    RTCPeerConnection.prototype.setLocalDescription = function(description) {
                      var pc = this;
                
                      if (!isActionAllowedInSignalingState('setLocalDescription',
                          description.type, this.signalingState) || this._isClosed) {
                Severity: Major
                Found in frontend/js/thirdparty/adapter.js - About 3 hrs to fix

                  Function shimLocalStreamsAPI has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      shimLocalStreamsAPI: function(window) {
                        if (typeof window !== 'object' || !window.RTCPeerConnection) {
                          return;
                        }
                        if (!('getLocalStreams' in window.RTCPeerConnection.prototype)) {
                  Severity: Major
                  Found in frontend/js/thirdparty/adapter.js - About 3 hrs to fix

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

                        function controller($scope) {
                          $scope.conference = session.conference;
                          $scope.conferenceState = currentConferenceState;
                          $scope.conferenceId = $scope.conference._id;
                          $scope.reportedAttendee = null;
                    Severity: Major
                    Found in frontend/js/modules/live-conference/live-conference.directive.js - About 2 hrs to fix

                      Similar blocks of code found in 2 locations. Consider refactoring.
                      Open

                          denormalizer.denormalize(req.conference.toObject())
                            .then(denormalized => res.status(200).json(denormalized))
                            .catch(err => {
                              logger.error(err);
                              res.status(500).send('Failed to denormalize conference');
                      Severity: Major
                      Found in backend/webserver/controllers/conferences.js and 1 other location - About 2 hrs to fix
                      backend/webserver/controllers/conferences.js on lines 59..64

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 94.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 2 locations. Consider refactoring.
                      Open

                            denormalizer.denormalize(req.conference.toObject())
                              .then(conference => res.status(202).json(conference))
                              .catch(err => {
                                logger.error(err);
                                res.status(500).send('Failed to denormalize conference');
                      Severity: Major
                      Found in backend/webserver/controllers/conferences.js and 1 other location - About 2 hrs to fix
                      backend/webserver/controllers/conferences.js on lines 118..123

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 94.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

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

                      module.exports = function(dependencies) {
                      
                        var logger = dependencies('logger'),
                            errors = require('../errors')(dependencies),
                            config = dependencies('config')('default');
                      Severity: Major
                      Found in backend/webserver/controllers/home.js - About 2 hrs to fix

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

                            function link(scope, element) {
                              var canvas = {};
                              var context = {};
                              var mainVideo = {};
                              var currentVideoId = LOCAL_VIDEO_ID;
                        Severity: Major
                        Found in frontend/js/modules/conference/conference-video.directive.js - About 2 hrs to fix

                          Similar blocks of code found in 3 locations. Consider refactoring.
                          Open

                            function canAddMember(req, res, next) {
                              ensureUserAndConference(req);
                          
                              conference.userIsConferenceMember(req.conference, req.user, (err, isMember) => {
                                if (err) {
                          Severity: Major
                          Found in backend/webserver/middlewares/conference.js and 2 other locations - About 2 hrs to fix
                          backend/webserver/middlewares/conference.js on lines 82..96
                          backend/webserver/middlewares/conference.js on lines 98..112

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 90.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          Similar blocks of code found in 3 locations. Consider refactoring.
                          Open

                            function isAdmin(req, res, next) {
                              ensureUserAndConference(req);
                          
                              conference.userIsConferenceCreator(req.conference, req.user, (err, status) => {
                                if (err) {
                          Severity: Major
                          Found in backend/webserver/middlewares/conference.js and 2 other locations - About 2 hrs to fix
                          backend/webserver/middlewares/conference.js on lines 82..96
                          backend/webserver/middlewares/conference.js on lines 114..128

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 90.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          Severity
                          Category
                          Status
                          Source
                          Language