senecajs/seneca

View on GitHub

Showing 130 of 197 total issues

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

function outward_act_error(spec: any) {
  const ctx = spec.ctx
  const data = spec.data

  var delegate = ctx.seneca
Severity: Minor
Found in lib/outward.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 execute_action has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  execute_action: function(
    execspec: any,
    act_instance: any,
    opts: any,
    actctxt: any,
Severity: Minor
Found in lib/act.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 inward_sub has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

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

function outward_make_error(spec: any) {
  const ctx = spec.ctx
  const data = spec.data

  if (!ctx.options.legacy.error) {
Severity: Minor
Found in lib/outward.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 copy;
Severity: Major
Found in lib/legacy.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

      return copy
    Severity: Major
    Found in lib/legacy.ts - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

              return isNaN(val) ? 'null' : val.toString();
      Severity: Major
      Found in lib/common.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                return '[' + out.join(',') + ']';
        Severity: Major
        Found in lib/common.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                  return valstr;
          Severity: Major
          Found in lib/common.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                return isNaN(val) ? 'null' : val.toString()
            Severity: Major
            Found in lib/common.ts - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                  return '{' + out.join(',') + '}'
              Severity: Major
              Found in lib/common.ts - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                    return '[' + out.join(',') + ']'
                Severity: Major
                Found in lib/common.ts - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                      return valstr
                  Severity: Major
                  Found in lib/common.ts - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                            return '{' + out.join(',') + '}';
                    Severity: Major
                    Found in lib/common.js - About 30 mins to fix

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

                      function options(options, chain) {
                          const self = this;
                          const private$ = self.private$;
                          if (null == options) {
                              return private$.optioner.get();
                      Severity: Minor
                      Found in lib/api.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 init has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function init(seneca_options, more_options) {
                          var initial_opts = 'string' === typeof seneca_options
                              ? deep({}, { from: seneca_options }, more_options)
                              : deep({}, seneca_options, more_options);
                          // Legacy options, remove in 4.x
                      Severity: Minor
                      Found in seneca.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 inward_msg_modify has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

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

                      function options(this: any, options: any, chain: any) {
                        const self = this
                        const private$ = self.private$
                      
                        if (null == options) {
                      Severity: Minor
                      Found in lib/api.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 argprops has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function argprops(defaults: any, args: any, fixed: any, omits: any) {
                        omits = Array.isArray(omits)
                          ? omits
                          : omits && 'object' === typeof omits
                            ? Object.keys(omits)
                      Severity: Minor
                      Found in lib/legacy.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 close has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                      intern.close = function (callpoint, done) {
                          const seneca = this;
                          const options = seneca.options();
                          let done_called = false;
                          const safe_done = function safe_done(err) {
                      Severity: Minor
                      Found in lib/api.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