Showing 162 of 10,521 total issues
Function initMidRollAds
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
initMidRollAds: function() {
var schedules;
// Split all via comma exclude inside brackets
schedules = Objs.map(this.get("adsposition").split(/(?![^)(]*\([^)(]*?\)\)),(?![^\[]*\])/), function(item) {
return item.trim();
Function finalizeTranslation
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var finalizeTranslation = function (sourceFile, targetFolder, targetLang) {
var yaml = require("js-yaml");
var loadLocale = function (filename) {
var raw = yaml.load(grunt.file.read(filename));
File states.js
has 266 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
Scoped.define("module:AudioPlayer.Dynamics.PlayerStates.State", [
"base:States.State",
"base:Events.ListenMixin",
"base:Objs"
], function(State, ListenMixin, Objs, scoped) {
Function selectUpload
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
selectUpload: function(file) {
if (!(Info.isMobile() && Info.isAndroid() && Info.isCordova())) {
if (this.dyn.get("allowedextensions")) {
var filename = (file.files[0].name || "").toLowerCase();
var found = false;
Function _bindMedia
has 59 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 _loadTrackTags
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_loadTrackTags: function() {
if (!this._dyn.get("tracktagssupport")) return;
var _flag = true;
Objs.iter(this._trackTags, function(subtitle, index) {
var _trackTag = document.createElement("track");
Function _started
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_started: function() {
this.dyn.set("settingsvisible", true);
this.dyn.set("recordvisible", true);
this.dyn.set("rerecordvisible", false);
this.dyn.set("stopvisible", false);
Function _initEventListeners
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_initEventListeners: function() {
var lastX, lastY, diffX, diffY;
this.events.on(this.element, "mousedown", mouseDownHandler, this);
this.events.on(this.element, "touchstart", touchStartHandler, this);
Function exports
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
Open
module.exports = function(grunt) {
var pkg = grunt.file.readJSON('package.json');
var gruntHelper = require('betajs-compile');
var dist = 'betajs-media-components';
- 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 selectUpload
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
selectUpload: function(file) {
if (!(Info.isMobile() && Info.isAndroid() && Info.isCordova())) {
if (this.dyn.get("allowedextensions")) {
var filename = (file.files[0].name || "").toLowerCase();
var found = false;
Function _started
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_started: function() {
if (this.dyn.get("adshassource")) {
if (this._triggerLoadAds()) {
if (this.dyn.get("fullscreened") && (Info.isMobile() && Info.isiOS())) {
if (this.dyn.get("adsplayer_active")) this.dyn.set("adsplayer_active", false)
Function _started
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_started: function() {
this.dyn.set("autoplay", false);
if (this.dyn.get("adshassource")) {
// As during a loop, we will play player after ended event fire, need initial cover will be hidden
this.listenOn(this.dyn.channel("ads"), "contentPauseRequested", function() {
Function _timerFire
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_timerFire: function() {
if (this.destroyed())
return;
try {
this.set("mobileviewport", this.__isInMobileViewport());
Function create
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
create: function() {
var dynamics = this.parent();
var adContainer = this.getAdContainer();
var adManagerOptions = {
adContainer: adContainer,
File settings_menu.js
has 253 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
Scoped.define("module:Common.Dynamics.Settingsmenu", [
"dynamics:Dynamic",
"base:Objs",
"base:Async",
"base:Timers.Timer",
Function progressUpdatePosition
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
progressUpdatePosition: function(event) {
var _dyn = this.__parent;
// Mouse or Touch Event
var clientX = event.clientX === 0 ? 0 : event.clientX || event.targetTouches[0].clientX;
Function initializeVisualEffect
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
initializeVisualEffect: function() {
try {
var _source;
if (this.recorder) {
this._analyser = this.recorder._analyser;
Function _bindMedia
has 47 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() {
if (!this.recorder) return;
Function __performanceObserverFunc
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
__performanceObserverFunc: function(list) {
list.getEntries().forEach((entry) => {
let name;
switch (entry.entryType) {
case `navigation`:
Function _add_new_stream
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_add_new_stream: function(deviceId) {
var _selected;
var _currentTracks = this.recorder._recorder.stream().getTracks();
this.get("cameras").iterate(function(videoDevice) {
var _videoDevice = videoDevice.data();