betajs/betajs-media-components

View on GitHub
src/dynamics/video_player/player/player.js

Summary

Maintainability
F
3 wks
Test Coverage

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

Scoped.define("module:VideoPlayer.Dynamics.Player", [
    "dynamics:Dynamic",
    "module:Assets",
    "module:DatasetProperties",
    "module:FloatHandler",
Severity: Major
Found in src/dynamics/video_player/player/player.js - About 1 wk 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

      Function _attachVideo has 223 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

        Function create has 200 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                        create: function() {
                            if (this.get("autoplaywhenvisible")) {
                                this.set("autoplay", true);
                                Dom.onScrollIntoView(this.activeElement(), this.get("visibilityfraction"), function() {
                                    if (this.destroyed()) return;
        Severity: Major
        Found in src/dynamics/video_player/player/player.js - About 1 day to fix

          Function __testAutoplayOptions has 76 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                          __testAutoplayOptions: function(video) {
                              var suitableCondition = false;
                              var autoplayPossibleOptions = [{
                                      muted: true,
                                      playsinline: false
          Severity: Major
          Found in src/dynamics/video_player/player/player.js - About 3 hrs to fix

            Function __controlAdRolls has 73 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                            __controlAdRolls: function() {
                                // If we have mid-rolls, then prepare mid-Rolls
                                if (
                                    this.get("midrollads").length > 0 && this.get("duration") > 0.0 && !this._adsRollPositionsCollection
                                ) {
            Severity: Major
            Found in src/dynamics/video_player/player/player.js - About 2 hrs to fix

              Function playercontainerstyles:show_sidebar,gallerysidebar,sidebaroptions.presetwidth,fullscreened,videowidth,is_floating has 71 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                                  "playercontainerstyles:show_sidebar,gallerysidebar,sidebaroptions.presetwidth,fullscreened,videowidth,is_floating": function(showSidebar, gallerySidebar, sidebarPresetWidth, fullscreened, videoWidth, isFloating) {
                                      let width, styles;
                                      // before setting any computed to sidebar width, we set a default max-width value based on showSidebar, gallerySidebar and isFloating states.
                                      const defaultMaxWidthSB = (showSidebar && gallerySidebar && !isFloating) ? '30%' : '50%';
                                      this.set("sidebarstyles", {
              Severity: Major
              Found in src/dynamics/video_player/player/player.js - About 2 hrs to fix

                Function __calculateFloatingDimensions has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                                __calculateFloatingDimensions: function() {
                                    var height, width, playerWidth, position, viewportOptions, response = {};
                                    var aspectRatio = typeof this.get("aspect_ratio") === "string" ? this.get("aspect_ratio").split("/") : 1.77;
                                    // Adding condition: "|| Info.isMobile()" will be always true/false as it's getting data from the userAgent and at once;
                                    var isMobile = this.__isInMobileViewport();
                Severity: Major
                Found in src/dynamics/video_player/player/player.js - About 2 hrs to fix

                  Function initMidRollAds has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                                  initMidRollAds: function() {
                                      var schedules;
                                      // Split all via comma exclude inside brackets
                                      schedules = Objs.map(this.get("adsposition").split(/(?![^)(]*\([^)(]*?\)\)),(?![^\[]*\])/), function(item) {
                                          return item.trim();
                  Severity: Major
                  Found in src/dynamics/video_player/player/player.js - About 2 hrs to fix

                    Function _timerFire has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                                    _timerFire: function() {
                                        if (this.destroyed())
                                            return;
                                        try {
                                            this.set("mobileviewport", this.__isInMobileViewport());
                    Severity: Major
                    Found in src/dynamics/video_player/player/player.js - About 2 hrs to fix

                      Function containerSizingStyles:outstream,aspect_ratio,height,width,is_floating,hideplayer,floatingoptions.floatingonly,fullscreened,showsidebargallery,gallerysidebar,layout has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                                          "containerSizingStyles:outstream,aspect_ratio,height,width,is_floating,hideplayer,floatingoptions.floatingonly,fullscreened,showsidebargallery,gallerysidebar,layout": function(
                                              outstream,
                                              aspectRatio,
                                              height,
                                              width,
                      Severity: Minor
                      Found in src/dynamics/video_player/player/player.js - About 1 hr to fix

                        Function toggle_fullscreen has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                            toggle_fullscreen: function() {
                                                this.setPlayerEngagement();
                                                if (this.get("preventinteractionstatus")) return;
                                                if (this._delegatedPlayer) {
                                                    this._delegatedPlayer.execute("toggle_fullscreen");
                        Severity: Minor
                        Found in src/dynamics/video_player/player/player.js - About 1 hr to fix

                          Function _findNextTabStop has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                          _findNextTabStop: function(parentElement, ev, callback, direction) {
                                              var _currentIndex, _direction, _tabIndexes, _tabIndexesArray, _maxIndex, _minIndex, _looked, _tabIndex, _delta, _element, _videoPlayersCount;
                                              _maxIndex = _minIndex = 0;
                                              _direction = direction || 1;
                                              _element = ev.target;
                          Severity: Minor
                          Found in src/dynamics/video_player/player/player.js - About 1 hr to fix

                            Function _validateParameters has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                            _validateParameters: function() {
                                                var fitStrategies = ["crop", "pad", "original"];
                                                var stickyPositions = ["top-left", "top-right", "bottom-right", "bottom-left"];
                                                var mobilePositions = ["top", "bottom"];
                                                if (!fitStrategies.includes(this.get("videofitstrategy"))) {
                            Severity: Minor
                            Found in src/dynamics/video_player/player/player.js - About 1 hr to fix

                              Function applyPresets has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                              applyPresets: function() {
                                                  const presetKey = this.get("presetkey");
                                                  // No need to apply presets if presetkey is not defined
                                                  if (!presetKey) return;
                                                  const multiPresets = this.get("availablepresetoptions");
                              Severity: Minor
                              Found in src/dynamics/video_player/player/player.js - About 1 hr to fix

                                Function tab_index_move has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                                    tab_index_move: function(ev, nextSelector, focusingSelector) {
                                                        if (this.get("preventinteractionstatus")) return;
                                                        var _targetElement, _activeElement, _selector, _keyCode;
                                                        _keyCode = ev.which || ev.keyCode;
                                                        _activeElement = this.activeElement();
                                Severity: Minor
                                Found in src/dynamics/video_player/player/player.js - About 1 hr to fix

                                  Function containerSizingStyles:outstream,aspect_ratio,height,width,is_floating,hideplayer,floatingoptions.floatingonly,fullscreened,showsidebargallery,gallerysidebar,layout has 11 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                                          outstream,
                                                          aspectRatio,
                                                          height,
                                                          width,
                                                          isFloating,
                                  Severity: Major
                                  Found in src/dynamics/video_player/player/player.js - About 1 hr to fix

                                    Function toggle_player has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                                        toggle_player: function(fromOverlay) {
                                                            if (!this._debouncedToggle) this._debouncedToggle = Functions.debounce(function(fo) {
                                                                const floating = this.get("sticky") || this.get("floating");
                                                                if (floating && this.floatHandler && this.floatHandler.isDragging()) {
                                                                    this.floatHandler.stopDragging();
                                    Severity: Minor
                                    Found in src/dynamics/video_player/player/player.js - About 1 hr to fix

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

                                                      _renderMultiCompanionAds: function() {
                                                          this.set("multicompanionads", []);
                                                          const companionAds = this.get('companionads');
                                                          const locations = this.get("companionad.locations");
                                                          Objs.iter(locations, function(location) {
                                      Severity: Minor
                                      Found in src/dynamics/video_player/player/player.js - About 1 hr to fix

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

                                                                if (!this._debouncedToggle) this._debouncedToggle = Functions.debounce(function(fo) {
                                                                    const floating = this.get("sticky") || this.get("floating");
                                                                    if (floating && this.floatHandler && this.floatHandler.isDragging()) {
                                                                        this.floatHandler.stopDragging();
                                                                        return;
                                        Severity: Minor
                                        Found in src/dynamics/video_player/player/player.js - About 1 hr to fix

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

                                                              seek: function(position) {
                                                                  this.setPlayerEngagement();
                                                                  if (this.get("preventinteractionstatus")) return;
                                                                  if (this._delegatedPlayer) {
                                                                      this._delegatedPlayer.execute("seek", position);
                                          Severity: Minor
                                          Found in src/dynamics/video_player/player/player.js - About 1 hr to fix

                                            Function adsinitialized:playing,adtagurl,inlinevastxml has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                            Open

                                                                "adsinitialized:playing,adtagurl,inlinevastxml": function(playing, adsTagURL, inlineVastXML) {
                                                                    if (this.get("adsinitialized")) {
                                                                        if (this.__adInitilizeChecker) this.__adInitilizeChecker.clear();
                                                                        return true;
                                                                    }
                                            Severity: Minor
                                            Found in src/dynamics/video_player/player/player.js - About 1 hr to fix

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

                                                              initAdSources: function() {
                                                                  this.set("preloadadsmanager", false);
                                                                  this.set("delayadsmanagerload", false);
                                                                  if (
                                                                      Array.isArray(this.get("adtagurlfallbacks")) &&
                                              Severity: Minor
                                              Found in src/dynamics/video_player/player/player.js - About 1 hr to fix

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

                                                                __unmuteOnClick: function() {
                                                                    clearTimeout(this.get('clearDebounce'));
                                                                    const clearDebounce = setTimeout(function() {
                                                                        if (!this.get("muted") && this.get("volume") > 0) {
                                                                            return this.set("unmuteonclick", false);
                                                Severity: Minor
                                                Found in src/dynamics/video_player/player/player.js - About 1 hr to fix

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

                                                                  setNextOutstreamAdTagURL: function(immediate, stateContext, nextState) {
                                                                      immediate = immediate || false;
                                                                      // if we have set nextadtagurls, then we will try to load next adtagurl
                                                                      this.getNextOutstreamAdTagURLs(immediate)
                                                                          .success(function(response) {
                                                  Severity: Minor
                                                  Found in src/dynamics/video_player/player/player.js - About 1 hr to fix

                                                    Avoid deeply nested control flow statements.
                                                    Open

                                                                                        if (typeof _ar === "number") {
                                                                                            sidebarWidth = playerContainerWidthInNumber - (playerContainerHeightInNumber * _ar);
                                                                                        }
                                                    Severity: Major
                                                    Found in src/dynamics/video_player/player/player.js - About 45 mins to fix

                                                      Function hideplayer:autoplay,autoplaywhenvisible,adshassource,adsinitialized,hidden,hidebeforeadstarts has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                                      Open

                                                                              autoplay,
                                                                              autoplaywhenvisible,
                                                                              adshassource,
                                                                              adsinitialized,
                                                                              hidden,
                                                      Severity: Minor
                                                      Found in src/dynamics/video_player/player/player.js - About 45 mins to fix

                                                        Avoid deeply nested control flow statements.
                                                        Open

                                                                                            if (Types.is_string(_ar)) {
                                                                                                if (_ar.includes("/"))
                                                                                                    _ar = parseFloat(_ar.split("/").reduce((a, b) => a / b));
                                                                                                else if (_ar.includes(":"))
                                                                                                    _ar = parseFloat(_ar.split(":").reduce((a, b) => a / b));
                                                        Severity: Major
                                                        Found in src/dynamics/video_player/player/player.js - About 45 mins to fix

                                                          Function playercontainerstyles:show_sidebar,gallerysidebar,sidebaroptions.presetwidth,fullscreened,videowidth,is_floating has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                                          Open

                                                                              "playercontainerstyles:show_sidebar,gallerysidebar,sidebaroptions.presetwidth,fullscreened,videowidth,is_floating": function(showSidebar, gallerySidebar, sidebarPresetWidth, fullscreened, videoWidth, isFloating) {
                                                          Severity: Minor
                                                          Found in src/dynamics/video_player/player/player.js - About 45 mins to fix

                                                            Function show_sidebar:outstream,hide_sidebar,is_floating,with_sidebar,fullscreened,mobileviewport has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                                            Open

                                                                                    outstream, hideSidebar, isFloating, withSidebar, fullscreened, mobileViewport
                                                            Severity: Minor
                                                            Found in src/dynamics/video_player/player/player.js - About 45 mins to fix

                                                              Avoid deeply nested control flow statements.
                                                              Open

                                                                                                      if (Types.is_object(presets.mobile) && presets.mobile[k]) {
                                                                                                          this.set(`initialoptions.mobilepresets.${k}`, presets.mobile[k]);
                                                                                                          if (isMobileView) this.set(k, presets.mobile[k]);
                                                                                                      }
                                                              Severity: Major
                                                              Found in src/dynamics/video_player/player/player.js - About 45 mins to fix

                                                                Avoid deeply nested control flow statements.
                                                                Open

                                                                                                            if (item < 100 && item > 0) {
                                                                                                                this.get("midrollads").push({
                                                                                                                    position: parseFloat((item / 100).toFixed(2))
                                                                                                                });
                                                                                                            }
                                                                Severity: Major
                                                                Found in src/dynamics/video_player/player/player.js - About 45 mins to fix

                                                                  Avoid deeply nested control flow statements.
                                                                  Open

                                                                                                      if (sidebarWidth && sidebarWidth > 0) {
                                                                                                          // if sidebar non-fluid, we will calculate based on preferred ar or first video we're getting
                                                                                                          if (!this.get('sidebaroptions.fluid')) {
                                                                                                              this.set("sidebaroptions.presetwidth", sidebarWidth + "px");
                                                                                                          }
                                                                  Severity: Major
                                                                  Found in src/dynamics/video_player/player/player.js - About 45 mins to fix

                                                                    Avoid deeply nested control flow statements.
                                                                    Open

                                                                                                                    if (this.get("infiniteduration"))
                                                                                                                        step = 100;
                                                                    Severity: Major
                                                                    Found in src/dynamics/video_player/player/player.js - About 45 mins to fix

                                                                      Avoid deeply nested control flow statements.
                                                                      Open

                                                                                                                      if (duration > item) {
                                                                                                                          for (var i = 1; i <= step; i++) {
                                                                                                                              this.get("midrollads").push({
                                                                                                                                  position: this.get("position") + i * item
                                                                                                                              });
                                                                      Severity: Major
                                                                      Found in src/dynamics/video_player/player/player.js - About 45 mins to fix

                                                                        Function _drawFrame has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                        Open

                                                                                        _drawFrame: function(video, currentTime, width, height, cb) {
                                                                        Severity: Minor
                                                                        Found in src/dynamics/video_player/player/player.js - About 35 mins to fix

                                                                          Avoid too many return statements within this function.
                                                                          Open

                                                                                                      if (this.showControll()) return;
                                                                          Severity: Major
                                                                          Found in src/dynamics/video_player/player/player.js - About 30 mins to fix

                                                                            Avoid too many return statements within this function.
                                                                            Open

                                                                                                            return true;
                                                                            Severity: Major
                                                                            Found in src/dynamics/video_player/player/player.js - About 30 mins to fix

                                                                              TODO found
                                                                              Open

                                                                                                          // "fluidsidebar": true, // TODO: not works for now, if false, 50% width will be applied on sidebar

                                                                              TODO found
                                                                              Open

                                                                                                       "queryselector": null // TODO: will be shown on hover only on this element

                                                                              TODO found
                                                                              Open

                                                                                                       "showonhover": false, // TODO: will be shown on hover only

                                                                              TODO found
                                                                              Open

                                                                                                              visible: true, // TODO add parameter for setting source quality settings visibility

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

                                                                                              _findNextTabStop: function(parentElement, ev, callback, direction) {
                                                                                                  var _currentIndex, _direction, _tabIndexes, _tabIndexesArray, _maxIndex, _minIndex, _looked, _tabIndex, _delta, _element, _videoPlayersCount;
                                                                                                  _maxIndex = _minIndex = 0;
                                                                                                  _direction = direction || 1;
                                                                                                  _element = ev.target;
                                                                              Severity: Major
                                                                              Found in src/dynamics/video_player/player/player.js and 1 other location - About 3 days to fix
                                                                              src/dynamics/audio_player/player/player.js on lines 450..493

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

                                                                              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(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

                                                                                              videoWidth: function() {
                                                                                                  if (this.videoAttached())
                                                                                                      return this.player.videoWidth();
                                                                                                  var img = this.activeElement().querySelector("img");
                                                                                                  // In Safari img && img.width could return 0
                                                                              Severity: Major
                                                                              Found in src/dynamics/video_player/player/player.js and 1 other location - About 4 hrs to fix
                                                                              src/dynamics/video_player/player/player.js on lines 2489..2501

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

                                                                              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

                                                                                              videoHeight: function() {
                                                                                                  if (this.videoAttached())
                                                                                                      return this.player.videoHeight();
                                                                                                  var img = this.activeElement().querySelector("img");
                                                                                                  // In Safari img && img.height could return 0
                                                                              Severity: Major
                                                                              Found in src/dynamics/video_player/player/player.js and 1 other location - About 4 hrs to fix
                                                                              src/dynamics/video_player/player/player.js on lines 2503..2515

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

                                                                              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 (_keyCode === 9 && ev.shiftKey) {
                                                                                                      this._resetActivity();
                                                                                                      this._findNextTabStop(element, ev, function(target, index) {
                                                                                                          target.focus();
                                                                                                      }, -1);
                                                                              Severity: Major
                                                                              Found in src/dynamics/video_player/player/player.js and 1 other location - About 3 hrs to fix
                                                                              src/dynamics/image_viewer/viewer/image_viewer.js on lines 174..184

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

                                                                              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 4 locations. Consider refactoring.
                                                                              Open

                                                                                                  if (!fitStrategies.includes(this.get("posterfitstrategy"))) {
                                                                                                      console.warn("Invalid value for posterfitstrategy: " + this.get("posterfitstrategy") + "\nPossible values are: " + fitStrategies.slice(0, -1).join(", ") + " or " + fitStrategies.slice(-1));
                                                                                                  }
                                                                              Severity: Major
                                                                              Found in src/dynamics/video_player/player/player.js and 3 other locations - About 2 hrs to fix
                                                                              src/dynamics/video_player/player/player.js on lines 1461..1463
                                                                              src/dynamics/video_recorder/recorder/recorder.js on lines 534..536
                                                                              src/dynamics/video_recorder/recorder/recorder.js on lines 537..539

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

                                                                              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 4 locations. Consider refactoring.
                                                                              Open

                                                                                                  if (!fitStrategies.includes(this.get("videofitstrategy"))) {
                                                                                                      console.warn("Invalid value for videofitstrategy: " + this.get("videofitstrategy") + "\nPossible values are: " + fitStrategies.slice(0, -1).join(", ") + " or " + fitStrategies.slice(-1));
                                                                                                  }
                                                                              Severity: Major
                                                                              Found in src/dynamics/video_player/player/player.js and 3 other locations - About 2 hrs to fix
                                                                              src/dynamics/video_player/player/player.js on lines 1464..1466
                                                                              src/dynamics/video_recorder/recorder/recorder.js on lines 534..536
                                                                              src/dynamics/video_recorder/recorder/recorder.js on lines 537..539

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

                                                                              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 6 locations. Consider refactoring.
                                                                              Open

                                                                                                  if (this.get("theme") in Assets.playerthemes) {
                                                                                                      Objs.iter(Assets.playerthemes[this.get("theme")], function(value, key) {
                                                                                                          if (!this.isArgumentAttr(key))
                                                                                                              this.set(key, value);
                                                                                                      }, this);
                                                                              Severity: Major
                                                                              Found in src/dynamics/video_player/player/player.js and 5 other locations - About 2 hrs to fix
                                                                              src/dynamics/audio_player/player/player.js on lines 180..185
                                                                              src/dynamics/audio_recorder/recorder/recorder.js on lines 200..205
                                                                              src/dynamics/image_capture/capture/capture.js on lines 199..204
                                                                              src/dynamics/image_viewer/viewer/image_viewer.js on lines 117..122
                                                                              src/dynamics/video_recorder/recorder/recorder.js on lines 372..377

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

                                                                              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

                                                                                              _detachVideo: function() {
                                                                                                  this.set("playing", false);
                                                                                                  if (this.player) this.player.weakDestroy();
                                                                                                  this.player = null;
                                                                                                  this.__video = null;
                                                                              Severity: Major
                                                                              Found in src/dynamics/video_player/player/player.js and 1 other location - About 2 hrs to fix
                                                                              src/dynamics/audio_player/player/player.js on lines 264..271

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

                                                                              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 (_keyCode === 32 || _keyCode === 13 || _keyCode === 9) {
                                                                                                      this._resetActivity();
                                                                                                      if (this.get("fullscreened") && this.get("hideoninactivity")) this.set("hideoninactivity", false);
                                                                                                  }
                                                                              Severity: Major
                                                                              Found in src/dynamics/video_player/player/player.js and 1 other location - About 1 hr to fix
                                                                              src/dynamics/image_viewer/viewer/image_viewer.js on lines 169..172

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

                                                                              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

                                                                                                  Object.keys(toBeDeprecatedParams).forEach(function(key) {
                                                                                                      if (this.get(key))
                                                                                                          console.warn(key + " parameter will be deprecated on future version, please use " + toBeDeprecatedParams[key] + " instead.");
                                                                                                  }.bind(this));
                                                                              Severity: Major
                                                                              Found in src/dynamics/video_player/player/player.js and 1 other location - About 1 hr to fix
                                                                              src/dynamics/video_player/player/player.js on lines 1485..1488

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

                                                                              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

                                                                                                  Object.keys(deprecatedParams).forEach(function(key) {
                                                                                                      if (this.get(key))
                                                                                                          console.warn(key + " parameter was deprecated, please use " + deprecatedParams[key] + " instead.");
                                                                                                  }.bind(this));
                                                                              Severity: Major
                                                                              Found in src/dynamics/video_player/player/player.js and 1 other location - About 1 hr to fix
                                                                              src/dynamics/video_player/player/player.js on lines 1495..1498

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

                                                                              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 (this.get("totalduration") || this.player.duration() < Infinity)
                                                                                                              this.set("duration", this.get("totalduration") || this.player.duration());
                                                                              Severity: Major
                                                                              Found in src/dynamics/video_player/player/player.js and 1 other location - About 1 hr to fix
                                                                              src/dynamics/audio_player/player/player.js on lines 372..373

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

                                                                              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 5 locations. Consider refactoring.
                                                                              Open

                                                                                              _error: function(error_type, error_code) {
                                                                                                  this.__error = {
                                                                                                      error_type: error_type,
                                                                                                      error_code: error_code
                                                                                                  };
                                                                              Severity: Major
                                                                              Found in src/dynamics/video_player/player/player.js and 4 other locations - About 1 hr to fix
                                                                              src/dynamics/audio_player/player/player.js on lines 251..258
                                                                              src/dynamics/audio_recorder/recorder/recorder.js on lines 264..271
                                                                              src/dynamics/image_capture/capture/capture.js on lines 274..281
                                                                              src/dynamics/video_recorder/recorder/recorder.js on lines 510..517

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

                                                                              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

                                                                                                  var sources = filter ? Objs.filter(this.get("sources"), function(source) {
                                                                                                      return Objs.subset_of(filter, source);
                                                                                                  }, this) : this.get("sources");
                                                                              Severity: Major
                                                                              Found in src/dynamics/video_player/player/player.js and 1 other location - About 1 hr to fix
                                                                              src/dynamics/audio_player/player/player.js on lines 385..387

                                                                              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 3 locations. Consider refactoring.
                                                                              Open

                                                                                                  if (_keyCode === 32 || _keyCode === 37 || _keyCode === 38 || _keyCode === 39 || _keyCode === 40) ev.preventDefault();
                                                                              Severity: Major
                                                                              Found in src/dynamics/video_player/player/player.js and 2 other locations - About 50 mins to fix
                                                                              src/dynamics/audio_player/player/player.js on lines 436..436
                                                                              src/dynamics/image_viewer/viewer/image_viewer.js on lines 167..167

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

                                                                              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 (Types.is_defined(this.get("floatingoptions.desktop.sidebar")) && this.get("floatingoptions.sidebar"))
                                                                                                          this.set("with_sidebar", this.get("floatingoptions.desktop.sidebar"));
                                                                              Severity: Minor
                                                                              Found in src/dynamics/video_player/player/player.js and 1 other location - About 50 mins to fix
                                                                              src/dynamics/video_player/player/player.js on lines 2885..2886

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

                                                                              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 (Types.is_defined(this.get("floatingoptions.mobile.sidebar")) && this.get("floatingoptions.sidebar"))
                                                                                                          this.set("with_sidebar", this.get("floatingoptions.mobile.sidebar"));
                                                                              Severity: Minor
                                                                              Found in src/dynamics/video_player/player/player.js and 1 other location - About 50 mins to fix
                                                                              src/dynamics/video_player/player/player.js on lines 2912..2913

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

                                                                              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 this.get("playing") && this.get("buffered") < this.get("position") && this.get("last_position_change_delta") > 1000;
                                                                              Severity: Minor
                                                                              Found in src/dynamics/video_player/player/player.js and 1 other location - About 50 mins to fix
                                                                              src/dynamics/audio_player/player/player.js on lines 159..159

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

                                                                              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 (this.get("stretch") || this.get("stretchwidth") || this.get("stretchheight")) {
                                                                                                      console.warn("Stretch parameters were deprecated, your player will stretch to the full container width by default.");
                                                                                                  }
                                                                              Severity: Minor
                                                                              Found in src/dynamics/video_player/player/player.js and 1 other location - About 45 mins to fix
                                                                              src/dynamics/video_recorder/recorder/recorder.js on lines 540..542

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

                                                                              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 (this.activeElement()) {
                                                                                                          this.activeElement().classList.remove(this.get("csscommon") + "-full-width");
                                                                                                      }
                                                                              Severity: Minor
                                                                              Found in src/dynamics/video_player/player/player.js and 1 other location - About 40 mins to fix
                                                                              src/dynamics/video_player/player/player.js on lines 2882..2884

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

                                                                              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 (this.activeElement()) {
                                                                                                          this.activeElement().classList.add(this.get("csscommon") + "-full-width");
                                                                                                      }
                                                                              Severity: Minor
                                                                              Found in src/dynamics/video_player/player/player.js and 1 other location - About 40 mins to fix
                                                                              src/dynamics/video_player/player/player.js on lines 2909..2911

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

                                                                              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 (this.videoLoaded()) {
                                                                                                          this.player.setVolume(volume);
                                                                                                          this.player.setMuted(volume <= 0);
                                                                                                      }
                                                                              Severity: Minor
                                                                              Found in src/dynamics/video_player/player/player.js and 1 other location - About 40 mins to fix
                                                                              src/dynamics/audio_player/player/player.js on lines 559..562

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

                                                                              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

                                                                                              aspectRatio: function() {
                                                                                                  // Don't use a shortcut way of getting an aspect ratio, will act as not expected.
                                                                                                  var height = this.videoHeight();
                                                                                                  var width = this.videoWidth();
                                                                              
                                                                              
                                                                              Severity: Minor
                                                                              Found in src/dynamics/video_player/player/player.js and 1 other location - About 35 mins to fix
                                                                              src/dynamics/image_viewer/viewer/image_viewer.js on lines 472..478

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

                                                                              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.set("initialoptions", Objs.tree_merge(this.get("initialoptions"), {
                                                                                                          hideoninactivity: this.get("hideoninactivity")
                                                                                                      }));
                                                                              Severity: Minor
                                                                              Found in src/dynamics/video_player/player/player.js and 1 other location - About 30 mins to fix
                                                                              src/dynamics/audio_player/player/player.js on lines 175..177

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

                                                                              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

                                                                              There are no issues that match your filters.

                                                                              Category
                                                                              Status