betajs/betajs-media-components

View on GitHub

Showing 10,517 of 10,517 total issues

File states.js has 650 lines of code (exceeds 250 allowed). Consider refactoring.
Open

Scoped.define("module:AudioRecorder.Dynamics.RecorderStates.State", [
    "base:States.State",
    "base:Events.ListenMixin",
    "base:Objs"
], function(State, ListenMixin, Objs, scoped) {
Severity: Major
Found in src/dynamics/audio_recorder/recorder/states.js - About 1 day to fix

    Function attrs has 288 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

                    attrs: function() {
                        return {
                            /* CSS */
                            brightness: 0,
                            current_video_from_playlist: 0,
    Severity: Major
    Found in src/dynamics/video_player/player/player.js - About 1 day to fix

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

                      _playWhenVisible: function(video) {
                          var _self = this;
      
                          if (Dom.isElementVisible(video, this.get("visibilityfraction"))) {
                              this.player.play();
      Severity: Major
      Found in src/dynamics/video_player/player/player.js and 1 other location - About 1 day to fix
      src/dynamics/audio_player/player/player.js on lines 405..425

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

      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

                      _playWhenVisible: function(audio) {
                          var _self = this;
      
                          if (Dom.isElementVisible(audio, this.get("visibilityfraction"))) {
                              this.player.play();
      Severity: Major
      Found in src/dynamics/audio_player/player/player.js and 1 other location - About 1 day to fix
      src/dynamics/video_player/player/player.js on lines 1792..1811

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

      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

                          try {
                              if (this.recorderAttached() && this._timer.fire_count() % 20 === 0 && this._accessing_camera) {
                                  var signal = this.blankLevel() >= 0.01;
                                  if (signal !== this.__cameraSignal) {
                                      this.__cameraSignal = signal;
      Severity: Major
      Found in src/dynamics/image_capture/capture/capture.js and 1 other location - About 1 day to fix
      src/dynamics/video_recorder/recorder/recorder.js on lines 1240..1256

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

      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

                          try {
                              if (this.recorderAttached() && this._timer.fire_count() % 20 === 0 && this._accessing_camera) {
                                  var signal = this.blankLevel() >= 0.01;
                                  if (signal !== this.__cameraSignal) {
                                      this.__cameraSignal = signal;
      Severity: Major
      Found in src/dynamics/video_recorder/recorder/recorder.js and 1 other location - About 1 day to fix
      src/dynamics/image_capture/capture/capture.js on lines 505..521

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

      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

                      _updateStretch: function() {
                          var newStretch = null;
                          if (this.get("stretch")) {
                              var ar = this.aspectRatio();
                              if (isFinite(ar)) {
      Severity: Major
      Found in src/dynamics/image_capture/capture/capture.js and 1 other location - About 1 day to fix
      src/dynamics/image_viewer/viewer/image_viewer.js on lines 492..514

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

      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

                      _updateStretch: function() {
                          var newStretch = null;
                          if (this.get("stretch")) {
                              var ar = this.aspectRatio();
                              if (isFinite(ar)) {
      Severity: Major
      Found in src/dynamics/image_viewer/viewer/image_viewer.js and 1 other location - About 1 day to fix
      src/dynamics/image_capture/capture/capture.js on lines 556..578

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

      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.listenOn(this.dyn.channel("ads"), "log", function(event) {
                                  if (!event.getAdData().adError || !this.dyn.get("adtagurlfallbacks") || this.dyn.get("adtagurlfallbacks").length === 0) return;
                                  this.dyn.set("adtagurl", this.dyn.get("adtagurlfallbacks").shift());
                                  this.dyn.brakeAdsManually();
                                  if (!this.dyn.get("adsplayer_active")) this.dyn.set("adsplayer_active", true);
      Severity: Major
      Found in src/dynamics/video_player/player/states.js and 1 other location - About 1 day to fix
      src/dynamics/video_player/player/states.js on lines 807..818

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

      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.listenOn(this.dyn.channel("ads"), "log", function(event) {
                          if (!event.getAdData().adError || !this.dyn.get("adtagurlfallbacks") || this.dyn.get("adtagurlfallbacks").length === 0) return;
                          this.dyn.set("adtagurl", this.dyn.get("adtagurlfallbacks").shift());
                          this.dyn.brakeAdsManually();
                          if (!this.dyn.get("adsplayer_active")) this.dyn.set("adsplayer_active", true);
      Severity: Major
      Found in src/dynamics/video_player/player/states.js and 1 other location - About 1 day to fix
      src/dynamics/video_player/player/states.js on lines 490..501

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

      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

      File player.js has 585 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      Scoped.define("module:AudioPlayer.Dynamics.Player", [
          "dynamics:Dynamic",
          "module:Assets",
          "module:AudioVisualization",
          "browser:Info",
      Severity: Major
      Found in src/dynamics/audio_player/player/player.js - About 1 day to fix

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

                                if (Info.isMobile() && Info.isCordova()) {
                                    var self = this;
                                    if (Info.isAndroid()) {
                                        navigator.device.capture.captureVideo(function(mediaFiles) {
                                            self.trigger("upload", mediaFiles[0]);
        Severity: Major
        Found in src/dynamics/video_recorder/chooser/chooser.js and 1 other location - About 1 day to fix
        src/dynamics/audio_recorder/chooser/chooser.js on lines 93..115

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

        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 (Info.isMobile() && Info.isCordova()) {
                                    var self = this;
                                    if (Info.isAndroid()) {
                                        navigator.device.capture.captureAudio(function(mediaFiles) {
                                            self.trigger("upload", mediaFiles[0]);
        Severity: Major
        Found in src/dynamics/audio_recorder/chooser/chooser.js and 1 other location - About 1 day to fix
        src/dynamics/video_recorder/chooser/chooser.js on lines 136..158

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

        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

        File recorder.js has 579 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        Scoped.define("module:AudioRecorder.Dynamics.Recorder", [
            "dynamics:Dynamic",
            "module:Assets",
            "module:AudioVisualization",
            "browser:Info",
        Severity: Major
        Found in src/dynamics/audio_recorder/recorder/recorder.js - About 1 day to fix

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

                              if ((data.width && this.dyn.get("minuploadingwidth") && this.dyn.get("minuploadingwidth") > data.width) ||
                                  (data.width && this.dyn.get("maxuploadingwidth") && this.dyn.get("maxuploadingwidth") < data.width) ||
                                  (data.height && this.dyn.get("minuploadingheight") && this.dyn.get("minuploadingheight") > data.height) ||
                                  (data.height && this.dyn.get("maxuploadingheight") && this.dyn.get("maxuploadingheight") < data.height)) {
                                  this.next("FatalError", {
          Severity: Major
          Found in src/dynamics/image_capture/capture/states.js and 1 other location - About 1 day to fix
          src/dynamics/video_recorder/recorder/states.js on lines 354..363

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

          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 ((data.width && this.dyn.get("minuploadingwidth") && this.dyn.get("minuploadingwidth") > data.width) ||
                                  (data.width && this.dyn.get("maxuploadingwidth") && this.dyn.get("maxuploadingwidth") < data.width) ||
                                  (data.height && this.dyn.get("minuploadingheight") && this.dyn.get("minuploadingheight") > data.height) ||
                                  (data.height && this.dyn.get("maxuploadingheight") && this.dyn.get("maxuploadingheight") < data.height)) {
                                  this.next("FatalError", {
          Severity: Major
          Found in src/dynamics/video_recorder/recorder/states.js and 1 other location - About 1 day to fix
          src/dynamics/image_capture/capture/states.js on lines 203..212

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

          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

          File states.js has 571 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          Scoped.define("module:ImageCapture.Dynamics.RecorderStates.State", [
              "base:States.State",
              "base:Events.ListenMixin",
              "base:Objs"
          ], function(State, ListenMixin, Objs, scoped) {
          Severity: Major
          Found in src/dynamics/image_capture/capture/states.js - About 1 day to fix

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

                                    var updateVolume = function(event) {
                                        var volume;
                                        event.preventDefault();
                                        if (domRect.width > domRect.height) {
                                            // Horizontal slider
            Severity: Major
            Found in src/dynamics/video_player/controlbar/controlbar.js and 1 other location - About 1 day to fix
            src/dynamics/ads_player/ads_controlbar/ads_controlbar.js on lines 61..76

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

            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 updateVolume = function(event) {
                                        var volume;
                                        event.preventDefault();
                                        if (domRect.width > domRect.height) {
                                            // Horizontal slider
            Severity: Major
            Found in src/dynamics/ads_player/ads_controlbar/ads_controlbar.js and 1 other location - About 1 day to fix
            src/dynamics/video_player/controlbar/controlbar.js on lines 196..211

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

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

                            _attachVideo: function(silent) {
                                if (this.videoAttached())
                                    return;
                                if (!this.__activated) {
                                    this.__attachRequested = true;
            Severity: Major
            Found in src/dynamics/video_player/player/player.js - About 1 day to fix
              Severity
              Category
              Status
              Source
              Language