node-xyz/xyz-core

View on GitHub
built/Config/config.global.js

Summary

Maintainability
C
1 day
Test Coverage

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);
Severity: Minor
Found in built/Config/config.global.js - About 4 hrs to fix

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);
Severity: Minor
Found in built/Config/config.global.js - About 1 hr to fix

    Avoid deeply nested control flow statements.
    Open

                    if (!selfConf[keys[0]][keys[1]])
                        selfConf[keys[1]] = {};
    Severity: Major
    Found in built/Config/config.global.js - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                      if (!selfConf[keys[0]])
                          selfConf[keys[0]] = {};
      Severity: Major
      Found in built/Config/config.global.js - About 45 mins to fix

        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);
        Severity: Minor
        Found in built/Config/config.global.js - About 45 mins to fix

        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]);
        Severity: Minor
        Found in built/Config/config.global.js - About 35 mins to fix

        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

        There are no issues that match your filters.

        Category
        Status