Showing 34 of 71 total issues
Function prototype
has 434 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
Function prototype
has 328 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
File PostMessageChannel.js
has 468 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
;(function (root, chronosRoot, factory) {
"use strict";
/* istanbul ignore if */
//<amd>
Function Events
has 153 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function Events(defaults) {
var appName = "Events",
attrName = "eventName",
eventId = 0,
lstnrs = {},
File PostMessageCourier.js
has 375 lines of code (exceeds 250 allowed). Consider refactoring. Open
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.
Function ReqRes
has 99 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function ReqRes(defaults) {
var appName = "ReqRes",
attrName = "reqName",
requestId = 0,
requests = {},
Function Commands
has 97 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function Commands(defaults) {
var appName = "Commands",
attrName = "cmdName",
commandId = 0,
commands = {},
Function prototype
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
Function prototype
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
Function Channels
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function Channels(options) {
options = options || {};
var externalAPIS = [];
Function prototype
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
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)
*/
Function bind
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function bind(app, ev, fn) {
var evData = app;
if ("string" === typeof app) {
evData = {
Function _createIFrame
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
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 = {
Consider simplifying this complex logical expression. Open
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
Function request
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
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");
Function _createMessageHandler
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function _createMessageHandler(mapping) {
return function(message) {
var handler;
var result;
var params;
Function command
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
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;
}
Function _getHandleMessage
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function _getHandleMessage(handler) {
return function(event) {
var handshake;
var previous;
Function trigger
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function trigger(app, evName, data) {
var triggerData = app;
if ("string" === typeof app) {
triggerData = {
eventName: evName,
Function _handshake
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function _handshake(retry) {
// Remove load handler if needed
_removeTimer.call(this, true);
if (!this.disposed && !this.ready) {