Showing 162 of 10,521 total issues
Function adsinitialized:playing,adtagurl,inlinevastxml
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
"adsinitialized:playing,adtagurl,inlinevastxml": function(playing, adsTagURL, inlineVastXML) {
if (this.get("adsinitialized")) {
if (this.__adInitilizeChecker) this.__adInitilizeChecker.clear();
return true;
}
Function __generateCompanionAdContent
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
__generateCompanionAdContent: function(companionads) {
companionads = companionads || this.get("companionads");
if (companionads && companionads.length > 0) {
const isMobile = this.get("mobileviewport");
if (
Function _started
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_started: function() {
if (!this.dyn.isFormatSupported() || !this.dyn.get("allowtrim") || this.dyn.get("duration") < this.dyn.get("timeminlimit")) {
if (!this.dyn.isFormatSupported()) {
this.dyn.set("allowtrim", false);
this.dyn.set("was_allowtrim", true);
Function stop
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
stop: function() {
var minlimit = this.dyn.get("timeminlimit");
if (minlimit) {
var delta = (Time.now() - this._startTime - this.__pauseDelta) / 1000;
if (delta < minlimit) {
Function _started
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_started: function() {
this.dyn.set("settingsvisible", false);
this.dyn.set("recordvisible", false);
this.dyn.set("rerecordvisible", false);
this.dyn.set("stopvisible", false);
Function _started
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_started: function() {
this.dyn.set("is_initial_state", true);
this.dyn.set("verified", false);
this.dyn.set("playbacksource", null);
this.dyn.set("playbackposter", null);
Function _showBackgroundSnapshot
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_showBackgroundSnapshot: function() {
if (this.get("onlyaudio"))
return;
this._hideBackgroundSnapshot();
if (this.get("snapshots") && this.get("selectfirstcovershotonskip")) {
Function _started
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_started: function() {
this.dyn.set("loadlabel", "");
this.dyn.trigger("verifying");
this.dyn.set("message", this.dyn.string("verifying") + "...");
this.dyn.set("playertopmessage", this.dyn.get("message"));
Function _setIMASettings
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_setIMASettings: function(options) {
const settings = options.IMASettings;
// google.ima.ImaSdkSettings.VpaidMode.DISABLED
// DISABLED == 0 - VPAID ads will not play, and an error will be returned.
// ENABLED == 1 - VPAID ads are enabled using a cross-domain iframe
Function __unmuteOnClick
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
__unmuteOnClick: function() {
clearTimeout(this.get('clearDebounce'));
const clearDebounce = setTimeout(function() {
if (!this.get("muted") && this.get("volume") > 0) {
return this.set("unmuteonclick", false);
Function _bindMedia
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_bindMedia: function() {
if (this._bound || !this.recorderAttached() || !this.recorder)
return;
this.recorder.ready.success(function() {
this.recorder.on("require_display", function() {
Function startUpdateVolume
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
startUpdateVolume: function(args, element) {
var event = args[0];
var moveEvent = event.type === "mousedown" ? "mousemove" : "touchmove";
var stopEvent = event.type === "mousedown" ? "mouseup" : "touchend";
var domRect = element.getBoundingClientRect();
Function loadImageSnapshot
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
loadImageSnapshot: function(image, snapshotindex) {
if (image.snapshotDisplay) {
if (this.parent().recorder)
this.parent().recorder.removeSnapshotDisplay(image.snapshotDisplay);
else
Function startUpdateVolume
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
startUpdateVolume: function(args, element) { // TODO this was copied from the video player, should refactor to keep it DRY
var event = args[0];
var moveEvent = event.type === "mousedown" ? "mousemove" : "touchmove";
var stopEvent = event.type === "mousedown" ? "mouseup" : "touchend";
var domRect = element.getBoundingClientRect();
Function fitFrameViewOnScreenVideo
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
fitFrameViewOnScreenVideo: function() {
// It will be accessible when at least one of the
// EventListeners will be fired
var vts = this.recorder._recorder._videoTrackSettings;
Function setNextOutstreamAdTagURL
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
setNextOutstreamAdTagURL: function(immediate, stateContext, nextState) {
immediate = immediate || false;
// if we have set nextadtagurls, then we will try to load next adtagurl
this.getNextOutstreamAdTagURLs(immediate)
.success(function(response) {
Function initSidebarGallery
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
initSidebarGallery: function() {
this.set("states.gallerysidebar", this.get("gallerysidebar"));
if (this.get("adsplaying")) return;
this.__sidebarGalleryInited = true;
Consider simplifying this complex logical expression. Open
Open
if (!window.requestAnimationFrame) {
window.requestAnimationFrame = (function() {
return window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
window.oRequestAnimationFrame ||
Consider simplifying this complex logical expression. Open
Open
if (
(this.get("floatingoptions.desktop.companionad") && !isMobile) ||
(this.get("floatingoptions.mobile.companionad") && isMobile) ||
(this.get("gallerysidebar") && this.get("sidebaroptions.showcompanionad") && !isMobile)
) {
Avoid deeply nested control flow statements. Open
Open
if (item < 100 && item > 0) {
this.get("midrollads").push({
position: parseFloat((item / 100).toFixed(2))
});
}