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) {
- Read upRead up
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]);
- Read upRead up
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]);
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;
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;
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) {
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;
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);
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);
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);
- Read upRead up
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;
Function play
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Player.prototype.play = function() {
if (this.timerId) {
return;
}
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)
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;
- Read upRead up
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) {
Function AppearanceDetector
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function AppearanceDetector(element, top_margin, bottom_margin, didAppear, didDisappear) {
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;
- Read upRead up
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"