betajs/betajs-media

View on GitHub

Showing 167 of 167 total issues

Avoid deeply nested control flow statements.
Open

                            if (lkey.indexOf(c) >= 0) {
                                var flt = lkey.indexOf("aspect") > 0;
                                var d = lkey.indexOf("min") === 0 ? -1 : 1;
                                var u = Math.max(0, mandatory[key] * (1.0 + d / 10));
                                mandatory[key] = flt ? u : Math.round(u);
Severity: Major
Found in src/webrtc/webrtc_support.js - About 45 mins to fix

    Function updateSnapshotDisplay has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

                updateSnapshotDisplay: function(snapshot, display, x, y, w, h) {},
    Severity: Minor
    Found in src/video_recorder/video_recorder.js - About 45 mins to fix

      Function createSnapshotDisplay has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

                  createSnapshotDisplay: function(parent, snapshot, x, y, w, h) {
      Severity: Minor
      Found in src/video_recorder/video_recorder.js - About 45 mins to fix

        Function updateSnapshotDisplay has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                    updateSnapshotDisplay: function(snapshot, image, x, y, w, h) {
        Severity: Minor
        Found in src/video_recorder/video_recorder.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                          if (navigator.getDisplayMedia) {
                              promise = Promise.create();
                              var pr = navigator.getDisplayMedia({
                                  video: true
                              });
          Severity: Major
          Found in src/webrtc/webrtc_support.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                            if (Info.isSafari()) {
                                if (options.video.sourceId) {
                                    opts.video.sourceId = options.video.sourceId;
                                    opts.video.deviceId = {
                                        exact: options.video.sourceId
            Severity: Major
            Found in src/webrtc/webrtc_support.js - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                              if (this.__multiStreamVideoSettings.mainStream) {
                                                  if (Objs.keys(this.__multiStreamVideoSettings.mainStream).length > 0) {
                                                      this.__recorderStreamCtx.fillStyle = "#000000";
                                                      this.__recorderStreamCtx.fillRect(0, 0, this.__recorderStreamCanvas.width, this.__recorderStreamCanvas.height);
                                                      this.__recorderStreamCtx.restore();
              Severity: Major
              Found in src/webrtc/webrtc_recorder.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                                if (isVideo)
                                                    this._currentVideo = index;
                                                else
                                                    this._currentAudio = index;
                Severity: Major
                Found in src/video_recorder/video_recorder.js - About 45 mins to fix

                  Function createSnapshotDisplay has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                              createSnapshotDisplay: function(parent, snapshot, x, y, w, h) {
                  Severity: Minor
                  Found in src/image_recorder/image_recorder.js - About 45 mins to fix

                    Function updateSnapshotDisplay has 6 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                                updateSnapshotDisplay: function(snapshot, image, x, y, w, h) {
                    Severity: Minor
                    Found in src/image_recorder/image_recorder.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                                  if (('opus'.localeCompare(match) === 0) || ('isac'.localeCompare(match) === 0) || ('g722'.localeCompare(match) === 0) || ('pcmu'.localeCompare(match) === 0) ||
                                                      ('pcma'.localeCompare(match) === 0) || ('cn'.localeCompare(match) === 0)) {
                                                      if (enhanceData.audioBitrate !== undefined) {
                                                          sdpStrRet += 'a=fmtp:' + rtpmapID[1] + ' x-google-min-bitrate=' + (enhanceData.audioBitrate) + ';x-google-max-bitrate=' + (enhanceData.audioBitrate) + '\r\n';
                                                      }
                      Severity: Major
                      Found in src/webrtc/peer_recorder.js - About 45 mins to fix

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

                                        for (var i = 0; i < sourceEls.length; ++i) {
                                            this._domEvents.on(sourceEls[i], "error", cb, this);
                                        }
                        Severity: Minor
                        Found in src/audio_player/audio_player.js and 1 other location - About 40 mins to fix
                        src/video_player/video_player.js on lines 444..446

                        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

                                        for (var i = 0; i < sourceEls.length; ++i) {
                                            this._domEvents.on(sourceEls[i], "error", cb, this);
                                        }
                        Severity: Minor
                        Found in src/video_player/video_player.js and 1 other location - About 40 mins to fix
                        src/audio_player/audio_player.js on lines 316..318

                        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

                                                    if (('opus'.localeCompare(match) === 0) || ('isac'.localeCompare(match) === 0) || ('g722'.localeCompare(match) === 0) || ('pcmu'.localeCompare(match) === 0) ||
                                                        ('pcma'.localeCompare(match) === 0) || ('cn'.localeCompare(match) === 0)) {
                                                        if (enhanceData.audioBitrate !== undefined) {
                                                            sdpStrRet += 'a=fmtp:' + rtpmapID[1] + ' x-google-min-bitrate=' + (enhanceData.audioBitrate) + ';x-google-max-bitrate=' + (enhanceData.audioBitrate) + '\r\n';
                                                        }
                        Severity: Major
                        Found in src/webrtc/peer_recorder.js - About 40 mins to fix

                          Consider simplifying this complex logical expression.
                          Open

                                          if (
                                              (Info.isChrome() || Info.isFirefox() || Info.isOpera() ||
                                                  (Info.isSafari() && Support.globals().MediaRecorder)
                                              ) && typeof navigator.mediaDevices.getDisplayMedia !== 'undefined'
                                          )
                          Severity: Major
                          Found in src/video_recorder/video_recorder.js - About 40 mins to fix

                            Consider simplifying this complex logical expression.
                            Open

                                                        if (('vp9'.localeCompare(match) === 0) || ('vp8'.localeCompare(match) === 0) || ('h264'.localeCompare(match) === 0) ||
                                                            ('red'.localeCompare(match) === 0) || ('ulpfec'.localeCompare(match) === 0) || ('rtx'.localeCompare(match) === 0)) {
                                                            if (enhanceData.videoBitrate !== undefined) {
                                                                sdpStrRet += 'a=fmtp:' + rtpmapID[1] + ' x-google-min-bitrate=' + (enhanceData.videoBitrate) + ';x-google-max-bitrate=' + (enhanceData.videoBitrate) + '\r\n';
                                                            }
                            Severity: Major
                            Found in src/webrtc/peer_recorder.js - About 40 mins to fix

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

                                              if (Support.globals().supportedConstraints.mediaSource && Info.isFirefox() && Info.firefoxVersion() > 55)
                                                  return true;
                              Severity: Minor
                              Found in src/image_recorder/image_recorder.js and 1 other location - About 40 mins to fix
                              src/video_recorder/video_recorder.js on lines 542..543

                              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 (Support.globals().supportedConstraints.mediaSource && Info.isFirefox() && Info.firefoxVersion() > 55)
                                                  return true;
                              Severity: Minor
                              Found in src/video_recorder/video_recorder.js and 1 other location - About 40 mins to fix
                              src/image_recorder/image_recorder.js on lines 242..243

                              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

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

                                              if (parseInt(options.video.height, 10) > 0) {
                                                  videoOptions.height = parseInt(options.video.height, 10);
                                              }
                              Severity: Minor
                              Found in src/webrtc/webrtc_support.js and 1 other location - About 40 mins to fix
                              src/webrtc/webrtc_support.js on lines 229..231

                              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

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

                                              if (parseInt(options.video.width, 10) > 0) {
                                                  videoOptions.width = parseInt(options.video.width, 10);
                                              }
                              Severity: Minor
                              Found in src/webrtc/webrtc_support.js and 1 other location - About 40 mins to fix
                              src/webrtc/webrtc_support.js on lines 232..234

                              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

                              Severity
                              Category
                              Status
                              Source
                              Language