Showing 55 of 91 total issues
Function generateAnnouncement
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports.generateAnnouncement = function(service, serviceInfo, host, web, api, channel) {
var ann = new Announcement(service)
ann.host = host
if (web.asset)
ann.asset = web.asset
Function prepareBundleInfo
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports.prepareBundleInfo = function(assetInfo, publicPath, bundleOptions) {
// Prepare bundleOptions for jspm/systemjs builder
bundleOptions.name = assetInfo.name
bundleOptions = getDefaultBundleOptions(bundleOptions)
Function normalizeRoutes
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports.normalizeRoutes = function(route, page, pageApiBaseUrl) {
var _routes = {}
Object.keys(route).forEach(function(routePath) {
var middleware
Function getDefaultBundleOptions
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function getDefaultBundleOptions(opts, env) {
opts = opts || {}
var _opts = {
bundleDeps: false,
outFile: 'bundle' + (opts.name ? '-' + opts.name : '') + '.js',
Function getAssetInfo
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports.getAssetInfo = function(packagePath, packageJSON, serviceName) {
serviceName = serviceName || ''
var assetInfo
var publicURL
Function checkAvailability
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function checkAvailability() {
var now = Date.now()
remoteServices.forEach(function(service) {
var scheduler = service.scheduler
scheduler.each(function(ann) {
Function buildServiceFromAnnouncement
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports.buildServiceFromAnnouncement = function(ann) {
logger.info('Build remote service from announcement', {
service: ann.name,
version: ann.version
}).trace(ann)
Function listen
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports.listen = function(options, callback) {
var port = options.MICROMONO_DISCOVERY_UDP_PORT || PORT
var address = options.MICROMONO_DISCOVERY_UDP_ADDRESS || ADDRESS
logger.info('Listening service annoucements using udp multicast', {
Function useMiddleware
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ExpressAdapter.prototype.useMiddleware = function(url, middleware, routes, service) {
if (!Array.isArray(url))
url = [url]
var app = this.app
Function getJSPMConfig
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports.getJSPMConfig = function(assetInfo, publicPath, next) {
var configPath = path.join(publicPath, 'config.js')
logger.debug('getJSPMConfig', {
configPath: configPath
Function localRequire
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports.localRequire = function(serviceName, serviceDir, services) {
var ServiceClass
var servicePath = serviceName
try {
Function announce
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports.announce = function(data, options, interval) {
options = assign({}, NATS_DEFAULT_OPTIONS, options)
interval = interval || options.MICROMONO_DISCOVERY_ANNOUNCE_INTERVAL || 3000
logger.info('Announcing service using nats pubsub', {
Function createChannelAdapters
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports.createChannelAdapters = function(channels, service) {
logger.debug('createChannelAdapters', {
service: service.name
}).trace(channels)
Function setDefaultChannelHandlers
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports.setDefaultChannelHandlers = function(channel) {
if (!channel.auth) {
logger.warn('Please define `auth` property in channel to set your own auth handler function. All requests will be allowed by default.')
channel.auth = function(session, next) {
next()
Function mergeAssetDependencies
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports.mergeAssetDependencies = function(dstAssetInfo, srcAssetInfo) {
var assetDependenciesChanged = undefined
if (srcAssetInfo.dependencies) {
var srcDeps = srcAssetInfo.dependencies
Function connect
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
SocketMQAdapter.prototype.connect = function(provider) {
var self = this
var adapter = this.adapter
var name = provider.name
var endpoint = 'tcp://' + provider.host + ':' + provider.api.port
Function MicromonoRPC
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var RPC = module.exports = function MicromonoRPC(options) {
logger.info('Initialize MicromonoRPC', {
type: options.type,
isRemote: options.isRemote
}).trace(options)
Function startChnBackendServer
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports.startChnBackendServer = function(channels, chnBackend, chnEndpoint, next) {
logger.debug('startChnBackendServer').trace({
chnEndpoint: chnEndpoint,
channels
})
Function attachRoutes
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ExpressAdapter.prototype.attachRoutes = function(routes, service) {
var app = this.app
Object.keys(routes).forEach(function(routeName) {
var route = routes[routeName]
Function attachChannelHooks
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports.attachChannelHooks = function(chnAdapter, channel, chnJoinHook, chnAllowHook) {
logger.debug('attachChannelHooks').trace(channel)
var allowHook = function(pack, stream, dispatch) {
if (REQ === pack.type) {