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 46 lines of code (exceeds 25 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);
Avoid deeply nested control flow statements. Open
if (!selfConf[keys[0]][keys[1]])
selfConf[keys[1]] = {};
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 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"