haraka/haraka-plugin-known-senders

View on GitHub

Showing 3 of 5 total issues

Function is_dkim_authenticated has 46 lines of code (exceeds 25 allowed). Consider refactoring.
Open

exports.is_dkim_authenticated = async function (next, connection) {
  const plugin = this
  if (connection.relaying) return next();

  let rcpt_ods = [];
Severity: Minor
Found in index.js - About 1 hr to fix

    Function is_dkim_authenticated has a Cognitive Complexity of 18 (exceeds 10 allowed). Consider refactoring.
    Open

    exports.is_dkim_authenticated = async function (next, connection) {
      const plugin = this
      if (connection.relaying) return next();
    
      let rcpt_ods = [];
    Severity: Minor
    Found in index.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 update_sender has 33 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    exports.update_sender = async function (next, connection, params) {
      const plugin = this;
      // queue_ok arguments: next, connection, msg
      // ok 1390590369 qp 634 (F82E2DD5-9238-41DC-BC95-9C3A02716AD2.1)
    
    
    Severity: Minor
    Found in index.js - About 1 hr to fix
      Severity
      Category
      Status
      Source
      Language