linagora/hublin

View on GitHub

Showing 306 of 306 total issues

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

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

            conference.get(req.params.id, (err, conf) => {
              if (err) {
                throw new errors.ServerError(err);
              }
        
        
        Severity: Minor
        Found in backend/webserver/middlewares/conference.js and 1 other location - About 45 mins to fix
        backend/webserver/middlewares/conference.js on lines 199..208

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

        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 (typeof window === 'object' && window.RTCPeerConnection &&
                  ('receiver' in window.RTCTrackEvent.prototype) &&
                  // can't check 'transceiver' in window.RTCTrackEvent.prototype, as it is
                  // defined for some reason even when window.RTCTransceiver is not.
                  !window.RTCTransceiver) {
        Severity: Minor
        Found in frontend/js/thirdparty/adapter.js and 1 other location - About 40 mins to fix
        frontend/js/thirdparty/adapter.js on lines 3774..3782

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

        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 (typeof window === 'object' && window.RTCTrackEvent &&
                  ('receiver' in window.RTCTrackEvent.prototype) &&
                  !('transceiver' in window.RTCTrackEvent.prototype)) {
                Object.defineProperty(window.RTCTrackEvent.prototype, 'transceiver', {
                  get: function() {
        Severity: Minor
        Found in frontend/js/thirdparty/adapter.js and 1 other location - About 40 mins to fix
        frontend/js/thirdparty/adapter.js on lines 4401..4411

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

        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

        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

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

                          if (c.audio && !stream.getAudioTracks().length ||
                              c.video && !stream.getVideoTracks().length) {
                            stream.getTracks().forEach(function(track) {
                              track.stop();
                            });
              Severity: Minor
              Found in frontend/js/thirdparty/adapter.js and 1 other location - About 40 mins to fix
              frontend/js/thirdparty/adapter.js on lines 4096..4103

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

              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 (c.audio && !stream.getAudioTracks().length ||
                            c.video && !stream.getVideoTracks().length) {
                          stream.getTracks().forEach(function(track) {
                            track.stop();
                          });
              Severity: Minor
              Found in frontend/js/thirdparty/adapter.js and 1 other location - About 40 mins to fix
              frontend/js/thirdparty/adapter.js on lines 3418..3424

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

              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 userTime has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                function userTime(attendeeColorsService, $interval, currentConferenceState, LOCAL_VIDEO_ID, moment) {
              Severity: Minor
              Found in frontend/js/modules/utils/user-time.directive.js - About 35 mins to fix

                Function sendInvitation has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                function sendInvitation(conference, creator, member, baseUrl, callback) {
                Severity: Minor
                Found in backend/core/conference/index.js - About 35 mins to fix

                  Function updateMemberField has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  function updateMemberField(conference, member, field, value, callback) {
                  Severity: Minor
                  Found in backend/core/conference/index.js - About 35 mins to fix

                    Function drawAvatarIfVideoMuted has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                      function drawAvatarIfVideoMuted(currentConferenceState, attendeeColorsService, getCoordinatesOfCenteredImage, $log, drawHelper) {
                    Severity: Minor
                    Found in frontend/js/modules/utils/draw-utils.js - About 35 mins to fix

                      Function localSpeakEmitter has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                        function localSpeakEmitter($log, $rootScope, currentConferenceState, webRTCService, speakEventEmitterService) {
                      Severity: Minor
                      Found in frontend/js/modules/speak/local-speak-emitter.directive.js - About 35 mins to fix

                        Function localCameraScreenshot has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                          function localCameraScreenshot(LOCAL_VIDEO_ID, DEFAULT_AVATAR_SIZE, currentConferenceState, newCanvas, newImage) {
                        Severity: Minor
                        Found in frontend/js/modules/utils/local-camera-screenshot.service.js - About 35 mins to fix

                          Function testPropsAll has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                            function testPropsAll(prop, prefixed, elem, value, skipValueTest) {
                          Severity: Minor
                          Found in frontend/js/thirdparty/modernizr.js - About 35 mins to fix

                            Function writeMediaSection has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                              function writeMediaSection(transceiver, caps, type, stream, dtlsRole) {
                            Severity: Minor
                            Found in frontend/js/thirdparty/adapter.js - About 35 mins to fix

                              Function inviteMembers has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                function inviteMembers(conf, user, members, baseUrl, callback) {
                              Severity: Minor
                              Found in backend/webserver/controllers/conferences.js - About 35 mins to fix
                                Severity
                                Category
                                Status
                                Source
                                Language