linagora/hublin

View on GitHub

Showing 182 of 306 total issues

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

module.exports = function(dependencies) {

  var logger = dependencies('logger');
  var errors = require('../errors')(dependencies);

Severity: Minor
Found in backend/webserver/middlewares/user.js - About 1 hr 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 webRTCService has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function webRTCService($log, webRTCAdapterRegistry, WEBRTC_CONNECTOR) {
    var adapter = webRTCAdapterRegistry.get(WEBRTC_CONNECTOR);

    if (!adapter) {
      $log.warn(WEBRTC_CONNECTOR, 'webrtc connector has not been found, things will not work as expected');
Severity: Minor
Found in frontend/js/modules/webrtc/webrtc.service.js - About 1 hr to fix

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

            window.RTCPeerConnection.prototype.setRemoteDescription = function() {
              var pc = this;
              if (!pc._ontrackpoly) {
                pc._ontrackpoly = function(e) {
                  // onaddstream does not fire when a track is added to an existing
    Severity: Minor
    Found in frontend/js/thirdparty/adapter.js - About 1 hr to fix

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

        function conferenceUserControlBar($log, webRTCService) {
          return {
            restrict: 'E',
            replace: true,
            templateUrl: '/views/modules/conference/conference-user-control-bar.html',

        Function AutoVideoSwitcher has 38 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          function AutoVideoSwitcher($rootScope, $timeout, AUTO_VIDEO_SWITCH_TIMEOUT, LOCAL_VIDEO_ID) {
        
            function AutoVideoSwitcher(conferenceState) {
              this.conferenceState = conferenceState;
              this.timeouts = {};
        Severity: Minor
        Found in frontend/js/modules/utils/auto-video-switcher.service.js - About 1 hr to fix

          Function writeMediaSection has 38 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            function writeMediaSection(transceiver, caps, type, stream, dtlsRole) {
              var sdp = SDPUtils.writeRtpDescription(transceiver.kind, caps);
          
              // Map ICE parameters (ufrag, pwd) to SDP.
              sdp += SDPUtils.writeIceParameters(
          Severity: Minor
          Found in frontend/js/thirdparty/adapter.js - About 1 hr to fix

            Function ioInterface has 38 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function ioInterface(callback) {
            
                  var ioAction = new IoAction();
                  var terminate = {
                    emit: emit,
            Severity: Minor
            Found in frontend/js/modules/websocket/services.js - About 1 hr to fix

              Function userTime has 36 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                function userTime(attendeeColorsService, $interval, currentConferenceState, LOCAL_VIDEO_ID, moment) {
                  return {
                    restrict: 'A',
                    link: link
                  };
              Severity: Minor
              Found in frontend/js/modules/utils/user-time.directive.js - About 1 hr to fix

                Function parseCandidate has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  SDPUtils.parseCandidate = function(line) {
                    var parts;
                    // Parse both variants.
                    if (line.indexOf('a=candidate:') === 0) {
                      parts = line.substring(12).split(' ');
                Severity: Minor
                Found in frontend/js/thirdparty/adapter.js - About 1 hr to fix

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

                          link: function(scope) {
                            function buildUrl(room) {
                              return URI('/')
                                .query('')
                                .fragment('')
                  Severity: Minor
                  Found in frontend/js/modules/conference/conference.js - About 1 hr to fix

                    Function testRunner has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      function testRunner() {
                        var featureNames;
                        var feature;
                        var aliasIdx;
                        var result;
                    Severity: Minor
                    Found in frontend/js/thirdparty/modernizr.js - About 1 hr to fix

                      Function shimSourceObject has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          shimSourceObject: function(window) {
                            var URL = window && window.URL;
                      
                            if (typeof window === 'object') {
                              if (window.HTMLMediaElement &&
                      Severity: Minor
                      Found in frontend/js/thirdparty/adapter.js - About 1 hr to fix

                        Function _transceive has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            RTCPeerConnection.prototype._transceive = function(transceiver,
                                send, recv) {
                              var params = getCommonCapabilities(transceiver.localCapabilities,
                                  transceiver.remoteCapabilities);
                              if (send && transceiver.rtpSender) {
                        Severity: Minor
                        Found in frontend/js/thirdparty/adapter.js - About 1 hr to fix

                          Function conferenceMobileVideo has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            function conferenceMobileVideo($timeout, $window, $rootScope, drawVideo, currentConferenceState) {
                              return {
                                restrict: 'E',
                                replace: true,
                                templateUrl: '/views/modules/conference/conference-mobile-video.html',
                          Severity: Minor
                          Found in frontend/js/modules/conference/conference-mobile-video.directive.js - About 1 hr to fix

                            Function parseRtpParameters has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              SDPUtils.parseRtpParameters = function(mediaSection) {
                                var description = {
                                  codecs: [],
                                  headerExtensions: [],
                                  fecMechanisms: [],
                            Severity: Minor
                            Found in frontend/js/thirdparty/adapter.js - About 1 hr to fix

                              Function shimCreateOfferLegacy has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  shimCreateOfferLegacy: function(window) {
                                    var origCreateOffer = window.RTCPeerConnection.prototype.createOffer;
                                    window.RTCPeerConnection.prototype.createOffer = function(offerOptions) {
                                      var pc = this;
                                      if (offerOptions) {
                              Severity: Minor
                              Found in frontend/js/thirdparty/adapter.js - About 1 hr to fix

                                Function shimRemoteStreamsAPI has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    shimRemoteStreamsAPI: function(window) {
                                      if (typeof window !== 'object' || !window.RTCPeerConnection) {
                                        return;
                                      }
                                      if (!('getRemoteStreams' in window.RTCPeerConnection.prototype)) {
                                Severity: Minor
                                Found in frontend/js/thirdparty/adapter.js - About 1 hr to fix

                                  Function liveConference has 11 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                      $log,
                                      $timeout,
                                      $interval,
                                      session,
                                      conferenceAPI,
                                  Severity: Major
                                  Found in frontend/js/modules/live-conference/live-conference.directive.js - About 1 hr to fix

                                    Function addHistory has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    function addHistory(conference, user, status, callback) {
                                      if (!user) {
                                        return callback(new Error('Undefined user'));
                                      }
                                    
                                    
                                    Severity: Minor
                                    Found in backend/core/conference/index.js - About 1 hr to fix

                                      Function fileWatcher has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      function fileWatcher(logger, file, onChange) {
                                        var watchingConfig = false;
                                        var lastHash = null;
                                      
                                        return function fileWatcherInstance() {
                                      Severity: Minor
                                      Found in backend/core/db/mongo/file-watcher.js - About 1 hr to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language