Showing 55 of 191 total issues
File messages.ts
has 563 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*
* Implements the API handlers for the Message resource.
*/
import * as express from "express";
import * as t from "io-ts";
File created_message_queue_handler.ts
has 465 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*
* This function will process events triggered by newly created messages.
* For each new input message, the delivery preferences associated to the
* recipient of the message gets retrieved and a notification gets delivered
* to each configured channel.
Function handleMessage
has 151 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export async function handleMessage(
lProfileModel: ProfileModel,
lMessageModel: MessageModel,
lNotificationModel: NotificationModel,
lSenderServiceModel: SenderServiceModel,
Function index
has 150 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export async function index(
context: ContextWithBindings
): Promise<OutputBindings | Error | void> {
const stopProcessing = undefined;
const logLevel = isProduction ? "info" : "debug";
File emailnotifications_queue_handler.ts
has 408 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*
* This function will process events triggered by newly created messages.
* For each new input message, the delivery preferences associated to the
* recipient of the message gets retrieved and a notification gets delivered
* to each configured channel.
Function CreateMessageHandler
has 138 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function CreateMessageHandler(
getCustomTelemetryClient: CustomTelemetryClientFactory,
messageModel: MessageModel,
generateObjectId: ObjectIdGenerator
): ICreateMessageHandler {
File webhook_queue_handler.ts
has 386 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*
* This function will process events triggered by newly created messages.
*
* For each new input message, retrieve the URL associated to the webhook
* from the payload then send an HTTP request to the API Proxy
Function index
has 131 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export async function index(
context: ContextWithBindings
): Promise<OutputBindings | Error | void> {
const logLevel = isProduction ? "info" : "debug";
configureAzureContextTransport(context, winston, logLevel);
Function index
has 117 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export async function index(
context: ContextWithBindings
): Promise<OutputBindings | Error | void> {
const logLevel = isProduction ? "info" : "debug";
configureAzureContextTransport(context, winston, logLevel);
Function handleNotification
has 108 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export async function handleNotification(
lMailerTransporter: NodeMailer.Transporter,
lAppInsightsClient: TelemetryClient,
lNotificationModel: NotificationModel,
emailNotificationEvent: NotificationEvent,
File profiles.ts
has 338 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*
* Implements the API handlers for the Profile resource.
*/
import * as express from "express";
Function handleNotification
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export async function handleNotification(
lAppInsightsClient: TelemetryClient,
lNotificationModel: NotificationModel,
webhookNotificationEvent: NotificationEvent
): Promise<Either<RuntimeError, NotificationEvent>> {
Function GetMessageHandler
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function GetMessageHandler(
messageModel: MessageModel,
messageStatusModel: MessageStatusModel,
notificationModel: NotificationModel,
notificationStatusModel: NotificationStatusModel,
File services.ts
has 303 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*
* Implements the API handlers for the Services resource.
*/
import * as express from "express";
Function UpdateServiceHandler
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function UpdateServiceHandler(
serviceModel: ServiceModel
): IUpdateServiceHandler {
return async (_, __, ___, serviceId, serviceModelPayload) => {
if (serviceModelPayload.service_id !== serviceId) {
Function index
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export async function index(
context: ContextWithBindings,
event: IProfileCreatedEvent | IProfileUpdatedEvent
): Promise<void> {
const logLevel = isProduction ? "info" : "debug";
Function updateMessageVisibilityTimeout
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function updateMessageVisibilityTimeout(
queueService: QueueService,
queueName: string,
queueMessageBindings: Context["bindings"]
): Promise<boolean> {
Function UpsertProfileHandler
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function UpsertProfileHandler(
profileModel: ProfileModel
): IUpsertProfileHandler {
return async (context, _, __, ___, fiscalCode, profileModelPayload) => {
const errorOrMaybeProfile = await profileModel.findOneProfileByFiscalCode(
Function handleQueueProcessingFailure
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export async function handleQueueProcessingFailure(
queueService: QueueService,
queueMessageBindings: Context["bindings"],
queueName: string,
onTransientError: (error: RuntimeError) => Promise<Either<RuntimeError, {}>>,
Function getMessageNotificationStatuses
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function getMessageNotificationStatuses(
notificationModel: NotificationModel,
notificationStatusModel: NotificationStatusModel,
messageId: NonEmptyString
): Promise<Either<Error, Option<NotificationStatusHolder>>> {