betajs/betajs-media-components

View on GitHub

Showing 162 of 10,521 total issues

Function initMidRollAds has 60 lines of code (exceeds 25 allowed). Consider refactoring.
Open

                initMidRollAds: function() {
                    var schedules;
                    // Split all via comma exclude inside brackets
                    schedules = Objs.map(this.get("adsposition").split(/(?![^)(]*\([^)(]*?\)\)),(?![^\[]*\])/), function(item) {
                        return item.trim();
Severity: Major
Found in src/dynamics/video_player/player/player.js - About 2 hrs to fix

    Function finalizeTranslation has 60 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        var finalizeTranslation = function (sourceFile, targetFolder, targetLang) {
            var yaml = require("js-yaml");
    
            var loadLocale = function (filename) {
                var raw = yaml.load(grunt.file.read(filename));
    Severity: Major
    Found in Gruntfile.js - About 2 hrs to fix

      File states.js has 266 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      Scoped.define("module:AudioPlayer.Dynamics.PlayerStates.State", [
          "base:States.State",
          "base:Events.ListenMixin",
          "base:Objs"
      ], function(State, ListenMixin, Objs, scoped) {
      Severity: Minor
      Found in src/dynamics/audio_player/player/states.js - About 2 hrs to fix

        Function selectUpload has 59 lines of code (exceeds 25 allowed). Consider refactoring.
        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;
        Severity: Major
        Found in src/dynamics/audio_recorder/recorder/states.js - About 2 hrs to fix

          Function _bindMedia has 59 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                          _bindMedia: function() {
                              if (this._bound || !this.recorderAttached() || !this.recorder)
                                  return;
                              this.recorder.ready.success(function() {
                                  this.recorder.on("require_display", function() {
          Severity: Major
          Found in src/dynamics/audio_recorder/recorder/recorder.js - About 2 hrs to fix

            Function _loadTrackTags has 56 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                        _loadTrackTags: function() {
                            if (!this._dyn.get("tracktagssupport")) return;
                            var _flag = true;
                            Objs.iter(this._trackTags, function(subtitle, index) {
                                var _trackTag = document.createElement("track");
            Severity: Major
            Found in src/dynamics/_common/track_tags.js - About 2 hrs to fix

              Function _started has 56 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      _started: function() {
                          this.dyn.set("settingsvisible", true);
                          this.dyn.set("recordvisible", true);
                          this.dyn.set("rerecordvisible", false);
                          this.dyn.set("stopvisible", false);
              Severity: Major
              Found in src/dynamics/video_recorder/recorder/states.js - About 2 hrs to fix

                Function _initEventListeners has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                            _initEventListeners: function() {
                                var lastX, lastY, diffX, diffY;
                                this.events.on(this.element, "mousedown", mouseDownHandler, this);
                                this.events.on(this.element, "touchstart", touchStartHandler, this);
                
                
                Severity: Major
                Found in src/dynamics/_common/sticky_handler.js - About 2 hrs to fix

                  Function exports has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                  Open

                  module.exports = function(grunt) {
                  
                      var pkg = grunt.file.readJSON('package.json');
                      var gruntHelper = require('betajs-compile');
                      var dist = 'betajs-media-components';
                  Severity: Minor
                  Found in Gruntfile.js - About 2 hrs to fix

                  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

                          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;
                  Severity: Major
                  Found in src/dynamics/image_capture/capture/states.js - About 2 hrs to fix

                    Function _started has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                    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)
                    Severity: Major
                    Found in src/dynamics/video_player/player/states.js - About 2 hrs to fix

                      Function _started has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                      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() {
                      Severity: Major
                      Found in src/dynamics/video_player/player/states.js - About 2 hrs to fix

                        Function _timerFire has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                        _timerFire: function() {
                                            if (this.destroyed())
                                                return;
                                            try {
                                                this.set("mobileviewport", this.__isInMobileViewport());
                        Severity: Major
                        Found in src/dynamics/video_player/player/player.js - About 2 hrs to fix

                          Function create has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                          create: function() {
                                              var dynamics = this.parent();
                                              var adContainer = this.getAdContainer();
                                              var adManagerOptions = {
                                                  adContainer: adContainer,
                          Severity: Major
                          Found in src/dynamics/ads_player/ads_player.js - About 2 hrs to fix

                            File settings_menu.js has 253 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            Scoped.define("module:Common.Dynamics.Settingsmenu", [
                                "dynamics:Dynamic",
                                "base:Objs",
                                "base:Async",
                                "base:Timers.Timer",
                            Severity: Minor
                            Found in src/dynamics/_common/settings_menu/settings_menu.js - About 2 hrs to fix

                              Function progressUpdatePosition has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                                  progressUpdatePosition: function(event) {
                                                      var _dyn = this.__parent;
                              
                                                      // Mouse or Touch Event
                                                      var clientX = event.clientX === 0 ? 0 : event.clientX || event.targetTouches[0].clientX;
                              Severity: Minor
                              Found in src/dynamics/video_player/controlbar/controlbar.js - About 1 hr to fix

                                Function initializeVisualEffect has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                            initializeVisualEffect: function() {
                                                try {
                                                    var _source;
                                                    if (this.recorder) {
                                                        this._analyser = this.recorder._analyser;
                                Severity: Minor
                                Found in src/dynamics/_common/audio_visualization.js - About 1 hr to fix

                                  Function _bindMedia has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                                  _bindMedia: function() {
                                                      if (this._bound || !this.recorderAttached() || !this.recorder)
                                                          return;
                                                      this.recorder.ready.success(function() {
                                                          if (!this.recorder) return;
                                  Severity: Minor
                                  Found in src/dynamics/video_recorder/recorder/recorder.js - About 1 hr to fix

                                    Function __performanceObserverFunc has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                                    __performanceObserverFunc: function(list) {
                                                        list.getEntries().forEach((entry) => {
                                                            let name;
                                                            switch (entry.entryType) {
                                                                case `navigation`:
                                    Severity: Minor
                                    Found in src/dynamics/video_player/player/player.js - About 1 hr to fix

                                      Function _add_new_stream has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                                      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();
                                      Severity: Minor
                                      Found in src/dynamics/video_recorder/recorder/recorder.js - About 1 hr to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language