harella1/video.js

View on GitHub

Showing 139 of 221 total issues

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

  updateDisplay() {
    var tracks = this.player_.textTracks();

    this.clearDisplay();

Severity: Minor
Found in src/js/tracks/text-track-display.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 constructor has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  constructor(player, options={}){
    // Default to inline
    if (options.inline === undefined) {
      options.inline = true;
    }
Severity: Minor
Found in src/js/control-bar/volume-menu-button.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 constructor has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  constructor(options = {}) {
    let settings = merge(options, {
      kind: AudioTrackKind[options.kind] || ''
    });
    // on IE8 this will be a document element
Severity: Minor
Found in src/js/tracks/audio-track.js - About 1 hr to fix

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

      const parseCues = function(srcContent, track) {
        let parser = new window.WebVTT.Parser(window,
                                              window.vttjs,
                                              window.WebVTT.StringDecoder());
        let errors = [];
      Severity: Minor
      Found in src/js/tracks/text-track.js - About 1 hr to fix

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

          constructor(options={}, ready=function(){}){
            // we don't want the tech to report user activity automatically.
            // This is done manually in addControlsListeners
            options.reportTouchActivity = false;
            super(null, options, ready);
        Severity: Minor
        Found in src/js/tech/tech.js - About 1 hr to fix

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

          Flash.getEmbedCode = function(swf, flashVars, params, attributes){
            const objTag = '<object type="application/x-shockwave-flash" ';
            let flashVarsString = '';
            let paramsString = '';
            let attrsString = '';
          Severity: Minor
          Found in src/js/tech/flash.js - About 1 hr to fix

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

              constructor(options = {}) {
                let settings = merge(options, {
                  kind: VideoTrackKind[options.kind] || ''
                });
            
            
            Severity: Minor
            Found in src/js/tracks/video-track.js - About 1 hr to fix

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

              export const parseUrl = function(url) {
                const props = ['protocol', 'hostname', 'port', 'pathname', 'search', 'hash', 'host'];
              
                // add the url to an anchor and let the browser parse the URL
                let a = document.createElement('a');
              Severity: Minor
              Found in src/js/utils/url.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 addRemoteTextTrack has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    addRemoteTextTrack(options={}) {
                      if (!this['featuresNativeTextTracks']) {
                        return super.addRemoteTextTrack(options);
                      }
                  
                  
                  Severity: Minor
                  Found in src/js/tech/html5.js - About 1 hr to fix

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

                      getValues() {
                        const textEdge = getSelectedOptionValue(this.$('.vjs-edge-style select'));
                        const fontFamily = getSelectedOptionValue(this.$('.vjs-font-family select'));
                        const fgColor = getSelectedOptionValue(this.$('.vjs-fg-color > select'));
                        const textOpacity = getSelectedOptionValue(this.$('.vjs-text-opacity > select'));
                    Severity: Minor
                    Found in src/js/tracks/text-track-settings.js - About 1 hr to fix

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

                        createEl() {
                          let options = this.options_;
                      
                          // If video.js is hosted locally you should also set the location
                          // for the hosted swf, which should be relative to the page (not video.js)
                      Severity: Minor
                      Found in src/js/tech/flash.js - About 1 hr to fix

                        Function emulateTextTracks has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                          emulateTextTracks() {
                            let tracks = this.textTracks();
                            if (!tracks) {
                              return;
                            }
                        Severity: Minor
                        Found in src/js/tech/tech.js - About 55 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 extendFn has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                        const extendFn = function(superClass, subClassMethods={}) {
                          let subClass = function() {
                            superClass.apply(this, arguments);
                          };
                          let methods = {};
                        Severity: Minor
                        Found in src/js/extend.js - About 55 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 constructor has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                          constructor(options = {}) {
                            super();
                        
                            let track = this;
                            if (browser.IS_IE8) {
                        Severity: Minor
                        Found in src/js/tracks/track.js - About 55 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 open has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                          open() {
                            if (!this.opened_) {
                              let player = this.player();
                        
                              this.trigger('beforemodalopen');
                        Severity: Minor
                        Found in src/js/modal-dialog.js - About 45 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 ready has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                          ready(fn, sync=false) {
                            if (fn) {
                              if (this.isReady_) {
                                if (sync) {
                                  fn.call(this);
                        Severity: Minor
                        Found in src/js/component.js - About 45 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

                        Severity
                        Category
                        Status
                        Source
                        Language