betajs/betajs-media

View on GitHub

Showing 167 of 167 total issues

Function __compile has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

            __compile: function(frames) {
                var totalDuration = 0;
                var width = null;
                var height = null;
                var clusters = [];
Severity: Minor
Found in src/webrtc/whammy_recorder.js - About 1 hr to fix

    Function addNewSingleStream has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

                addNewSingleStream: function(device, options) {
                    this._initCanvasStreamSettings();
                    var _options, _positionX, _positionY, _height, _width, _aspectRatio, _constraints;
                    var _isTrueHeight = true;
                    _aspectRatio = this._options.video.aspectRatio;
    Severity: Minor
    Found in src/webrtc/webrtc_recorder.js - About 1 hr to fix

      Function promiseCallback has 30 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                  var promiseCallback = function(sources) {
                      var result = {
                          audio: {},
                          audioCount: 0,
                          video: {},
      Severity: Minor
      Found in src/webrtc/webrtc_support.js - About 1 hr to fix

        Function exports has 29 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        module.exports = function(grunt) {
        
            var pkg = grunt.file.readJSON('package.json');
            var gruntHelper = require('betajs-compile');
            var dist = 'betajs-media';
        Severity: Minor
        Found in Gruntfile.js - About 1 hr to fix

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

                          this._domEvents.on(this._element, "loadevent", function() {
                              if ( /*loadevent === "loadstart" && */ this._element.networkState === this._element.NETWORK_NO_SOURCE) {
                                  promise.asyncError(true);
                                  return;
                              }
          Severity: Major
          Found in src/audio_player/audio_player.js and 1 other location - About 1 hr to fix
          src/video_player/video_player.js on lines 300..306

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

          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

                          this._domEvents.on(this._element, loadevent, function() {
                              if ( /*loadevent === "loadstart" && */ this._element.networkState === this._element.NETWORK_NO_SOURCE) {
                                  promise.asyncError(true);
                                  return;
                              }
          Severity: Major
          Found in src/video_player/video_player.js and 1 other location - About 1 hr to fix
          src/audio_player/audio_player.js on lines 223..229

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

          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 (_currentDeviceTrack.label) {
                                  _counter = 1;
                                  Objs.iter(devices, function(device, index) {
                                      // If determine label will return device ID
                                      if (Comparators.byValue(device.label, _currentDeviceTrack.label) === 0) {
          Severity: Major
          Found in src/video_recorder/video_recorder.js and 1 other location - About 1 hr to fix
          src/video_recorder/video_recorder.js on lines 479..523

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

          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 (_currentDeviceSettings && _currentDeviceTrack) {
                              if (_currentDeviceSettings.deviceId && devices[_currentDeviceSettings.deviceId]) {
                                  if (isVideo)
                                      this._currentVideo = devices[_currentDeviceSettings.deviceId].id;
                                  else
          Severity: Major
          Found in src/video_recorder/video_recorder.js and 1 other location - About 1 hr to fix
          src/video_recorder/video_recorder.js on lines 488..516

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

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

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

            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

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

                                  if (typeof Blob !== 'undefined' && source.src instanceof Blob)
                                      source.src = (window.URL || window.webkitURL).createObjectURL(source.src);
              Severity: Major
              Found in src/audio_player/audio_player.js and 1 other location - About 1 hr to fix
              src/video_player/video_player.js on lines 59..60

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

              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 (typeof Blob !== 'undefined' && source.audiosrc instanceof Blob)
                                      source.audiosrc = (window.URL || window.webkitURL).createObjectURL(source.audiosrc);
              Severity: Major
              Found in src/video_player/video_player.js and 1 other location - About 1 hr to fix
              src/audio_player/audio_player.js on lines 48..49

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

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