Showing 69 of 71 total issues
Function LogFileService
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function LogFileService(config, commService, master, worker) {
var comm = commService('logFile');
var logFileHandlers = {};
File certScanner.js
has 258 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
var x509 = require('x509.js');
var fs = require('fs');
var async = require('async');
Function DispatchTable
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
function DispatchTable(port, params) {
var parseEntry = params.entryParser;
var config = params.config;
var self = this;
Function reload
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
HttpMaster.prototype.reload = function(config, reloadDone) {
var self = this;
this.emit('reload');
function actualReload(config) {
Function init
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
HttpMaster.prototype.init = function(config, initDone) {
var self = this;
var workers = this.workers;
function actualInit(config) {
Function RejectMiddleware
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function RejectMiddleware(config, portConfig) {
var content;
var errorHtmlFile = portConfig.errorHtmlFile || config.errorHtmlFile;
if(errorHtmlFile) {
if(typeof errorHtmlFile === 'function') {
Function LogFileService
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function LogFileService(config, commService, master, worker) {
var comm = commService('logFile');
var logFileHandlers = {};
- Read upRead up
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 handleConfigEntryAfterLoadingKeys
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
function handleConfigEntryAfterLoadingKeys(host, portNumber, config, callback) {
var self = this;
var handlers = createHandlers.call(this, portNumber, config);
Function getTargetForReq
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
DispatchTable.prototype.getTargetForReq = function(req) {
var i, m;
var host = req.unicodeHost || req.headers.host || ''; // host can be undefined
var self = this;
Function actualReload
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
function actualReload(config) {
self.config = config;
var workers = self.workers;
setupDi.call(self);
Function actualInit
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
function actualInit(config) {
self.config = config;
setupDi.call(self);
Function createHandlers
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createHandlers(portNumber, portConfig) {
var self = this;
var di = this.di.makeChild();
di.bindInstance('di', di);
Function LetsEncrypt
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function LetsEncrypt(commService, master, worker, moduleConfig, config) {
let comm = commService('letsencrypt');
let Promise = require('bluebird');
let tls = require('tls');
- Read upRead up
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 preprocessPortConfig
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
function preprocessPortConfig(config, cb) {
var self = this;
if (config.ssl) {
var loadsToDo = [];
Function initWorker
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
function initWorker(cb) {
var self = this;
var worker = this.cluster.fork();
worker.sendMessage = function(type, data) {
worker.send(JSONfn.stringify({
Function handleConfig
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
function handleConfig(config, configHandled) {
var self = this;
self.config = config;
Function WebsockifyService
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function WebsockifyService() {
var wsServer = new WebSocketServer({
server: new EventEmitter() // fake server for web socket server
})
return function(req, socket, cb) {
Function bindTypeGeneric
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
function bindTypeGeneric(doCache, name, type) {
// implicit name from function name
if(typeof name === 'function') {
type = name;
var constructorName = functionName(type);
- Read upRead up
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 resolve
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
DI.prototype.resolve = function(obj, overrides) {
var dependencyMap = extend({}, this.mapping, overrides);
var args;
var resolved;
- Read upRead up
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 setupDi
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
function setupDi() {
var self = this;
var di = this.di = new DI();
di.onMissing = function(name) {
var m;