Showing 162 of 333 total issues
Function _callee$
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
return _regenerator["default"].wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
if (!request.customize) {
_context.next = 6;
Function _callee$
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
return _regenerator["default"].wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
if (!request.customize) {
_context.next = 6;
Function value
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
value: (function () {
var _send = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(request) {
var _ref2, from, to, text, response, responseBody;
return _regenerator["default"].wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
Function value
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
value: (function () {
var _send = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(request) {
var _ref2, from, to, text, ttl, form, response, responseBody;
return _regenerator["default"].wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
Function _callee
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var _send = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(request) {
var _ref2, from, to, text, response, responseBody;
return _regenerator["default"].wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
Function _callee$
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
return _regenerator["default"].wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
if (!request.customize) {
_context.next = 6;
Function _callee
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var _send = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(request) {
var _ref2, from, to, text, ttl, form, response, responseBody;
return _regenerator["default"].wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
Function _callee$
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
return _regenerator["default"].wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
if (!request.customize) {
_context.next = 6;
Function value
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
value: function () {
var _send = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(request) {
var _ref, webhookUrl, rest, apiRequest, response, responseText;
return _regenerator["default"].wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
Function value
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
value: function () {
var _sendOnEachChannel = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee4(request) {
var _this2 = this;
return _regenerator["default"].wrap(function _callee4$(_context4) {
while (1) switch (_context4.prev = _context4.next) {
Function send
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async send (request: EmailRequestType): Promise<string> {
const { id, userId, from, replyTo, subject, html, text, headers, to, cc, bcc, attachments } =
request.customize ? (await request.customize(this.id, request)) : request
const response = await fetch('https://mandrillapp.com/api/1.0/messages/send.json', {
method: 'POST',
Function mergeWithDefaultConfig
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
Open
mergeWithDefaultConfig ({ channels, ...rest }: OptionsType) {
return {
useNotificationCatcher: false,
...rest,
channels: rest.useNotificationCatcher
- 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 value
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
value: function () {
var _send = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(request) {
var _ref, to, from, html, text, subject, replyTo, attachments;
return _regenerator["default"].wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
Function send
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async send (request: EmailRequestType): Promise<string> {
const { id, userId, from, replyTo, subject, html, text, headers, to, cc, bcc, attachments } =
request.customize ? (await request.customize(this.id, request)) : request
const response = await fetch('https://api.sparkpost.com/api/v1/transmissions', {
method: 'POST',
Function value
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
value: function () {
var _send = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(request) {
var _ref, from, to, text, rest;
return _regenerator["default"].wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
Function mergeWithDefaultConfig
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
mergeWithDefaultConfig ({ channels, ...rest }: OptionsType) {
return {
useNotificationCatcher: false,
...rest,
channels: rest.useNotificationCatcher
Function _callee
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var _send = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(request) {
var _ref, webhookUrl, rest, apiRequest, response, responseText;
return _regenerator["default"].wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
Function _callee4
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var _sendOnEachChannel = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee4(request) {
var _this2 = this;
return _regenerator["default"].wrap(function _callee4$(_context4) {
while (1) switch (_context4.prev = _context4.next) {
case 0:
Function send
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
Open
async send (request: EmailRequestType): Promise<string> {
const { id, userId, from, replyTo, subject, html, text, headers, to, cc, bcc, attachments } =
request.customize ? (await request.customize(this.id, request)) : request
const generatedId = id || crypto.randomBytes(16).toString('hex')
const response = await fetch('https://api.sendgrid.com/v3/mail/send', {
- 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 send
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async send (request: VoiceRequestType): Promise<string> {
const {
from,
to,
url,