Showing 139 of 221 total issues
Function on
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
export function on(elem, type, fn){
if (Array.isArray(type)) {
return _handleMultipleEvents(on, elem, type, fn);
}
- 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 autoSetup
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
var autoSetup = function(){
// One day, when we stop supporting IE8, go back to this, but in the meantime...*hack hack hack*
// var vids = Array.prototype.slice.call(document.getElementsByTagName('video'));
// var audios = Array.prototype.slice.call(document.getElementsByTagName('audio'));
// var mediaEls = vids.concat(audios);
- 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 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
loadTech_(techName, source) {
// Pause and remove current playback technology
if (this.tech_) {
this.unloadTech_();
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
Function updateForTrack
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
updateForTrack(track) {
if (typeof window['WebVTT'] !== 'function' || !track['activeCues']) {
return;
}
Function constructor
has a Cognitive Complexity of 19 (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
File flash.js
has 274 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* @file flash.js
* VideoJS-SWF - Custom Flash Player with HTML5-ish API
* https://github.com/zencoder/video-js-swf
* Not using setupTriggers. Using global onEvent func to distribute events
Function fixEvent
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function fixEvent(event) {
function returnTrue() { return true; }
function returnFalse() { return false; }
Function constructor
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(options, ready){
super(options, ready);
const source = options.source;
let crossoriginTracks = false;
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) {
- 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
File text-track-settings.js
has 266 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* @file text-track-settings.js
*/
import Component from '../component';
import * as Events from '../utils/events.js';
Function FlashRtmpDecorator
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
function FlashRtmpDecorator(Flash) {
Flash.streamingFormats = {
'rtmp/mp4': 'MP4',
'rtmp/flv': 'FLV'
};
File dom.js
has 262 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* @file dom.js
*/
import document from 'global/document';
import window from 'global/window';
Function initChildren
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
initChildren() {
let children = this.options_.children;
if (children) {
// `this` is `parent`
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();
Function videojs
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
let videojs = function(id, options, ready){
let tag; // Element of ID
// Allow for element or ID to be passed in
// String ID
- 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 initChildren
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
initChildren() {
let children = this.options_.children;
if (children) {
// `this` is `parent`
- 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 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
- 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 addChild
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
addChild(child, options={}, index=this.children_.length) {
let component;
let componentName;
// If child is a string, create nt with options
- 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 createMenu
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
createMenu() {
let tracks = this.player_.textTracks() || [];
let chaptersTrack;
let items = this.items = [];