linagora/hublin

View on GitHub

Showing 306 of 306 total issues

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

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

                stream.getTracks().forEach(function(track) {
                  var alreadyExists = pc.getSenders().find(function(s) {
                    return s.track === track;
                  });
                  if (alreadyExists) {
        Severity: Major
        Found in frontend/js/thirdparty/adapter.js and 1 other location - About 2 hrs to fix
        frontend/js/thirdparty/adapter.js on lines 2799..2807

        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 77.

        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

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

                stream.getTracks().forEach(function(track) {
                  var alreadyExists = pc.getSenders().find(function(s) {
                    return s.track === track;
                  });
                  if (alreadyExists) {
        Severity: Major
        Found in frontend/js/thirdparty/adapter.js and 1 other location - About 2 hrs to fix
        frontend/js/thirdparty/adapter.js on lines 2729..2737

        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 77.

        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 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

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

                    if (offerOptions.offerToReceiveVideo !== undefined) {
                      if (offerOptions.offerToReceiveVideo === true) {
                        numVideoTracks = 1;
                      } else if (offerOptions.offerToReceiveVideo === false) {
                        numVideoTracks = 0;
            Severity: Major
            Found in frontend/js/thirdparty/adapter.js and 1 other location - About 2 hrs to fix
            frontend/js/thirdparty/adapter.js on lines 1273..1281

            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 75.

            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

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

                if (transceiver.rtpSender && transceiver.rtpReceiver) {
                  sdp += 'a=sendrecv\r\n';
                } else if (transceiver.rtpSender) {
                  sdp += 'a=sendonly\r\n';
                } else if (transceiver.rtpReceiver) {
            Severity: Major
            Found in frontend/js/thirdparty/adapter.js and 1 other location - About 2 hrs to fix
            frontend/js/thirdparty/adapter.js on lines 2222..2230

            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 75.

            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.offerToReceiveAudio !== undefined) {
                      if (offerOptions.offerToReceiveAudio === true) {
                        numAudioTracks = 1;
                      } else if (offerOptions.offerToReceiveAudio === false) {
                        numAudioTracks = 0;
            Severity: Major
            Found in frontend/js/thirdparty/adapter.js and 1 other location - About 2 hrs to fix
            frontend/js/thirdparty/adapter.js on lines 1282..1290

            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 75.

            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

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

                } else if (transceiver.rtpSender && transceiver.rtpReceiver) {
                  sdp += 'a=sendrecv\r\n';
                } else if (transceiver.rtpSender) {
                  sdp += 'a=sendonly\r\n';
                } else if (transceiver.rtpReceiver) {
            Severity: Major
            Found in frontend/js/thirdparty/adapter.js and 1 other location - About 2 hrs to fix
            frontend/js/thirdparty/adapter.js on lines 28..36

            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 75.

            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 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

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

                    RTCPeerConnection.prototype.getReceivers = function() {
                      return this.transceivers.filter(function(transceiver) {
                        return !!transceiver.rtpReceiver;
                      })
                      .map(function(transceiver) {
                Severity: Major
                Found in frontend/js/thirdparty/adapter.js and 1 other location - About 1 hr to fix
                frontend/js/thirdparty/adapter.js on lines 508..515

                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 73.

                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

                    RTCPeerConnection.prototype.getSenders = function() {
                      return this.transceivers.filter(function(transceiver) {
                        return !!transceiver.rtpSender;
                      })
                      .map(function(transceiver) {
                Severity: Major
                Found in frontend/js/thirdparty/adapter.js and 1 other location - About 1 hr to fix
                frontend/js/thirdparty/adapter.js on lines 517..524

                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 73.

                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

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

                        conferenceAPI.get($scope.conferenceId).then(function(response) {
                          $scope.conferenceState.conference = response.data;
                        }, function(err) {
                          $log.error('Cannot get conference', $scope.conferenceId, err);
                        });
                frontend/js/modules/live-conference/live-conference.directive.js on lines 62..66

                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 72.

                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

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

                        conferenceAPI.get($scope.conferenceId).then(function(response) {
                          $scope.conferenceState.conference = response.data;
                        }, function(err) {
                          $log.error('Cannot get conference', $scope.conferenceId, err);
                        });
                frontend/js/modules/live-conference/live-conference.directive.js on lines 81..85

                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 72.

                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 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
                    Severity
                    Category
                    Status
                    Source
                    Language