yoheimuta/mobile-videoplayer.js

View on GitHub

Showing 17 of 17 total issues

Function Player has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

MVPlayer.Player = (function() {
    var Util = MVPlayer.Util;

    function Player(ele, is_debug) {

Severity: Minor
Found in src/player.js - About 4 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 MultiStrip has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
Open

MVPlayer.MultiStrip = (function() {
    function MultiStrip(width, height, elements) {
        this.strips = [];
        for (var i = 0; i < elements.length; i++) {
            var strip = new MVPlayer.Strip(width, height, elements[i]);
Severity: Minor
Found in src/multi_strip.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 MultiStrip has 84 lines of code (exceeds 25 allowed). Consider refactoring.
Open

MVPlayer.MultiStrip = (function() {
    function MultiStrip(width, height, elements) {
        this.strips = [];
        for (var i = 0; i < elements.length; i++) {
            var strip = new MVPlayer.Strip(width, height, elements[i]);
Severity: Major
Found in src/multi_strip.js - About 3 hrs to fix

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

    MVPlayer.Controller = (function() {
        var Controller = {};
        var Util = MVPlayer.Util;
    
        var _is_appear = false;
    Severity: Major
    Found in src/controller.js - About 3 hrs to fix

      Function Strip has 69 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      MVPlayer.Strip = (function() {
          var Util = MVPlayer.Util;
      
          function Strip(width, height, element) {
              this.width       = width;
      Severity: Major
      Found in src/strip.js - About 2 hrs to fix

        Function Player has 67 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        MVPlayer.Player = (function() {
            var Util = MVPlayer.Util;
        
            function Player(ele, is_debug) {
        
        
        Severity: Major
        Found in src/player.js - About 2 hrs to fix

          Function PlayerEventDispatcher has 59 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          MVPlayer.PlayerEventDispatcher = (function() {
              function PlayerEventDispatcher(is_debug, did_start_url, did_resume_url, did_complete_url,
                  first_quartile_url, midpoint_url, third_quartile_url, did_pause_url)
              {
                  this.is_debug           = is_debug;
          Severity: Major
          Found in src/player_event_dispatcher.js - About 2 hrs to fix

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

            MVPlayer.Util = (function() {
                var Util = {};
            
                Util.getFromDataSet = function(element, attr_name) {
                    return element.getAttribute("data-" + attr_name);
            Severity: Minor
            Found in src/util.js - About 1 hr to fix

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

                  function _setupEvents(element, player, loadElement, replayElement, doneElement) {
                      (function(didComplete) {
                          player.dispatcher.didComplete = function() {
                              didComplete.call(player.dispatcher);
              
              
              Severity: Minor
              Found in src/controller.js - About 1 hr to fix

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

                MVPlayer.Util = (function() {
                    var Util = {};
                
                    Util.getFromDataSet = function(element, attr_name) {
                        return element.getAttribute("data-" + attr_name);
                Severity: Minor
                Found in src/util.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 AppearanceDetector has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                MVPlayer.AppearanceDetector = (function() {
                    var Util = MVPlayer.Util;
                
                    function AppearanceDetector(element, top_margin, bottom_margin, didAppear, didDisappear) {
                        this.element       = element;
                Severity: Minor
                Found in src/appearance_detector.js - About 1 hr to fix

                  Function play has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      Player.prototype.play = function() {
                          if (this.timerId) {
                              return;
                          }
                  
                  
                  Severity: Minor
                  Found in src/player.js - About 1 hr to fix

                    Function PlayerEventDispatcher has 8 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        function PlayerEventDispatcher(is_debug, did_start_url, did_resume_url, did_complete_url,
                            first_quartile_url, midpoint_url, third_quartile_url, did_pause_url)
                    Severity: Major
                    Found in src/player_event_dispatcher.js - About 1 hr to fix

                      Function PlayerEventDispatcher has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                      MVPlayer.PlayerEventDispatcher = (function() {
                          function PlayerEventDispatcher(is_debug, did_start_url, did_resume_url, did_complete_url,
                              first_quartile_url, midpoint_url, third_quartile_url, did_pause_url)
                          {
                              this.is_debug           = is_debug;
                      Severity: Minor
                      Found in src/player_event_dispatcher.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 _setupEvents has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          function _setupEvents(element, player, loadElement, replayElement, doneElement) {
                      Severity: Minor
                      Found in src/controller.js - About 35 mins to fix

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

                            function AppearanceDetector(element, top_margin, bottom_margin, didAppear, didDisappear) {
                        Severity: Minor
                        Found in src/appearance_detector.js - About 35 mins to fix

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

                          MVPlayer.AppearanceDetector = (function() {
                              var Util = MVPlayer.Util;
                          
                              function AppearanceDetector(element, top_margin, bottom_margin, didAppear, didDisappear) {
                                  this.element       = element;
                          Severity: Minor
                          Found in src/appearance_detector.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

                          Severity
                          Category
                          Status
                          Source
                          Language