Showing 6 of 6 total issues
Function do_qmd_response
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
Open
exports.do_qmd_response = function (qmd_res, connection, rcpt, next) {
const txn = connection.transaction
const [r_code, dst_type] = qmd_res
- Read upRead up
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 decode_qmd_response
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports.decode_qmd_response = function (connection, hexnum) {
connection.logprotocol(this, `HEXRV: ${hexnum}`)
switch (hexnum) {
case '11':
Function do_qmd_response
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports.do_qmd_response = function (qmd_res, connection, rcpt, next) {
const txn = connection.transaction
const [r_code, dst_type] = qmd_res
Function hook_get_mx
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
exports.hook_get_mx = function (next, hmail, domain) {
if (hmail.todo.notes.get('queue.wants') !== 'lmtp') return next()
const mx = {
using_lmtp: true,
- Read upRead up
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
Open
if (connection.relaying) return do_relaying(this, txn, next)
Avoid too many return
statements within this function. Open
Open
return next(DENYSOFT, 'Split transaction, retry soon')