File HttpMasterWorker.js
has 457 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
var crypto = require('crypto');
var net = require('net');
var http = require('http');
var async = require('async');
Function loadKeysforConfigEntry
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
function loadKeysforConfigEntry(config, callback) {
var key;
if(config.ssl === true) {
config.ssl = {};
}
- 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 serverForPortConfig
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
function serverForPortConfig(host, portNumber, portConfig) {
var self = this;
var server;
self.cachedServers = self.cachedServers || {};
Function loadKeysforConfigEntry
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
function loadKeysforConfigEntry(config, callback) {
var key;
if(config.ssl === true) {
config.ssl = {};
}
Function loadConfig
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
HttpMasterWorker.prototype.loadConfig = function(config, configLoaded) {
var self = this;
var events = new EventEmitter();
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 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 handleConfig
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
function handleConfig(config, configHandled) {
var self = this;
self.config = config;
Function serverForPortConfig
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function serverForPortConfig(host, portNumber, portConfig) {
var self = this;
var server;
self.cachedServers = self.cachedServers || {};
- 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 createHandlers
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function createHandlers(portNumber, portConfig) {
var self = this;
var di = this.di.makeChild();
di.bindInstance('di', di);
- 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 lazyGetTcpServer
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function lazyGetTcpServer(port, host, cb) {
var tcpServers = this.tcpServers;
var entry = (host ? host + ':' + port : port);
if (tcpServers[entry]) {
- 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 patchSslConfig
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function patchSslConfig(portEntrySslConfig) {
if (nodeVersion >= 0.11) { // use fancy cipher settings only for 0.11
if (portEntrySslConfig.honorCipherOrder !== false) {
// prefer server ciphers over clients - prevents BEAST attack
portEntrySslConfig.honorCipherOrder = true;
- 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 loadConfig
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
HttpMasterWorker.prototype.loadConfig = function(config, configLoaded) {
var self = this;
var events = new EventEmitter();
- 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"