harella1/video.js

View on GitHub
src/js/player.js

Summary

Maintainability
F
1 wk
Test Coverage

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

/**
 * @file player.js
 */
 // Subclasses Component
import Component from './component.js';
Severity: Major
Found in src/js/player.js - About 3 days to fix

    Player has 111 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class Player extends Component {
    
      /**
       * player's constructor function
       *
    Severity: Major
    Found in src/js/player.js - About 2 days to fix

      Function updateStyleEl_ has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
      Open

        updateStyleEl_() {
          if (window.VIDEOJS_NO_DYNAMIC_STYLE === true) {
            const width = typeof this.width_ === 'number' ? this.width_ : this.options_.width;
            const height = typeof this.height_ === 'number' ? this.height_ : this.options_.height;
            let techEl = this.tech_ && this.tech_.el();
      Severity: Minor
      Found in src/js/player.js - About 3 hrs to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Function loadTech_ has 81 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        loadTech_(techName, source) {
      
          // Pause and remove current playback technology
          if (this.tech_) {
            this.unloadTech_();
      Severity: Major
      Found in src/js/player.js - About 3 hrs to fix

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

          constructor(tag, options, ready){
            // Make sure tag ID exists
            tag.id = tag.id || `vjs_video_${Guid.newGUID()}`;
        
            // Set Options
        Severity: Major
        Found in src/js/player.js - About 2 hrs to fix

          Function controls has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
          Open

            controls(bool) {
              if (bool !== undefined) {
                bool = !!bool; // force boolean
                // Don't trigger a change event unless it actually changed
                if (this.controls_ !== bool) {
          Severity: Minor
          Found in src/js/player.js - About 2 hrs to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Function updateStyleEl_ has 54 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            updateStyleEl_() {
              if (window.VIDEOJS_NO_DYNAMIC_STYLE === true) {
                const width = typeof this.width_ === 'number' ? this.width_ : this.options_.width;
                const height = typeof this.height_ === 'number' ? this.height_ : this.options_.height;
                let techEl = this.tech_ && this.tech_.el();
          Severity: Major
          Found in src/js/player.js - About 2 hrs to fix

            Function constructor has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
            Open

              constructor(tag, options, ready){
                // Make sure tag ID exists
                tag.id = tag.id || `vjs_video_${Guid.newGUID()}`;
            
                // Set Options
            Severity: Minor
            Found in src/js/player.js - About 1 hr to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Function loadTech_ has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
            Open

              loadTech_(techName, source) {
            
                // Pause and remove current playback technology
                if (this.tech_) {
                  this.unloadTech_();
            Severity: Minor
            Found in src/js/player.js - About 1 hr to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

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

              createEl() {
                let el = this.el_ = super.createEl('div');
                let tag = this.tag;
            
                // Remove width/height attrs from tag so CSS can make it 100% width/height
            Severity: Minor
            Found in src/js/player.js - About 1 hr to fix

              Function listenForUserActivity_ has 39 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                listenForUserActivity_() {
                  let mouseInProgress, lastMoveX, lastMoveY;
              
                  let handleActivity = Fn.bind(this, this.reportUserActivity);
              
              
              Severity: Minor
              Found in src/js/player.js - About 1 hr to fix

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

                  selectSource(sources) {
                    // Get only the techs specified in `techOrder` that exist and are supported by the
                    // current platform
                    let techs =
                      this.options_.techOrder
                Severity: Minor
                Found in src/js/player.js - About 1 hr to fix

                  Function techGet_ has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                    techGet_(method) {
                      if (this.tech_ && this.tech_.isReady_) {
                  
                        // Flash likes to die and reload when you hide or reposition it.
                        // In these cases the object methods go away and we get errors.
                  Severity: Minor
                  Found in src/js/player.js - About 1 hr to fix

                  Cognitive Complexity

                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                  A method's cognitive complexity is based on a few simple rules:

                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                  • Code is considered more complex for each "break in the linear flow of the code"
                  • Code is considered more complex when "flow breaking structures are nested"

                  Further reading

                  Function src has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    src(source) {
                      if (source === undefined) {
                        return this.techGet_('src');
                      }
                  
                  
                  Severity: Minor
                  Found in src/js/player.js - About 1 hr to fix

                    Function userActive has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                    Open

                      userActive(bool) {
                        if (bool !== undefined) {
                          bool = !!bool;
                          if (bool !== this.userActive_) {
                            this.userActive_ = bool;
                    Severity: Minor
                    Found in src/js/player.js - About 1 hr to fix

                    Cognitive Complexity

                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                    A method's cognitive complexity is based on a few simple rules:

                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                    • Code is considered more complex for each "break in the linear flow of the code"
                    • Code is considered more complex when "flow breaking structures are nested"

                    Further reading

                    Function src has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                    Open

                      src(source) {
                        if (source === undefined) {
                          return this.techGet_('src');
                        }
                    
                    
                    Severity: Minor
                    Found in src/js/player.js - About 1 hr to fix

                    Cognitive Complexity

                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                    A method's cognitive complexity is based on a few simple rules:

                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                    • Code is considered more complex for each "break in the linear flow of the code"
                    • Code is considered more complex when "flow breaking structures are nested"

                    Further reading

                    Function getTagSettings has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                    Open

                      static getTagSettings(tag) {
                        let baseOptions = {
                          'sources': [],
                          'tracks': []
                        };
                    Severity: Minor
                    Found in src/js/player.js - About 1 hr to fix

                    Cognitive Complexity

                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                    A method's cognitive complexity is based on a few simple rules:

                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                    • Code is considered more complex for each "break in the linear flow of the code"
                    • Code is considered more complex when "flow breaking structures are nested"

                    Further reading

                    Function canPlayType has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                    Open

                      canPlayType(type) {
                        let can;
                    
                        // Loop through each playback technology in the options order
                        for (let i = 0, j = this.options_.techOrder; i < j.length; i++) {
                    Severity: Minor
                    Found in src/js/player.js - About 1 hr to fix

                    Cognitive Complexity

                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                    A method's cognitive complexity is based on a few simple rules:

                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                    • Code is considered more complex for each "break in the linear flow of the code"
                    • Code is considered more complex when "flow breaking structures are nested"

                    Further reading

                    Function getTagSettings has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      static getTagSettings(tag) {
                        let baseOptions = {
                          'sources': [],
                          'tracks': []
                        };
                    Severity: Minor
                    Found in src/js/player.js - About 1 hr to fix

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

                        controls(bool) {
                          if (bool !== undefined) {
                            bool = !!bool; // force boolean
                            // Don't trigger a change event unless it actually changed
                            if (this.controls_ !== bool) {
                      Severity: Minor
                      Found in src/js/player.js - About 1 hr to fix

                        Function usingNativeControls has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                          usingNativeControls(bool) {
                            if (bool !== undefined) {
                              bool = !!bool; // force boolean
                              // Don't trigger a change event unless it actually changed
                              if (this.usingNativeControls_ !== bool) {
                        Severity: Minor
                        Found in src/js/player.js - About 35 mins to fix

                        Cognitive Complexity

                        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                        A method's cognitive complexity is based on a few simple rules:

                        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                        • Code is considered more complex for each "break in the linear flow of the code"
                        • Code is considered more complex when "flow breaking structures are nested"

                        Further reading

                        Function listenForUserActivity_ has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                          listenForUserActivity_() {
                            let mouseInProgress, lastMoveX, lastMoveY;
                        
                            let handleActivity = Fn.bind(this, this.reportUserActivity);
                        
                        
                        Severity: Minor
                        Found in src/js/player.js - About 35 mins to fix

                        Cognitive Complexity

                        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                        A method's cognitive complexity is based on a few simple rules:

                        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                        • Code is considered more complex for each "break in the linear flow of the code"
                        • Code is considered more complex when "flow breaking structures are nested"

                        Further reading

                        Function hasStarted has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                          hasStarted(hasStarted) {
                            if (hasStarted !== undefined) {
                              // only update if this is a new value
                              if (this.hasStarted_ !== hasStarted) {
                                this.hasStarted_ = hasStarted;
                        Severity: Minor
                        Found in src/js/player.js - About 35 mins to fix

                        Cognitive Complexity

                        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                        A method's cognitive complexity is based on a few simple rules:

                        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                        • Code is considered more complex for each "break in the linear flow of the code"
                        • Code is considered more complex when "flow breaking structures are nested"

                        Further reading

                        Function dimension has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                          dimension(dimension, value) {
                            let privDimension = dimension + '_';
                        
                            if (value === undefined) {
                              return this[privDimension] || 0;
                        Severity: Minor
                        Found in src/js/player.js - About 25 mins to fix

                        Cognitive Complexity

                        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                        A method's cognitive complexity is based on a few simple rules:

                        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                        • Code is considered more complex for each "break in the linear flow of the code"
                        • Code is considered more complex when "flow breaking structures are nested"

                        Further reading

                        Function selectSource has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                          selectSource(sources) {
                            // Get only the techs specified in `techOrder` that exist and are supported by the
                            // current platform
                            let techs =
                              this.options_.techOrder
                        Severity: Minor
                        Found in src/js/player.js - About 25 mins to fix

                        Cognitive Complexity

                        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                        A method's cognitive complexity is based on a few simple rules:

                        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                        • Code is considered more complex for each "break in the linear flow of the code"
                        • Code is considered more complex when "flow breaking structures are nested"

                        Further reading

                        Function requestFullscreen has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                          requestFullscreen() {
                            var fsApi = FullscreenApi;
                        
                            this.isFullscreen(true);
                        
                        
                        Severity: Minor
                        Found in src/js/player.js - About 25 mins to fix

                        Cognitive Complexity

                        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                        A method's cognitive complexity is based on a few simple rules:

                        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                        • Code is considered more complex for each "break in the linear flow of the code"
                        • Code is considered more complex when "flow breaking structures are nested"

                        Further reading

                        Function duration has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                          duration(seconds) {
                            if (seconds === undefined) {
                              return this.cache_.duration || 0;
                            }
                        
                        
                        Severity: Minor
                        Found in src/js/player.js - About 25 mins to fix

                        Cognitive Complexity

                        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                        A method's cognitive complexity is based on a few simple rules:

                        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                        • Code is considered more complex for each "break in the linear flow of the code"
                        • Code is considered more complex when "flow breaking structures are nested"

                        Further reading

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

                          videoTracks() {
                            // if we have not yet loadTech_, we create videoTracks_
                            // these will be passed to the tech during loading
                            if (!this.tech_) {
                              this.videoTracks_ = this.videoTracks_ || new VideoTrackList();
                        Severity: Major
                        Found in src/js/player.js and 1 other location - About 1 hr to fix
                        src/js/player.js on lines 2542..2551

                        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

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

                          audioTracks() {
                            // if we have not yet loadTech_, we create videoTracks_
                            // these will be passed to the tech during loading
                            if (!this.tech_) {
                              this.audioTracks_ = this.audioTracks_ || new AudioTrackList();
                        Severity: Major
                        Found in src/js/player.js and 1 other location - About 1 hr to fix
                        src/js/player.js on lines 2524..2533

                        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

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

                                if (bool) {
                                  this.removeClass('vjs-controls-disabled');
                                  this.addClass('vjs-controls-enabled');
                                  this.trigger('controlsenabled');
                        
                        
                        Severity: Major
                        Found in src/js/player.js and 1 other location - About 1 hr to fix
                        src/js/player.js on lines 2151..2159

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

                        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

                                } else {
                                  this.removeClass('vjs-controls-enabled');
                                  this.addClass('vjs-controls-disabled');
                                  this.trigger('controlsdisabled');
                        
                        
                        Severity: Major
                        Found in src/js/player.js and 1 other location - About 1 hr to fix
                        src/js/player.js on lines 2143..2151

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

                        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

                          isFullscreen(isFS) {
                            if (isFS !== undefined) {
                              this.isFullscreen_ = !!isFS;
                              return this;
                            }
                        Severity: Minor
                        Found in src/js/player.js and 1 other location - About 55 mins to fix
                        src/js/player.js on lines 2457..2464

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

                        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

                          isAudio(bool) {
                            if (bool !== undefined) {
                              this.isAudio_ = !!bool;
                              return this;
                            }
                        Severity: Minor
                        Found in src/js/player.js and 1 other location - About 55 mins to fix
                        src/js/player.js on lines 1583..1589

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

                        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

                          handleFullscreenChange_() {
                            if (this.isFullscreen()) {
                              this.addClass('vjs-fullscreen');
                            } else {
                              this.removeClass('vjs-fullscreen');
                        Severity: Minor
                        Found in src/js/player.js and 1 other location - About 50 mins to fix
                        src/js/control-bar/playback-rate-menu/playback-rate-menu-button.js on lines 141..147

                        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

                        There are no issues that match your filters.

                        Category
                        Status