lsm/micromono

View on GitHub

Showing 55 of 91 total issues

Function generateAnnouncement has 34 lines of code (exceeds 25 allowed). Consider refactoring.
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
Severity: Minor
Found in lib/service/local.js - About 1 hr to fix

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

    exports.prepareBundleInfo = function(assetInfo, publicPath, bundleOptions) {
      // Prepare bundleOptions for jspm/systemjs builder
      bundleOptions.name = assetInfo.name
      bundleOptions = getDefaultBundleOptions(bundleOptions)
    
    
    Severity: Minor
    Found in lib/web/asset/bundle.js - About 1 hr to fix

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

      exports.normalizeRoutes = function(route, page, pageApiBaseUrl) {
        var _routes = {}
      
        Object.keys(route).forEach(function(routePath) {
          var middleware
      Severity: Minor
      Found in lib/web/router.js - About 1 hr to fix

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

        function getDefaultBundleOptions(opts, env) {
          opts = opts || {}
          var _opts = {
            bundleDeps: false,
            outFile: 'bundle' + (opts.name ? '-' + opts.name : '') + '.js',
        Severity: Minor
        Found in lib/web/asset/bundle.js - About 1 hr to fix

          Function getAssetInfo has 32 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          exports.getAssetInfo = function(packagePath, packageJSON, serviceName) {
            serviceName = serviceName || ''
          
            var assetInfo
            var publicURL
          Severity: Minor
          Found in lib/web/asset/pjson.js - About 1 hr to fix

            Function checkAvailability has 32 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              function checkAvailability() {
                var now = Date.now()
                remoteServices.forEach(function(service) {
                  var scheduler = service.scheduler
                  scheduler.each(function(ann) {
            Severity: Minor
            Found in lib/service/remote.js - About 1 hr to fix

              Function buildServiceFromAnnouncement has 32 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              exports.buildServiceFromAnnouncement = function(ann) {
                logger.info('Build remote service from announcement', {
                  service: ann.name,
                  version: ann.version
                }).trace(ann)
              Severity: Minor
              Found in lib/service/remote.js - About 1 hr to fix

                Function listen has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                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', {
                Severity: Minor
                Found in lib/discovery/udp.js - About 1 hr to fix

                  Function useMiddleware has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  ExpressAdapter.prototype.useMiddleware = function(url, middleware, routes, service) {
                    if (!Array.isArray(url))
                      url = [url]
                  
                    var app = this.app
                  Severity: Minor
                  Found in lib/web/framework/express.js - About 1 hr to fix

                    Function getJSPMConfig has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    exports.getJSPMConfig = function(assetInfo, publicPath, next) {
                      var configPath = path.join(publicPath, 'config.js')
                    
                      logger.debug('getJSPMConfig', {
                        configPath: configPath
                    Severity: Minor
                    Found in lib/web/asset/jspm.js - About 1 hr to fix

                      Function localRequire has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      exports.localRequire = function(serviceName, serviceDir, services) {
                        var ServiceClass
                        var servicePath = serviceName
                      
                        try {
                      Severity: Minor
                      Found in lib/discovery/index.js - About 1 hr to fix

                        Function announce has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                        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', {
                        Severity: Minor
                        Found in lib/discovery/nats.js - About 1 hr to fix

                          Function createChannelAdapters has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          exports.createChannelAdapters = function(channels, service) {
                            logger.debug('createChannelAdapters', {
                              service: service.name
                            }).trace(channels)
                          
                          
                          Severity: Minor
                          Found in lib/channel/backend.js - About 1 hr to fix

                            Function setDefaultChannelHandlers has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                            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()
                            Severity: Minor
                            Found in lib/channel/backend.js - About 1 hr to fix

                              Function mergeAssetDependencies has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              exports.mergeAssetDependencies = function(dstAssetInfo, srcAssetInfo) {
                                var assetDependenciesChanged = undefined
                              
                                if (srcAssetInfo.dependencies) {
                                  var srcDeps = srcAssetInfo.dependencies
                              Severity: Minor
                              Found in lib/web/asset/pjson.js - About 1 hr to fix

                                Function connect has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                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
                                Severity: Minor
                                Found in lib/api/socketmq.js - About 1 hr to fix

                                  Function MicromonoRPC has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  var RPC = module.exports = function MicromonoRPC(options) {
                                    logger.info('Initialize MicromonoRPC', {
                                      type: options.type,
                                      isRemote: options.isRemote
                                    }).trace(options)
                                  Severity: Minor
                                  Found in lib/api/rpc.js - About 1 hr to fix

                                    Function startChnBackendServer has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    exports.startChnBackendServer = function(channels, chnBackend, chnEndpoint, next) {
                                      logger.debug('startChnBackendServer').trace({
                                        chnEndpoint: chnEndpoint,
                                        channels
                                      })
                                    Severity: Minor
                                    Found in lib/channel/backend.js - About 1 hr to fix

                                      Function attachRoutes has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      ExpressAdapter.prototype.attachRoutes = function(routes, service) {
                                        var app = this.app
                                      
                                        Object.keys(routes).forEach(function(routeName) {
                                          var route = routes[routeName]
                                      Severity: Minor
                                      Found in lib/web/framework/express.js - About 1 hr to fix

                                        Function attachChannelHooks has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                        exports.attachChannelHooks = function(chnAdapter, channel, chnJoinHook, chnAllowHook) {
                                          logger.debug('attachChannelHooks').trace(channel)
                                        
                                          var allowHook = function(pack, stream, dispatch) {
                                            if (REQ === pack.type) {
                                        Severity: Minor
                                        Found in lib/channel/backend.js - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language