betajs/betajs-media

View on GitHub

Showing 167 of 167 total issues

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

                } else if (!ie9) {
                    Objs.iter(sources, function(source) {
                        var sourceEl = document.createElement("source");
                        if (source.ext === "m3u8" && !this._element.canPlayType(source.type || "application/vnd.apple.mpegURL")) {
                            this._lazyLoadHls().success(function(isSupported) {
Severity: Major
Found in src/video_player/video_player.js and 1 other location - About 3 hrs to fix
src/audio_player/audio_player.js on lines 264..287

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

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 (!ie9) {
                    Objs.iter(sources, function(source) {
                        var sourceEl = document.createElement("source");
                        if (source.type)
                            sourceEl.type = source.type;
Severity: Major
Found in src/audio_player/audio_player.js and 1 other location - About 3 hrs to fix
src/video_player/video_player.js on lines 337..388

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

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

        canAutoplayVideo: function(options) {
            options = this._setupDefaultValues(options);
            var blob = new Blob([new Uint8Array(this.VIDEO)], {
                type: 'video/mp4'
            });
Severity: Major
Found in src/video_player/player_support.js and 1 other location - About 3 hrs to fix
src/video_player/player_support.js on lines 32..43

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

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

        canAutoplayAudio: function(options) {
            options = this._setupDefaultValues(options);
            var blob = new Blob([new Uint8Array(this.AUDIO)], {
                type: 'audio/mpeg'
            });
Severity: Major
Found in src/video_player/player_support.js and 1 other location - About 3 hrs to fix
src/video_player/player_support.js on lines 15..26

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

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

        generateEBMLHeader: function(duration, width, height) {

            var doubleToString = function(num) {
                return [].slice.call(
                    new Uint8Array((new Float64Array([num])).buffer), 0).map(function(e) {
Severity: Major
Found in src/encoding/webm_encoder.js - About 3 hrs to fix

    File audio_player.js has 308 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    Scoped.define("module:AudioPlayer.AudioPlayerWrapper", [
        "base:Classes.OptimisticConditionalInstance",
        "base:Events.EventsMixin",
        "base:Types",
        "base:Objs",
    Severity: Minor
    Found in src/audio_player/audio_player.js - About 3 hrs to fix

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

                      if (document.location.href.indexOf("https://") !== 0 && document.location.hostname !== "localhost") {
                          if (Info.isChrome() && Info.chromeVersion() >= 47)
                              return false;
                          if (Info.isOpera() && Info.operaVersion() >= 34)
                              return false;
      Severity: Major
      Found in src/webrtc/webrtc_recorder.js and 1 other location - About 3 hrs to fix
      src/webrtc/peer_recorder.js on lines 244..249

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

      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 (document.location.href.indexOf("https://") !== 0 && document.location.hostname !== "localhost") {
                      if (Info.isChrome() && Info.chromeVersion() >= 47)
                          return false;
                      if (Info.isOpera() && Info.operaVersion() >= 34)
                          return false;
      Severity: Major
      Found in src/webrtc/peer_recorder.js and 1 other location - About 3 hrs to fix
      src/webrtc/webrtc_recorder.js on lines 1183..1188

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

      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

                      return Support.chromeExtensionMessage(ext.extensionId, {
                          type: "ping",
                          data: pingTest
                      }).mapError(function() {
                          return err;
      Severity: Major
      Found in src/video_recorder/video_recorder.js and 1 other location - About 3 hrs to fix
      src/image_recorder/image_recorder.js on lines 223..232

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

      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

                      return Support.chromeExtensionMessage(ext.extensionId, {
                          type: "ping",
                          data: pingTest
                      }).mapError(function() {
                          return err;
      Severity: Major
      Found in src/image_recorder/image_recorder.js and 1 other location - About 3 hrs to fix
      src/video_recorder/video_recorder.js on lines 447..456

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

      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

                  updateSnapshotDisplay: function(snapshot, image, x, y, w, h) {
                      image.style.left = x + "px";
                      image.style.top = y + "px";
                      image.style.width = w + "px";
                      image.style.height = h + "px";
      Severity: Major
      Found in src/video_recorder/video_recorder.js and 1 other location - About 2 hrs to fix
      src/image_recorder/image_recorder.js on lines 191..196

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

      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

                  updateSnapshotDisplay: function(snapshot, image, x, y, w, h) {
                      image.style.left = x + "px";
                      image.style.top = y + "px";
                      image.style.width = w + "px";
                      image.style.height = h + "px";
      Severity: Major
      Found in src/image_recorder/image_recorder.js and 1 other location - About 2 hrs to fix
      src/video_recorder/video_recorder.js on lines 360..365

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

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

                  reverseVideos: function() {
                      var _self = this;
                      var _isMainBecomeSmall = this.__multiStreamVideoSettings.isMainStream;
                      this.__multiStreamVideoSettings.isMainStream = !_isMainBecomeSmall;
      
      
      Severity: Major
      Found in src/webrtc/webrtc_recorder.js - About 2 hrs to fix

        File broadcasting.js has 278 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        Scoped.define("module:Player.Broadcasting", [
            "base:Class",
            "browser:Loader",
            "browser:Events"
        ], function(Class, Loader, DomEvents, scoped) {
        Severity: Minor
        Found in src/video_player/broadcasting.js - About 2 hrs to fix

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

                      _googleCastRemotePlay: function() {
                          if (this.player._broadcastingState.googleCastConnected) {
                              var castRemotePlayer = this._getGoogleCastRemotePlayer();
                              var castRemotePlayerController = this._getGoogleCastRemotePlayerController();
                              if (castRemotePlayer.playerState === 'PAUSED')
          Severity: Major
          Found in src/video_player/broadcasting.js and 1 other location - About 2 hrs to fix
          src/video_player/broadcasting.js on lines 302..310

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

          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

                      _googleCastRemotePause: function() {
                          if (this.player._broadcastingState.googleCastConnected) {
                              var castRemotePlayer = this._getGoogleCastRemotePlayer();
                              var castRemotePlayerController = this._getGoogleCastRemotePlayerController();
                              if (castRemotePlayer.playerState === 'PLAYING')
          Severity: Major
          Found in src/video_player/broadcasting.js and 1 other location - About 2 hrs to fix
          src/video_player/broadcasting.js on lines 292..300

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

          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 constructor has 63 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);
                          this._poster = options.poster || null;
                          var sources = options.source || options.sources || [];
          Severity: Major
          Found in src/video_player/video_player.js - About 2 hrs to fix

            Function _startDrawRecorderToCanvas has 62 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                        _startDrawRecorderToCanvas: function(stream) {
                            try {
                                var streamSettings = stream.getVideoTracks()[0].getSettings();
                                if (streamSettings.aspectRatio) {
                                    if (Math.abs(streamSettings.aspectRatio - this._videoTrackSettings.aspectRatio) > 0.1) {
            Severity: Major
            Found in src/webrtc/webrtc_recorder.js - About 2 hrs to fix

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

                          constructor: function(stream, options) {
                              options = options || {};
                              inherited.constructor.call(this);
                              this._stream = stream;
                              this._started = false;
              Severity: Major
              Found in src/webrtc/media_recorder.js - About 2 hrs to fix

                File webm_encoder.js has 264 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                Scoped.define("module:Encoding.WebmEncoder.Support", [
                    "base:Promise",
                    "base:Scheduling.Helper",
                    "base:Types"
                ], function(Promise, SchedulingHelper, Types) {
                Severity: Minor
                Found in src/encoding/webm_encoder.js - About 2 hrs to fix
                  Severity
                  Category
                  Status
                  Source
                  Language