node-xyz/xyz-core

View on GitHub

Showing 107 of 107 total issues

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 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('red', level)
      Severity: Major
      Found in src/Log/Logger.ts - About 30 mins to fix

        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

        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 _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

        Severity
        Category
        Status
        Source
        Language