node-xyz/xyz-core

View on GitHub

Showing 71 of 107 total issues

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

Function _sendToAll has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function _sendToAll (params: IServDiscMwParam, next, done, xyz:XYZ) {
  let servicePath = params.opt.servicePath
  let userPayload = params.opt.payload
  let responseCallback = params.responseCallback
  let route = params.opt.route
Severity: Minor
Found in src/Service/Middleware/service.send.to.all.ts - 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

Function MergeRecursive has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function MergeRecursive (obj1, obj2) {
  for (let p in obj2) {
    try {
      if (obj2[p].constructor === Object) {
        obj1[p] = MergeRecursive(obj1[p], obj2[p])
Severity: Minor
Found in src/Config/config.global.ts - 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

Avoid too many return statements within this function.
Open

        return Util_1.wrapper('red', level);
Severity: Major
Found in built/Log/Logger.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

            return Util_1.wrapper('yellow', level);
    Severity: Major
    Found in built/Log/Logger.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

          return wrapper('yellow', level)
      Severity: Major
      Found in src/Log/Logger.ts - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

            return wrapper('red', level)
        Severity: Major
        Found in src/Log/Logger.ts - About 30 mins to fix

          Function _findTargetPort has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

            _findTargetPort (route, node) {
              let foreignRoutes = this.xyz.serviceRepository.foreignRoutes[node]
              for (let p in foreignRoutes) {
                for (let r of foreignRoutes[p]) {
                  if (r === route) {
          Severity: Minor
          Found in src/Transport/Transport.ts - About 25 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 levelColor has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

          function levelColor (level) {
            if (level === 'silly') {
              return wrapper('magenta', level)
            }
            if (level === 'debug') {
          Severity: Minor
          Found in src/Log/Logger.ts - About 25 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 _checkUniqueRoute has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

            _checkUniqueRoute (prefix) {
              for (let s in this.servers) {
                for (let r in this.servers[s].routes) {
                  if (r === prefix) {
                    return false
          Severity: Minor
          Found in src/Transport/Transport.ts - About 25 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 levelColor has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

          function levelColor(level) {
              if (level === 'silly') {
                  return Util_1.wrapper('magenta', level);
              }
              if (level === 'debug') {
          Severity: Minor
          Found in built/Log/Logger.js - About 25 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

          Severity
          Category
          Status
          Source
          Language