senecajs/seneca

View on GitHub

Showing 130 of 197 total issues

Function execute_action has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

    execspec: any,
    act_instance: any,
    opts: any,
    actctxt: any,
    msg: any,
Severity: Major
Found in lib/act.ts - About 50 mins to fix

    Function handle_reply has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        handle_reply: function (opts, meta, actctxt, actmsg, err, out, reply_meta) {
    Severity: Major
    Found in lib/act.js - About 50 mins to fix

      Function outward_act_stats has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      function outward_act_stats(spec) {
          const ctx = spec.ctx;
          const data = spec.data;
          if (!ctx.actdef || ctx.cached$) {
              return;
      Severity: Minor
      Found in lib/outward.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 outward_sub has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      function outward_sub(spec) {
          const ctx = spec.ctx;
          const data = spec.data;
          var meta = data.meta;
          var private$ = ctx.seneca.private$;
      Severity: Minor
      Found in lib/outward.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 outward_act_stats has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      function outward_act_stats(spec: any) {
        const ctx = spec.ctx
        const data = spec.data
      
        if (!ctx.actdef || ctx.cached$) {
      Severity: Minor
      Found in lib/outward.ts - 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 handle_reply has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

        handle_reply: function(
          opts: any,
          meta: any,
          actctxt: any,
          actmsg: any,
      Severity: Minor
      Found in lib/act.ts - 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

      Avoid deeply nested control flow statements.
      Open

                      if (null != str) {
                          out.push(str);
                      }
      Severity: Major
      Found in lib/common.js - About 45 mins to fix

        Function handle_reply has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            handle_reply: function (opts, meta, actctxt, actmsg, err, out, reply_meta) {
                meta.end = Date.now();
                const delegate = actctxt.seneca;
                const reply = actctxt.reply;
                const data = {
        Severity: Minor
        Found in lib/act.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 resolve_config has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

        intern.resolve_config = function(config: any, options: any) {
          let out = Object.assign({}, config)
        
          Object.keys(options).forEach((key) => {
            const value = options[key]
        Severity: Minor
        Found in lib/api.ts - 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 outward_sub has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

        function outward_sub(spec: any) {
          const ctx = spec.ctx
          const data = spec.data
        
          var meta = data.meta
        Severity: Minor
        Found in lib/outward.ts - 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

        Avoid deeply nested control flow statements.
        Open

                if (null != str) {
                  out.push(str)
                }
        Severity: Major
        Found in lib/common.ts - About 45 mins to fix

          Function api_ready has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

          function api_ready(ready_func) {
              const self = this;
              if (ready_func) {
                  setTimeout(run_ready, self.private$.ge.options.interval);
              }
          Severity: Minor
          Found in lib/ready.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 api_sub has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

          function api_sub() {
              const self = this;
              const args = SubArgu(arguments);
              // TODO: this is duplicated - need to be a util
              args.pattern = Object.assign({}, args.moreprops ? args.moreprops : null, 'string' === typeof args.props ?
          Severity: Minor
          Found in lib/sub.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 resolve_config has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

          intern.resolve_config = function (config, options) {
              let out = Object.assign({}, config);
              Object.keys(options).forEach((key) => {
                  const value = options[key];
                  if (value && 'object' === typeof value) {
          Severity: Minor
          Found in lib/api.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 api_ready has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

          function api_ready(this: any, ready_func: any) {
            const self = this
          
            if (ready_func) {
              setTimeout(run_ready, self.private$.ge.options.interval)
          Severity: Minor
          Found in lib/ready.ts - 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 delegate has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

          function delegate(this: any, fixedargs: any, fixedmeta: any) {
            const self = this
            const root = this.root
            const opts = this.options()
          
          
          Severity: Minor
          Found in lib/api.ts - 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 inward_act_default has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

          function inward_act_default(spec) {
              const ctx = spec.ctx;
              const data = spec.data;
              var so = ctx.options;
              var msg = data.msg;
          Severity: Minor
          Found in lib/inward.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 api_sub has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

          function api_sub(this: any) {
            const self = this
          
            const args = SubArgu(arguments)
          
          
          Severity: Minor
          Found in lib/sub.ts - 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 delegate has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

          function delegate(fixedargs, fixedmeta) {
              const self = this;
              const root = this.root;
              const opts = this.options();
              fixedargs = fixedargs || {};
          Severity: Minor
          Found in lib/api.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 inward_act_default has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

          function inward_act_default(spec: any) {
            const ctx = spec.ctx
            const data = spec.data
          
            var so = ctx.options
          Severity: Minor
          Found in lib/inward.ts - 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

          Severity
          Category
          Status
          Source
          Language