LivePersonInc/chronosjs

View on GitHub

Showing 34 of 71 total issues

Function prototype has 434 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    PostMessageChannel.prototype = (function () {
        /**
         * Method for initialization
         * @param {Object} options the configuration options for the instance
         * @param {Object} options.target - the target iframe or iframe configuration
Severity: Major
Found in src/courier/PostMessageChannel.js - About 2 days to fix

    Function prototype has 328 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            PostMessageCourier.prototype = (function () {
                /**
                 * Method for initialization
                 * @param {Object} options - the configuration options for the instance
                 * @param {Object} options.target - the target iframe or iframe configuration
    Severity: Major
    Found in src/courier/PostMessageCourier.js - About 1 day to fix

      File PostMessageChannel.js has 468 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      ;(function (root, chronosRoot, factory) {
          "use strict";
      
          /* istanbul ignore if  */
          //<amd>
      Severity: Minor
      Found in src/courier/PostMessageChannel.js - About 7 hrs to fix

        Function Events has 153 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function Events(defaults) {
                var appName = "Events",
                    attrName = "eventName",
                    eventId = 0,
                    lstnrs = {},
        Severity: Major
        Found in src/Events.js - About 6 hrs to fix

          File PostMessageCourier.js has 375 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /**
           * LIMITATIONS:
           * 1) Only supports browsers which implements postMessage API and have native JSON implementation (IE8+, Chrome, FF, Safari, Opera, IOS, Opera Mini, Android)
           * 2) IE9-, FF & Opera Mini does not support MessageChannel and therefore we fallback to using basic postMessage.
           *    This makes the communication opened to any handler registered for messages on the same origin.
          Severity: Minor
          Found in src/courier/PostMessageCourier.js - About 5 hrs to fix

            Function ReqRes has 99 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function ReqRes(defaults) {
                    var appName = "ReqRes",
                        attrName = "reqName",
                        requestId = 0,
                        requests = {},
            Severity: Major
            Found in src/Reqres.js - About 3 hrs to fix

              Function Commands has 97 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function Commands(defaults) {
                      var appName = "Commands",
                          attrName = "cmdName",
                          commandId = 0,
                          commands = {},
              Severity: Major
              Found in src/Commands.js - About 3 hrs to fix

                Function prototype has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    PostMessagePromise.prototype = (function () {
                        /**
                         * Method for initialization
                         * @param {Function} [executor] - optional method to be invoked during initialization that will have
                         *                   arguments of resolve and reject according to ES6 Promise A+ spec
                Severity: Major
                Found in src/courier/PostMessagePromise.js - About 2 hrs to fix

                  Function prototype has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      PostMessageChannelPolyfill.prototype = (function () {
                          /**
                           * Method for initialization
                           * @param {Object} target - The DOM node of the target iframe or window
                           * @param {Object} [options] the configuration options for the instance
                  Severity: Major
                  Found in src/courier/PostMessageChannelPolyfill.js - About 2 hrs to fix

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

                        function Channels(options) {
                            options = options || {};
                    
                            var externalAPIS = [];
                    
                    
                    Severity: Major
                    Found in src/Channels.js - About 2 hrs to fix

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

                          PostMessageMapper.prototype = (function () {
                              /**
                               * Method for initialization
                               * @param {Channels} [eventChannel] - the event channel on which events/commands/requests will be bind/triggered (must implement the Channels API)
                               */
                      Severity: Minor
                      Found in src/courier/PostMessageMapper.js - About 1 hr to fix

                        Function bind has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                function bind(app, ev, fn) {
                                    var evData = app;
                        
                                    if ("string" === typeof app) {
                                        evData = {
                        Severity: Minor
                        Found in src/Events.js - About 1 hr to fix

                          Function _createIFrame has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  function _createIFrame(options, container) {
                                      var frame = document.createElement("IFRAME");
                                      var name = PostMessageUtilities.createUniqueSequence(IFRAME_PREFIX + PostMessageUtilities.SEQUENCE_FORMAT);
                                      var delay = options.delayLoad;
                                      var defaultAttributes = {
                          Severity: Minor
                          Found in src/courier/PostMessageChannel.js - About 1 hr to fix

                            Consider simplifying this complex logical expression.
                            Open

                                    if (listeners && listeners.length) {
                                        for (var i = 0; i < listeners.length; i++) {
                                            try {
                                                var sameFunc = (!context && listeners[i].func === func);//If this fits the function and no context was passed
                                                var sameContext = (!func && context && listeners[i].context === context);//If this fits the context and no function was passed
                            Severity: Critical
                            Found in src/util/EventsUtil.js - About 1 hr to fix

                              Function request has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                      function request(req, cb) {
                                          var ret;
                                          if (!req || typeof (req.reqName) === "undefined" || !cmdUtil.valid(req, req.reqName)) {
                                              evUtil.log("request: name not spec for command", "ERROR", "ReqRes");
                                              throw new Error("Invalid request object");
                              Severity: Minor
                              Found in src/Reqres.js - About 1 hr to fix

                                Function _createMessageHandler has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                            function _createMessageHandler(mapping) {
                                                return function(message) {
                                                    var handler;
                                                    var result;
                                                    var params;
                                Severity: Minor
                                Found in src/courier/PostMessageCourier.js - About 1 hr to fix

                                  Function command has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                          function command(cmd, cb) {
                                              if (!cmd || typeof (cmd.cmdName) === "undefined" || !cmdUtil.valid(cmd, cmd.cmdName)) {
                                                  evUtil.log("CMD name not spec for command", "ERROR", "Commands");
                                                  return null;
                                              }
                                  Severity: Minor
                                  Found in src/Commands.js - About 1 hr to fix

                                    Function _getHandleMessage has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                            function _getHandleMessage(handler) {
                                                return function(event) {
                                                    var handshake;
                                                    var previous;
                                    
                                    
                                    Severity: Minor
                                    Found in src/courier/PostMessageChannel.js - About 1 hr to fix

                                      Function trigger has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                              function trigger(app, evName, data) {
                                                  var triggerData = app;
                                                  if ("string" === typeof app) {
                                                      triggerData = {
                                                          eventName: evName,
                                      Severity: Minor
                                      Found in src/Events.js - About 1 hr to fix

                                        Function _handshake has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                                function _handshake(retry) {
                                                    // Remove load handler if needed
                                                    _removeTimer.call(this, true);
                                        
                                                    if (!this.disposed && !this.ready) {
                                        Severity: Minor
                                        Found in src/courier/PostMessageChannel.js - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language