Showing 139 of 221 total issues
Function constructor
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
constructor(tracks = []) {
let list;
// make sure only 1 track is enabled
// sorted from last index to first index
- 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 off
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
export function off(elem, type, fn) {
// Don't want to add a cache object through getElData if not needed
if (!Dom.hasElData(elem)) return;
let data = Dom.getElData(elem);
- 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 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_();
- 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 FlashRtmpDecorator
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
function FlashRtmpDecorator(Flash) {
Flash.streamingFormats = {
'rtmp/mp4': 'MP4',
'rtmp/flv': 'FLV'
};
- 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 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
Function handleLateInit_
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
handleLateInit_(el) {
if (el.networkState === 0 || el.networkState === 3) {
// The video element hasn't started loading the source yet
// or didn't find a source
return;
Function createMenu
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
createMenu() {
let tracks = this.player_.textTracks() || [];
let chaptersTrack;
let items = this.items = [];
- 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 listenForUserActivity_
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
listenForUserActivity_() {
let mouseInProgress, lastMoveX, lastMoveY;
let handleActivity = Fn.bind(this, this.reportUserActivity);
Function emitTapEvents
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
emitTapEvents() {
// Track the start time so we can determine how long the touch lasted
let touchStart = 0;
let firstTouch = null;
Function addChild
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
addChild(child, options={}, index=this.children_.length) {
let component;
let componentName;
// If child is a string, create nt with options
Function constructor
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(options = {}) {
super();
let readyState,
trackElement = this;
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
Function constructor
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(player, options, ready){
super(player, options, ready);
player.on('loadstart', Fn.bind(this, this.toggleDisplay));
player.on('texttrackchange', Fn.bind(this, this.updateDisplay));
Function constructor
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(player, options={}){
// Default to inline
if (options.inline === undefined) {
options.inline = true;
}
Function emulateTextTracks
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
emulateTextTracks() {
let tracks = this.textTracks();
if (!tracks) {
return;
}
Function patchCanPlayType
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Html5.patchCanPlayType = function() {
// Android 4.0 and above can play HLS to some extent but it reports being unable to do so
if (browser.ANDROID_VERSION >= 4.0) {
if (!canPlayType) {
canPlayType = Html5.TEST_VID.constructor.prototype.canPlayType;
- 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 trigger
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export function trigger(elem, event, hash) {
// Fetches element data and a reference to the parent (for bubbling).
// Don't want to add a data object to cache for every parent,
// so checking hasElData first.
var elemData = (Dom.hasElData(elem)) ? Dom.getElData(elem) : {};
- 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 getElAttributes
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export function getElAttributes(tag) {
var obj, knownBooleans, attrs, attrName, attrVal;
obj = {};
- 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 createEl
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
createEl() {
let el = this.options_.tag;
// Check if this browser supports moving the element into the box.
// On the iPhone video will break if you move the 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"
Further reading
Function constructor
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
constructor(player, options, ready){
super(player, options, ready);
// If there are no sources when the player is initialized,
// load the first supported playback technology.
- 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"