linagora/hublin

View on GitHub

Showing 182 of 306 total issues

Function exports has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

module.exports = function(grunt) {

  grunt.registerMultiTask('splitfiles', 'split the files and run separate targets', function() {
    var options = this.options({
      chunk: 50,
Severity: Minor
Found in tasks/tests.js - About 55 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function invitationDialogController has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

    $scope,
    $log,
    $mdDialog,
    notificationFactory,
    conferenceAPI,
Severity: Major
Found in frontend/js/modules/invitation/invitation-dialog.controller.js - About 50 mins to fix

    Function localSpeakWhileMuted has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

      function localSpeakWhileMuted($log, $rootScope, session, currentConferenceState, speakEventEmitterService, notificationFactory, LOCAL_VIDEO_ID) {
    Severity: Major
    Found in frontend/js/modules/speak/local-speak-while-muted.directive.js - About 50 mins to fix

      Avoid deeply nested control flow statements.
      Open

                  for (aliasIdx = 0; aliasIdx < feature.options.aliases.length; aliasIdx++) {
                    featureNames.push(feature.options.aliases[aliasIdx].toLowerCase());
                  }
      Severity: Major
      Found in frontend/js/thirdparty/modernizr.js - About 45 mins to fix

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

        function getConnectionString(hostname, port, dbname, username, password, connectionOptions) {
        Severity: Minor
        Found in backend/core/db/mongo/index.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                      if (Modernizr[featureNameSplit[0]] && !(Modernizr[featureNameSplit[0]] instanceof Boolean)) {
                        Modernizr[featureNameSplit[0]] = new Boolean(Modernizr[featureNameSplit[0]]);
                      }
          Severity: Major
          Found in frontend/js/thirdparty/modernizr.js - About 45 mins to fix

            Function _createInterface has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

            Pubsub.prototype._createInterface = function(topic) {
              var self = this;
              return {
                subscribe: function(handler) {
                  if (!self.client) {
            Severity: Minor
            Found in backend/core/pubsub/pubsub.js - About 45 mins to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

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

            function validateConnection(hostname, port, dbname, username, password, callback) {
            Severity: Minor
            Found in backend/core/db/mongo/index.js - About 45 mins to fix

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

                function conferenceAttendeeVideo(webRTCService, currentConferenceState, matchmedia, $timeout, drawVideo, LOCAL_VIDEO_ID) {
              Severity: Minor
              Found in frontend/js/modules/conference/conference-attendee-video.directive.js - About 45 mins to fix

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

                  function scaleToCanvas($interval, $window, cropDimensions, drawAvatarIfVideoMuted, drawHelper, currentConferenceState) {
                Severity: Minor
                Found in frontend/js/modules/utils/scale-to-canvas.directive.js - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                  if (!streams[remoteMsid.stream]) {
                                    streams[remoteMsid.stream] = new window.MediaStream();
                                    Object.defineProperty(streams[remoteMsid.stream], 'id', {
                                      get: function() {
                                        return remoteMsid.stream;
                  Severity: Major
                  Found in frontend/js/thirdparty/adapter.js - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                if (this.transceivers[i].mid === candidate.sdpMid) {
                                  sdpMLineIndex = i;
                                  break;
                                }
                    Severity: Major
                    Found in frontend/js/thirdparty/adapter.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                      if (!streams.default) {
                                        streams.default = new window.MediaStream();
                                      }
                      Severity: Major
                      Found in frontend/js/thirdparty/adapter.js - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                      if (!streams[remoteMsid.stream]) {
                                        streams[remoteMsid.stream] = new window.MediaStream();
                                      }
                        Severity: Major
                        Found in frontend/js/thirdparty/adapter.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                        if (!streams.default) {
                                          streams.default = new window.MediaStream();
                                        }
                          Severity: Major
                          Found in frontend/js/thirdparty/adapter.js - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                        if (!maybeAddCandidate(transceiver.iceTransport, cand)) {
                                          return Promise.reject(makeError('OperationError',
                                              'Can not add ICE candidate'));
                                        }
                            Severity: Major
                            Found in frontend/js/thirdparty/adapter.js - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                              if (server.hasOwnProperty('urls')) {
                                                for (var j = 0; j < server.urls.length; j++) {
                                                  var newServer = {
                                                    url: server.urls[j]
                                                  };
                              Severity: Major
                              Found in frontend/js/thirdparty/adapter.js - About 45 mins to fix

                                Consider simplifying this complex logical expression.
                                Open

                                      } else if (typeof window === 'object' && window.RTCPeerConnection &&
                                                 'getSenders' in window.RTCPeerConnection.prototype &&
                                                 'createDTMFSender' in window.RTCPeerConnection.prototype &&
                                                 window.RTCRtpSender &&
                                                 !('dtmf' in window.RTCRtpSender.prototype)) {
                                Severity: Major
                                Found in frontend/js/thirdparty/adapter.js - About 40 mins to fix

                                  Consider simplifying this complex logical expression.
                                  Open

                                        if (typeof window === 'object' && window.RTCPeerConnection &&
                                            !('getSenders' in window.RTCPeerConnection.prototype) &&
                                            'createDTMFSender' in window.RTCPeerConnection.prototype) {
                                          var shimSenderWithDtmf = function(pc, track) {
                                            return {
                                  Severity: Major
                                  Found in frontend/js/thirdparty/adapter.js - About 40 mins to fix

                                    Consider simplifying this complex logical expression.
                                    Open

                                            if ((description.type === 'offer' || description.type === 'answer') &&
                                                !rejected && usingBundle && sdpMLineIndex > 0 &&
                                                pc.transceivers[sdpMLineIndex]) {
                                              pc._disposeIceAndDtlsTransports(sdpMLineIndex);
                                              pc.transceivers[sdpMLineIndex].iceGatherer =
                                    Severity: Major
                                    Found in frontend/js/thirdparty/adapter.js - About 40 mins to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language