senecajs/seneca

View on GitHub

Showing 130 of 197 total issues

Function handle_inward_break has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    handle_inward_break: function (inward, act_instance, data, actdef, origmsg) {
        if (!inward)
            return false;
        const msg = data.msg;
        const reply = data.reply;
Severity: Minor
Found in lib/act.js - About 1 hr 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_validate_msg has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

function inward_validate_msg(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 1 hr 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 build_log has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

function build_log(self) {
    var logspec = build_log_spec(self);
    // shortcut for direct access (avoids seneca.options() call)
    self.private$.logspec = logspec;
    var logger = load_logger(self, logspec.logger);
Severity: Minor
Found in lib/logging.js - About 1 hr 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_inward_break has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

  handle_inward_break: function(
    inward: any,
    act_instance: any,
    data: any,
    actdef: any,
Severity: Minor
Found in lib/act.ts - About 1 hr 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 make_action_seneca_stats has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

function make_action_seneca_stats(private$: any) {
  return function action_seneca_stats(this: any, msg: any, reply: any) {
    msg = msg || {}
    var stats

Severity: Minor
Found in lib/actions.ts - About 1 hr 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 test has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

function test(this: any, errhandler: any, logspec: any) {
  const opts = this.options()

  if ('-' != opts.tag) {
    this.root.id =
Severity: Minor
Found in lib/api.ts - About 1 hr 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_message has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

function api_message(pattern0, pattern1, action) {
    let actfunc = action || pattern1;
    const action_wrapper = null == actfunc
        ? null
        : function (msg, reply, meta) {
Severity: Minor
Found in lib/add.js - About 1 hr 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 test has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

function test(errhandler, logspec) {
    const opts = this.options();
    if ('-' != opts.tag) {
        this.root.id =
            null == opts.id$
Severity: Minor
Found in lib/api.js - About 1 hr 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 make_action_seneca_stats has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

function make_action_seneca_stats(private$) {
    return function action_seneca_stats(msg, reply) {
        msg = msg || {};
        var stats;
        // TODO: review - this is sort of breaking the "type" of the stats result
Severity: Minor
Found in lib/actions.js - About 1 hr 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_message has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

function api_message(this: any, pattern0: any, pattern1: any, action: any) {
  let actfunc = action || pattern1
  const action_wrapper: any =
    null == actfunc
      ? null
Severity: Minor
Found in lib/add.ts - About 1 hr 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_meta has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

function inward_msg_meta(spec) {
    const ctx = spec.ctx;
    const data = spec.data;
    var meta = data.meta;
    meta.pattern = ctx.actdef.pattern;
Severity: Minor
Found in lib/inward.js - About 1 hr 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_meta has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

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

  var meta = data.meta
Severity: Minor
Found in lib/inward.ts - About 1 hr 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 fail has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

function fail(this: any, ...args: any[]) {
  if (args.length <= 2) {
    return failIf(this, true, args[0], args[1])
  }

Severity: Minor
Found in lib/api.ts - About 55 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 prior has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  prior(spec: TaskSpec) {
    const actdef = spec.data.actdef
    const pattern = spec.data.pattern
    const strict_add = spec.data.strict_add
    const instance = spec.ctx.instance
Severity: Minor
Found in lib/add.ts - About 55 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 error has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

function error(this: any, first: any) {
  if ('function' === typeof first) {
    this.options({ errhandler: first })
    return this
  }
Severity: Minor
Found in lib/api.ts - About 55 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 prior has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    prior(spec) {
        const actdef = spec.data.actdef;
        const pattern = spec.data.pattern;
        const strict_add = spec.data.strict_add;
        const instance = spec.ctx.instance;
Severity: Minor
Found in lib/add.js - About 55 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 fail has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

function fail(...args) {
    if (args.length <= 2) {
        return failIf(this, true, args[0], args[1]);
    }
    if (args.length === 3) {
Severity: Minor
Found in lib/api.js - About 55 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 error has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

function error(first) {
    if ('function' === typeof first) {
        this.options({ errhandler: first });
        return this;
    }
Severity: Minor
Found in lib/api.js - About 55 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 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

    execute_action: function (execspec, act_instance, opts, actctxt, msg, meta, reply) {
Severity: Major
Found in lib/act.js - About 50 mins to fix

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

        opts: any,
        meta: any,
        actctxt: any,
        actmsg: any,
        err: any,
    Severity: Major
    Found in lib/act.ts - About 50 mins to fix
      Severity
      Category
      Status
      Source
      Language