betajs/betajs-media

View on GitHub

Showing 167 of 167 total issues

Function _initializeCastApi has 58 lines of code (exceeds 25 allowed). Consider refactoring.
Open

            _initializeCastApi: function() {
                var self = this;
                self.player.trigger("cast-available", true);
                var googleCastInitialOptions = this.googleCast.initialOptions;

Severity: Major
Found in src/video_player/broadcasting.js - About 2 hrs to fix

    Function _enhanceSDP has 57 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

                _enhanceSDP: function(sdpStr, enhanceData) {
                    var sdpLines = sdpStr.split(/\r\n/);
                    var sdpSection = 'header';
                    var hitMID = false;
                    var sdpStrRet = '';
    Severity: Major
    Found in src/webrtc/peer_recorder.js - About 2 hrs to fix

      Function _setup has 55 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                  _setup: function() {
                      this._loaded = false;
                      this._domEvents.on(this._element, "canplay", this._eventLoaded, this);
                      this._domEvents.on(this._element, "loadedmetadata", this._eventLoadedMetaData, this);
                      this._domEvents.on(this._element, "playing", this._eventPlaying, this);
      Severity: Major
      Found in src/video_player/video_player.js - About 2 hrs to fix

        Function _drawTracksToCanvas has 53 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                    _drawTracksToCanvas: function() {
                        if (!this._drawingStream)
                            return;
                        var videosCount = this._videoElements.length;
                        var reversed = false;
        Severity: Major
        Found in src/webrtc/webrtc_recorder.js - About 2 hrs to fix

          Function _setupCastRemotePlayer has 51 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                      _setupCastRemotePlayer: function(castRemotePlayer, castRemotePlayerController) {
                          var self = this;
                          var player = this.player;
                          var options = this.castOptions;
                          var sources = player._sources;
          Severity: Major
          Found in src/video_player/broadcasting.js - About 2 hrs to fix

            Function _detectCurrentDeviceId has 49 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                        _detectCurrentDeviceId: function(devices, devicesCount, isVideo) {
                            var _currentDeviceTrack, _currentDeviceSettings, _counter;
                            if (isVideo) {
                                _currentDeviceTrack = this._recorder._videoTrack;
                                _currentDeviceSettings = this._recorder._videoTrackSettings;
            Severity: Minor
            Found in src/video_recorder/video_recorder.js - About 1 hr to fix

              Function _arraySingleVideoElement has 49 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                          _arraySingleVideoElement: function(options, stream, additionalStream, videoTrack) {
                              var self = this;
                              var video = Support.bindStreamToVideo(stream);
                              additionalStream = additionalStream || false;
                              if (additionalStream) {
              Severity: Minor
              Found in src/webrtc/webrtc_recorder.js - About 1 hr to fix

                Function bindMedia has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                            bindMedia: function() {
                                if (this._bound)
                                    return;
                                return Support.userMedia2(this._getConstraints()).success(function(stream) {
                                    if (!this._options) return;
                Severity: Minor
                Found in src/webrtc/webrtc_recorder.js - About 1 hr to fix

                  Function _startPlayback has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          _startPlayback: function(options, elementCallback) {
                              var playResult, timeoutId, sendOutput;
                              var muted = options.muted,
                                  timeout = options.timeout,
                                  playsinline = options.playsinline;
                  Severity: Minor
                  Found in src/video_player/player_support.js - About 1 hr to fix

                    Function isBlankFrame has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            isBlankFrame: function(canvas, frame, _pixTolerance, _frameTolerance) {
                                if (typeof Array.prototype.some === "function") {
                                    return !canvas.getContext('2d')
                                        .getImageData(0, 0, canvas.width, canvas.height).data
                                        .some(function(channel) {
                    Severity: Minor
                    Found in src/encoding/webm_encoder.js - About 1 hr to fix

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

                                  constructor: function(options, transitionals) {
                                      inherited.constructor.call(this);
                                      options = Objs.extend(Objs.clone(options || {}, 1), transitionals);
                                      var sources = options.source || options.sources || [];
                                      if (Types.is_string(sources))
                      Severity: Minor
                      Found in src/audio_player/audio_player.js - About 1 hr to fix

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

                                    this._whammyRecorder.on("data", function(blob) {
                                        this._videoBlob = blob;
                                        if (this._audioBlob || !this._hasAudio)
                                            this._dataAvailable(this._videoBlob, this._audioBlob);
                                    }, this);
                        Severity: Major
                        Found in src/webrtc/webrtc_recorder.js and 1 other location - About 1 hr to fix
                        src/webrtc/webrtc_recorder.js on lines 1118..1122

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

                        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

                                        this._audioRecorder.on("data", function(blob) {
                                            this._audioBlob = blob;
                                            if (this._videoBlob || !this._hasVideo)
                                                this._dataAvailable(this._videoBlob, this._audioBlob);
                                        }, this);
                        Severity: Major
                        Found in src/webrtc/webrtc_recorder.js and 1 other location - About 1 hr to fix
                        src/webrtc/webrtc_recorder.js on lines 1125..1129

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

                        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 _loadHls has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                _loadHls: function(source) {
                                    var promise = Promise.create();
                                    var Hls = this._hlsObj();
                                    this._hls = new Hls();
                                    this._hls.on(Hls.Events.MEDIA_ATTACHED, function() {
                        Severity: Minor
                        Found in src/video_player/hls_support_mixin.js - About 1 hr to fix

                          Function enumerateMediaSources has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  enumerateMediaSources: function() {
                                      var promise = Promise.create();
                                      var promiseCallback = function(sources) {
                                          var result = {
                                              audio: {},
                          Severity: Minor
                          Found in src/webrtc/webrtc_support.js - About 1 hr to fix

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

                                                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 and 1 other location - About 1 hr to fix
                            src/webrtc/webrtc_support.js on lines 341..344

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

                            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 (options.video.frameRate) {
                                                    opts.video.mandatory.minFrameRate = options.video.frameRate;
                                                    opts.video.mandatory.maxFrameRate = options.video.frameRate;
                                                }
                            Severity: Major
                            Found in src/webrtc/webrtc_support.js and 1 other location - About 1 hr to fix
                            src/webrtc/webrtc_support.js on lines 331..334

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

                            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 __checkAndApplyCorrectConstraints has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                        __checkAndApplyCorrectConstraints: function(videoTrack, capabilities, setConstraints) {
                                            var maxWidth = capabilities.width.max;
                                            var maxHeight = capabilities.height.max;
                            
                                            if (setConstraints.width > maxWidth || setConstraints.height > maxHeight) {
                            Severity: Minor
                            Found in src/webrtc/webrtc_recorder.js - About 1 hr to fix

                              Function errorHandler has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                      errorHandler: function(err) {
                                          switch (err) {
                                              case 'NotReadableError':
                                              case 'TrackStartError':
                                                  return {
                              Severity: Minor
                              Found in src/webrtc/webrtc_support.js - About 1 hr to fix

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

                                            selectMicrophone: function(microphoneId) {
                                                this._options.audioId = microphoneId;
                                                if (this._bound) {
                                                    this.unbindMedia();
                                                    this.bindMedia();
                                Severity: Major
                                Found in src/webrtc/webrtc_recorder.js and 2 other locations - About 1 hr to fix
                                src/webrtc/webrtc_recorder.js on lines 216..223
                                src/webrtc/webrtc_recorder.js on lines 234..241

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

                                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