linagora/hublin

View on GitHub

Showing 182 of 306 total issues

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

      link: function($scope, element) {

        $scope.element = element;
        $scope.MAX_REPORT_DESCRIPTION_LENGTH = MAX_REPORT_DESCRIPTION_LENGTH.toString();
        $scope.alertDisplayed = null;
Severity: Minor
Found in frontend/js/modules/report/report.js - About 1 hr to fix

    Function constraintsToChrome_ has 48 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        var constraintsToChrome_ = function(c) {
          if (typeof c !== 'object' || c.mandatory || c.optional) {
            return c;
          }
          var cc = {};
    Severity: Minor
    Found in frontend/js/thirdparty/adapter.js - About 1 hr to fix

      Function getStats has 46 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

            window.RTCPeerConnection.prototype.getStats = function(selector,
                successCallback, errorCallback) {
              var pc = this;
              var args = arguments;
      
      
      Severity: Minor
      Found in frontend/js/thirdparty/adapter.js - About 1 hr to fix

        Function testProps has 45 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          function testProps(props, prefixed, value, skipValueTest) {
            skipValueTest = is(skipValueTest, 'undefined') ? false : skipValueTest;
        
            // Try native detect first
            if (!is(value, 'undefined')) {
        Severity: Minor
        Found in frontend/js/thirdparty/modernizr.js - About 1 hr to fix

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

              function link(scope, element, attrs) {
                var unregisterRootScopeListener,
                    source = angular.element(attrs.from),
                    toPreserve = angular.element(attrs.preserve);
          
          
          Severity: Minor
          Found in frontend/js/modules/utils/smart-fit.directive.js - About 1 hr to fix

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

                function link(scope, element) {
                  var widgets = [];
                  var toggleAnim = false;
                  var stopScaling = false;
            
            
            Severity: Minor
            Found in frontend/js/modules/utils/scale-to-canvas.directive.js - About 1 hr to fix

              Function wrapPeerConnectionEvent has 44 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                function wrapPeerConnectionEvent(window, eventNameToWrap, wrapper) {
                  if (!window.RTCPeerConnection) {
                    return;
                  }
                  var proto = window.RTCPeerConnection.prototype;
              Severity: Minor
              Found in frontend/js/thirdparty/adapter.js - About 1 hr to fix

                Function onlocalcandidate has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                      iceGatherer.onlocalcandidate = function(evt) {
                        if (pc.usingBundle && sdpMLineIndex > 0) {
                          // if we know that we use bundle we can drop candidates with
                          // Ñ•dpMLineIndex > 0. If we don't do this then our state gets
                          // confused since we dispose the extra ice gatherer.
                Severity: Minor
                Found in frontend/js/thirdparty/adapter.js - About 1 hr to fix

                  Function detectBrowser has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      detectBrowser: function(window) {
                        var navigator = window && window.navigator;
                  
                        // Returned result object.
                        var result = {};
                  Severity: Minor
                  Found in frontend/js/thirdparty/adapter.js - About 1 hr to fix

                    Function shimCreateObjectURL has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

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

                      Consider simplifying this complex logical expression.
                      Open

                            if (server && (server.urls || server.url)) {
                              var urls = server.urls || server.url;
                              if (server.url && !server.urls) {
                                console.warn('RTCIceServer.url is deprecated! Use urls instead.');
                              }
                      Severity: Critical
                      Found in frontend/js/thirdparty/adapter.js - About 1 hr to fix

                        Function injectElementWithStyles has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          function injectElementWithStyles(rule, callback, nodes, testnames) {
                            var mod = 'modernizr';
                            var style;
                            var ret;
                            var node;
                        Severity: Minor
                        Found in frontend/js/thirdparty/modernizr.js - About 1 hr to fix

                          Function init has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            function init(io) {
                              if (initialized) {
                                logger.warn('The notification conferences service is already initialized');
                                return;
                              }
                          Severity: Minor
                          Found in backend/wsserver/notification/conference.js - About 1 hr to fix

                            Function shimPeerConnection has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                shimPeerConnection: function(window) {
                                  var browserDetails = utils.detectBrowser(window);
                            
                                  if (window.RTCIceGatherer) {
                                    // ORTC defines an RTCIceCandidate object but no constructor.
                            Severity: Minor
                            Found in frontend/js/thirdparty/adapter.js - About 1 hr to fix

                              Function constraintsToFF37_ has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                    var constraintsToFF37_ = function(c) {
                                      if (typeof c !== 'object' || c.require) {
                                        return c;
                                      }
                                      var require = [];
                              Severity: Minor
                              Found in frontend/js/thirdparty/adapter.js - About 1 hr to fix

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

                                  SDPUtils.writeMediaSection = function(transceiver, caps, type, stream) {
                                    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 exports has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  module.exports = function(dependencies) {
                                    'use strict';
                                  
                                    var logger = dependencies('logger');
                                  
                                  
                                  Severity: Minor
                                  Found in backend/webserver/errors.js - About 1 hr to fix

                                    Function addTrack has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                          window.RTCPeerConnection.prototype.addTrack = function(track, stream) {
                                            var pc = this;
                                            if (pc.signalingState === 'closed') {
                                              throw new DOMException(
                                                'The RTCPeerConnection\'s signalingState is \'closed\'.',
                                    Severity: Minor
                                    Found in frontend/js/thirdparty/adapter.js - About 1 hr to fix

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

                                      module.exports = function(dependencies) {
                                      
                                        var logger = dependencies('logger'),
                                            errors = require('../errors')(dependencies),
                                            config = dependencies('config')('default');
                                      Severity: Minor
                                      Found in backend/webserver/controllers/home.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 fileWatcher has a Cognitive Complexity of 13 (exceeds 5 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

                                      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

                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language