linagora/hublin

View on GitHub

Showing 182 of 306 total issues

Function shimAddTrackRemoveTrackWithNative has 64 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    shimAddTrackRemoveTrackWithNative: function(window) {
      // shim addTrack/removeTrack with native variants in order to make
      // the interactions with legacy getLocalStreams behave as in other browsers.
      // Keeps a mapping stream.id => [stream, rtpsenders...]
      window.RTCPeerConnection.prototype.getLocalStreams = function() {
Severity: Major
Found in frontend/js/thirdparty/adapter.js - About 2 hrs to fix

    Function addIceCandidate has 64 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        RTCPeerConnection.prototype.addIceCandidate = function(candidate) {
          var sections;
          if (!candidate || candidate.candidate === '') {
            for (var j = 0; j < this.transceivers.length; j++) {
              if (this.transceivers[j].isDatachannel) {
    Severity: Major
    Found in frontend/js/thirdparty/adapter.js - About 2 hrs to fix

      Function parseRtpEncodingParameters has 64 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        SDPUtils.parseRtpEncodingParameters = function(mediaSection) {
          var encodingParameters = [];
          var description = SDPUtils.parseRtpParameters(mediaSection);
          var hasRed = description.fecMechanisms.indexOf('RED') !== -1;
          var hasUlpfec = description.fecMechanisms.indexOf('ULPFEC') !== -1;
      Severity: Major
      Found in frontend/js/thirdparty/adapter.js - About 2 hrs to fix

        Function _gather has 61 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            RTCPeerConnection.prototype._gather = function(mid, sdpMLineIndex) {
              var pc = this;
              var iceGatherer = this.transceivers[sdpMLineIndex].iceGatherer;
              if (iceGatherer.onlocalcandidate) {
                return;
        Severity: Major
        Found in frontend/js/thirdparty/adapter.js - About 2 hrs to fix

          Function createAnswer has 61 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              RTCPeerConnection.prototype.createAnswer = function() {
                var pc = this;
          
                if (this._isClosed) {
                  return Promise.reject(makeError('InvalidStateError',
          Severity: Major
          Found in frontend/js/thirdparty/adapter.js - About 2 hrs to fix

            Function conferenceUserVideo has 60 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              function conferenceUserVideo($modal, currentConferenceState, matchmedia, LOCAL_VIDEO_ID) {
                return {
                  restrict: 'E',
                  replace: true,
                  templateUrl: '/views/modules/conference/conference-user-video.html',
            Severity: Major
            Found in frontend/js/modules/conference/conference-user-video.directive.js - About 2 hrs to fix

              Function getCommonCapabilities has 60 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                function getCommonCapabilities(localCapabilities, remoteCapabilities) {
                  var commonCapabilities = {
                    codecs: [],
                    headerExtensions: [],
                    fecMechanisms: []
              Severity: Major
              Found in frontend/js/thirdparty/adapter.js - About 2 hrs to fix

                Function shimConstraints_ has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    var shimConstraints_ = function(constraints, func) {
                      if (browserDetails.version >= 61) {
                        return func(constraints);
                      }
                      constraints = JSON.parse(JSON.stringify(constraints));
                Severity: Major
                Found in frontend/js/thirdparty/adapter.js - About 2 hrs to fix

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

                  module.exports = function(grunt) {
                  
                    require('time-grunt')(grunt);
                  
                    grunt.initConfig({
                  Severity: Major
                  Found in Gruntfile-tests.js - About 2 hrs to fix

                    Function RTCPeerConnection has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        var RTCPeerConnection = function(config) {
                          var pc = this;
                    
                          var _eventTarget = document.createDocumentFragment();
                          ['addEventListener', 'removeEventListener', 'dispatchEvent']
                    Severity: Major
                    Found in frontend/js/thirdparty/adapter.js - About 2 hrs to fix

                      Function shimOnTrack has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          shimOnTrack: function(window) {
                            if (typeof window === 'object' && window.RTCPeerConnection && !('ontrack' in
                                window.RTCPeerConnection.prototype)) {
                              Object.defineProperty(window.RTCPeerConnection.prototype, 'ontrack', {
                                get: function() {
                      Severity: Major
                      Found in frontend/js/thirdparty/adapter.js - About 2 hrs to fix

                        Function getUserMedia_ has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            var getUserMedia_ = function(constraints, onSuccess, onError) {
                              var constraintsToFF37_ = function(c) {
                                if (typeof c !== 'object' || c.require) {
                                  return c;
                                }
                        Severity: Major
                        Found in frontend/js/thirdparty/adapter.js - About 2 hrs to fix

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

                          module.exports = function(dependencies) {
                          
                            var wsserver = dependencies('wsserver');
                            var logger = dependencies('logger');
                            var pubsub = dependencies('pubsub');
                          Severity: Major
                          Found in backend/wsserver/notification/conference.js - About 2 hrs to fix

                            Function scaleToCanvas has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              function scaleToCanvas($interval, $window, cropDimensions, drawAvatarIfVideoMuted, drawHelper, currentConferenceState) {
                                var requestAnimationFrame =
                                  $window.requestAnimationFrame ||
                                  $window.mozRequestAnimationFrame ||
                                  $window.msRequestAnimationFrame ||
                            Severity: Major
                            Found in frontend/js/modules/utils/scale-to-canvas.directive.js - About 2 hrs to fix

                              Function 8 has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                },{"./utils":13,"sdp":2}],8:[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 2 hrs to fix

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

                                module.exports = dependencies => {
                                  const logger = dependencies('logger');
                                  const config = require('../../core/esn-config');
                                
                                  return {
                                Severity: Major
                                Found in backend/webserver/denormalizers/conference.js - About 2 hrs to fix

                                  Function shimCallbacksAPI has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

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

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

                                    module.exports = dependencies => {
                                      const logger = dependencies('logger');
                                      const errors = require('../errors')(dependencies);
                                    
                                      /**
                                    Severity: Minor
                                    Found in backend/webserver/middlewares/conference.js - About 2 hrs 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 link has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        function link(scope) {
                                          var modal = $modal({
                                            scope: scope,
                                            animation: 'am-fade-and-scale',
                                            placement: 'center',
                                    Severity: Major
                                    Found in frontend/js/modules/conference/conference-user-video.directive.js - About 2 hrs to fix

                                      Function smartFit has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                        function smartFit($rootScope) {
                                          return {
                                            restrict: 'A',
                                            replace: true,
                                            link: link
                                      Severity: Major
                                      Found in frontend/js/modules/utils/smart-fit.directive.js - About 2 hrs to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language