Showing 71 of 107 total issues
Function Transport
has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring. Open
var Transport = (function () {
/**
* Transport layer. This layer is an abstraction above all different sorts of communication.
*/
function Transport(xyz) {
- 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 ServiceRepository
has 143 lines of code (exceeds 25 allowed). Consider refactoring. Open
var ServiceRepository = (function (_super) {
__extends(ServiceRepository, _super);
/**
* Creates a new ServiceRepository
* Transport client and server will be composed by ServiceRepository
Function Transport
has 140 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Transport = (function () {
/**
* Transport layer. This layer is an abstraction above all different sorts of communication.
*/
function Transport(xyz) {
Function _basicPingBootstrap
has 127 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _basicPingBootstrap(xyz, event, port) {
var Util = xyz.Util;
var wrapper = Util.wrapper;
var logger = xyz.logger;
var CONFIG = xyz.CONFIG;
Function setSelfConf
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
setSelfConf: function (aConf, cmdLineArgs) {
Logger_1.logger.info('CONFIG :: Setting default selfConf');
selfConf = Constants_1.CONSTANTS.defaultConfig.selfConf;
Logger_1.logger.info('CONFIG :: Reading selfConf from user');
selfConf = MergeRecursive(selfConf, aConf);
- 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 setSelfConf
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
setSelfConf: (aConf, cmdLineArgs) => {
logger.info('CONFIG :: Setting default selfConf')
selfConf = CONSTANTS.defaultConfig.selfConf
logger.info('CONFIG :: Reading selfConf from user')
selfConf = MergeRecursive(selfConf, aConf)
- 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 ServiceRepository
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
var ServiceRepository = (function (_super) {
__extends(ServiceRepository, _super);
/**
* Creates a new ServiceRepository
* Transport client and server will be composed by ServiceRepository
- 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 NodeXYZ
has 115 lines of code (exceeds 25 allowed). Consider refactoring. Open
var NodeXYZ = (function () {
/**
* create a new xyz object
* @param {Object} configuration configuration should have two main keys:
* - selfConf
Function PathTree
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
var PathTree = (function () {
function PathTree() {
this.tree = {
'': {
subtree: {}
- 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 _basicPingBootstrap
has 112 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function _basicPingBootstrap (xyz: INodeXYZ, event, port) {
let Util = xyz.Util
let wrapper = Util.wrapper
let logger = xyz.logger
let CONFIG = xyz.CONFIG
Function match
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
match: function (path, serializedTree) {
var matches = [];
var pathToken = path.split('/');
var pathIndex = 0;
var pathTree = serializedTree;
- 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 match
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
match (path, serializedTree) {
let matches = []
let pathToken = path.split('/')
let pathIndex = 0
let pathTree = serializedTree
- 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 HTTPServer
has 97 lines of code (exceeds 25 allowed). Consider refactoring. Open
var HTTPServer = (function (_super) {
__extends(HTTPServer, _super);
/**
* Creates a new HTTP server
* @param xyz {Object} a reference to the curretn xyz object. will be filled automatically.
Function GenericMiddlewareHandler
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
var GenericMiddlewareHandler = (function () {
function GenericMiddlewareHandler(xyz, name, route) {
this.middlewares = [];
this.xyz = xyz;
this.name = name;
- 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 GenericMiddlewareHandler
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
var GenericMiddlewareHandler = (function () {
function GenericMiddlewareHandler(xyz, name, route) {
this.middlewares = [];
this.xyz = xyz;
this.name = name;
Function PathTree
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
var PathTree = (function () {
function PathTree() {
this.tree = {
'': {
subtree: {}
Function UDPServer
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
var UDPServer = (function (_super) {
__extends(UDPServer, _super);
function UDPServer(xyz, port) {
var _this = _super.call(this) || this;
_this.port = port;
Function _ping
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _ping() {
var nodes = CONFIG.getSystemConf().nodes;
var _loop_1 = function (node) {
SR.transport.send({
route: 'PING',
Function _genericTransportInvoke
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _genericTransportInvoke(params, next, end, xyz) {
var targets = params.targets;
var transport = xyz.serviceRepository.transport;
var responseCallback = params.responseCallback;
var logger = xyz.logger;
Function HTTPServer
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
function HTTPServer(xyz, port) {
var _this = _super.call(this) || this;
http.globalAgent.maxSockets = Infinity;
_this.port = port || config_global_1.CONFIG.getSelfConf().transport[0].port;
_this.xyz = xyz;