Showing 71 of 107 total issues
Function constructor
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor (xyz: XYZ, port: number) {
super()
this.port = port
this.xyz = xyz
Function _httpExport
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
let _httpExport = function (xMessageParam: ITransportSentMessageMwParam, next, end, xyz) {
let requestConfig = xMessageParam.requestConfig
let responseCallback = xMessageParam.responseCallback
let postData = requestConfig.json
Function createPathSubtree
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
createPathSubtree (path, fn: () => void) {
let tokens = Path.getTokens(path)
let tree = this.tree
let stree = this.serializedTree
for (let token of tokens) {
- 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 call
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
ServiceRepository.prototype.call = function (opt, responseCallback) {
var nullFn = function () { };
opt.payload = opt.payload || undefined;
opt.servicePath = path_1.Path.format(opt.servicePath);
if (!path_1.Path.validate(opt.servicePath)) {
Function call
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
call (opt: IxyzMessageConfig, responseCallback) {
let nullFn = () => {}
opt.payload = opt.payload || undefined
opt.servicePath = Path.format(opt.servicePath)
Function _genericTransportInvoke
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export function _genericTransportInvoke (params: IServDiscMwParam, next, end, xyz: XYZ) {
const targets = params.targets
const transport = xyz.serviceRepository.transport
const responseCallback = params.responseCallback
const logger = xyz.logger
- 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 _genericTransportInvoke
has a Cognitive Complexity of 9 (exceeds 5 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;
- 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 send
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
send (opt: ITransportSendMessageParams, responseCallback?) {
opt.route = opt.route || 'CALL'
if (!this.routes[opt.route]) {
logger.error(`attempting to send message in route ${opt.route}. DOES NOT EXIST`)
- 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
Avoid deeply nested control flow statements. Open
if (pathIndex === pathToken.length - 1) {
matches.push(computedPath.slice(1));
break;
}
Function UDPServer
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
var UDPServer = (function (_super) {
__extends(UDPServer, _super);
function UDPServer(xyz, port) {
var _this = _super.call(this) || this;
_this.port = port;
- 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
Avoid deeply nested control flow statements. Open
if (pathIndex === pathToken.length - 1) {
matches.push(computedPath.slice(1))
break
}
Avoid deeply nested control flow statements. Open
if (!selfConf[keys[0]][keys[1]])
selfConf[keys[1]] = {};
Avoid deeply nested control flow statements. Open
if (end) end()
Avoid deeply nested control flow statements. Open
if (!selfConf[keys[0]])
selfConf[keys[0]] = {};
Function setSystemConf
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
setSystemConf: function (aConf) {
Logger_1.logger.info('CONFIG :: Setting default systemConf');
systemConf = Constants_1.CONSTANTS.defaultConfig.systemConf;
Logger_1.logger.info('CONFIG :: reading systemConf from user');
systemConf = MergeRecursive(systemConf, 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 setSystemConf
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
setSystemConf: (aConf) => {
logger.info('CONFIG :: Setting default systemConf')
systemConf = CONSTANTS.defaultConfig.systemConf
logger.info('CONFIG :: reading systemConf from user')
systemConf = MergeRecursive(systemConf, 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
Avoid deeply nested control flow statements. Open
if (!selfConf[keys[0]]) selfConf[keys[0]] = {}
Avoid deeply nested control flow statements. Open
if (!selfConf[keys[0]][keys[1]]) selfConf[keys[1]] = {}
Function MergeRecursive
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function MergeRecursive(obj1, obj2) {
for (var p in obj2) {
try {
if (obj2[p].constructor === Object) {
obj1[p] = MergeRecursive(obj1[p], obj2[p]);
- 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 _sendToAll
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function _sendToAll(params, next, done, xyz) {
var servicePath = params.opt.servicePath;
var userPayload = params.opt.payload;
var responseCallback = params.responseCallback;
var route = params.opt.route;
- 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"