betajs/betajs-media

View on GitHub

Showing 167 of 167 total issues

Function createSnapshot has 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

        createSnapshot: function(type, video, isUploader, h, w, x, y, quality) {
Severity: Major
Found in src/video_recorder/recorder_support.js - About 1 hr to fix

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

                        var y = Maths.randomInt(area[1][0] * h, Math.min(area[1][1] * h, h - 1));
    Severity: Minor
    Found in src/common/video.js and 1 other location - About 55 mins to fix
    src/common/video.js on lines 46..46

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

    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

                        var x = Maths.randomInt(area[0][0] * w, Math.min(area[0][1] * w, w - 1));
    Severity: Minor
    Found in src/common/video.js and 1 other location - About 55 mins to fix
    src/common/video.js on lines 47..47

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

    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 (Types.is_string(sources))
                        sources = sources.split(" ");
                    else if (!Types.is_array(sources))
                        sources = [sources];
    Severity: Minor
    Found in src/video_player/video_player.js and 1 other location - About 50 mins to fix
    src/audio_player/audio_player.js on lines 19..22

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

    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 (Types.is_string(sources))
                        sources = sources.split(" ");
                    else if (!Types.is_array(sources))
                        sources = [sources];
    Severity: Minor
    Found in src/audio_player/audio_player.js and 1 other location - About 50 mins to fix
    src/video_player/video_player.js on lines 20..23

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

    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

    Avoid deeply nested control flow statements.
    Open

                            if (e.name !== "ConstraintNotSatisfiedError" && e.name !== "OverconstrainedError")
                                return e;
    Severity: Major
    Found in src/webrtc/webrtc_support.js - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                          if (options.video.width)
                              options.video.height = Math.round(options.video.width / options.video.aspectRatio);
                          else if (options.video.height)
                              options.video.width = Math.round(options.video.height * options.video.aspectRatio);
      Severity: Major
      Found in src/webrtc/webrtc_support.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

          Avoid deeply nested control flow statements.
          Open

                          if (options.screen) {
                              var extensionId = this.chromeExtensionExtract(options.screen).extensionId;
                              if (!extensionId)
                                  return Promise.error("This browser does not support screen recording.");
                              var pingTest = Time.now();
          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/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

                Avoid deeply nested control flow statements.
                Open

                                                if (typeof this._videoTrackSettings.videoInnerFrame === 'undefined')
                                                    this._videoTrackSettings = Objs.extend(sourceVideoSettings, this._videoTrackSettings);
                Severity: Major
                Found in src/webrtc/webrtc_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

                    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 (typeof opts.video.mandatory !== 'undefined') {
                                          if (options.video.width) {
                                              opts.video.mandatory.minWidth = options.video.width;
                                              opts.video.mandatory.maxWidth = options.video.width;
                                          }
                      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, 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 (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

                              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/recorder_support.js - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                    if (!navigator.mediaDevices || !navigator.mediaDevices.getSupportedConstraints || !navigator.mediaDevices.getSupportedConstraints().mediaSource)
                                                        return Promise.error("This browser does not support screen recording.");
                                Severity: Major
                                Found in src/webrtc/webrtc_support.js - About 45 mins to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language