betajs/betajs-media

View on GitHub

Showing 92 of 167 total issues

Function __calculateVideoTrackSettings has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

            __calculateVideoTrackSettings: function(sourceVideoSettings, videoElement, setInitialSettings) {
                videoElement = videoElement || this._video;
                var _lookedWidth, _lookedHeight, _slippedWidth, _slippedHeight, _dimensions;
                var _asR = sourceVideoSettings.aspectRatio || (sourceVideoSettings.width / sourceVideoSettings.height);
                if (!isNaN(_asR)) {
Severity: Minor
Found in src/webrtc/webrtc_recorder.js - About 1 hr to fix

    Function _wsOnMessage has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

                _wsOnMessage: function(evt) {
                    var data = JSON.parse(evt.data);
                    var status = parseInt(data.status, 10);
                    var command = data.command;
                    if (status !== 200) {
    Severity: Minor
    Found in src/webrtc/peer_recorder.js - About 1 hr to fix

      Function elementFileInfo has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              elementFileInfo: function(elementType, elementEvent, elementAttrs, file) {
                  try {
                      var element = document.createElement(elementType);
                      Objs.iter(elementAttrs, function(value, key) {
                          element[key] = value;
      Severity: Minor
      Found in src/video_player/player_support.js - About 1 hr to fix

        Function constructor has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                    constructor: function(options) {
                        inherited.constructor.call(this, options);
                        this._video = options.video;
                        this._localPlaybackRequested = options.localPlaybackRequested;
                        this._recording = false;
        Severity: Minor
        Found in src/webrtc/webrtc_recorder.js - About 1 hr to fix

          Function _googleCastPlayerErrorMessages has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                      _googleCastPlayerErrorMessages: function(error) {
                          switch (error.code) {
                              case chrome.cast.ErrorCode.API_NOT_INITIALIZED:
                                  return 'The API is not initialized.' +
                                      (error.description ? ' :' + error.description : '');
          Severity: Minor
          Found in src/video_player/broadcasting.js - About 1 hr to fix

            Function waveChannelTransform has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    waveChannelTransform: function(dumpedInputBuffer, volume, schedulable, schedulableCtx) {
                        var promise = Promise.create();
                        var volumeFactor = 0x7FFF * (volume || 1);
                        var offset = dumpedInputBuffer.offset;
                        var endOffset = dumpedInputBuffer.endOffset;
            Severity: Minor
            Found in src/encoding/wave_encoder.js - About 1 hr to fix

              Function bindStreamToVideo has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      bindStreamToVideo: function(stream, video, flip) {
                          if (!video)
                              video = document.createElement("video");
                          video.volume = 0;
                          video.muted = true;
              Severity: Minor
              Found in src/webrtc/webrtc_support.js - About 1 hr to fix

                Function createSnapshotFromSource has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        createSnapshotFromSource: function(videoSource, type, time, isUploader, h, w, x, y, quality) {
                            var promise = Promise.create();
                            var video = document.createElement("video");
                            video.src = videoSource;
                
                
                Severity: Minor
                Found in src/video_recorder/recorder_support.js - About 1 hr to fix

                  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

                    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

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