teamdigitale/digital-citizenship-functions

View on GitHub

Showing 191 of 191 total issues

Avoid too many return statements within this function.
Open

    return right<RuntimeError, OutputBindings>({});
Severity: Major
Found in lib/created_message_queue_handler.ts - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

        return left<RuntimeError, OutputBindings>(errorOrNotificationEvent.value);
    Severity: Major
    Found in lib/created_message_queue_handler.ts - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

          return left<RuntimeError, NotificationEvent>(error);
      Severity: Major
      Found in lib/webhook_queue_handler.ts - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

              return ResponseErrorInternal(
                `Error retrieving MessageStatus: ${
                  errorOrMaybeMessageStatus.value.code
                }|${errorOrMaybeMessageStatus.value.body}`
              );
        Severity: Major
        Found in lib/controllers/messages.ts - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

              return left<RuntimeError, OutputBindings>(
                TransientError("Cannot update message pending status")
              );
          Severity: Major
          Found in lib/created_message_queue_handler.ts - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

              return right<RuntimeError, OutputBindings>(
                withoutUndefinedValues(outputBindings)
              );
            Severity: Major
            Found in lib/created_message_queue_handler.ts - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                    return ResponseErrorInternal(
                      `Error retrieving NotificationStatus: ${
                        errorOrNotificationStatuses.value.name
                      }|${errorOrNotificationStatuses.value.message}`
                    );
              Severity: Major
              Found in lib/controllers/messages.ts - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                    return ResponseSuccessJson(
                      retrievedServiceToPublic(maybeUpdatedService.value)
                    );
                Severity: Major
                Found in lib/controllers/adm/services.ts - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                        return ResponseErrorQuery(
                          "Error while updating the existing service",
                          errorOrMaybeUpdatedService.value
                        );
                  Severity: Major
                  Found in lib/controllers/adm/services.ts - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                          return ResponseErrorQuery(
                            "Error while creating Message",
                            errorOrMessage.value
                          );
                    Severity: Major
                    Found in lib/controllers/messages.ts - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                          return ResponseSuccessJson(returnedMessage);
                      Severity: Major
                      Found in lib/controllers/messages.ts - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                              return ResponseErrorValidation(
                                "Unable to decode CreatedMessageEvent",
                                readableReport(createdMessageEventOrError.value)
                              );
                        Severity: Major
                        Found in lib/controllers/messages.ts - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                            return right<RuntimeError, NotificationEvent>(emailNotificationEvent);
                          Severity: Major
                          Found in lib/emailnotifications_queue_handler.ts - About 30 mins to fix

                            Function handleNotification has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                            export async function handleNotification(
                              lAppInsightsClient: TelemetryClient,
                              lNotificationModel: NotificationModel,
                              webhookNotificationEvent: NotificationEvent
                            ): Promise<Either<RuntimeError, NotificationEvent>> {
                            Severity: Minor
                            Found in lib/webhook_queue_handler.ts - About 25 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

                            Trailing spaces
                            Open

                            - [submitMessageforUser] Added payment metadata into the message payload  
                            Severity: Info
                            Found in CHANGELOG.md by markdownlint

                            MD009 - Trailing spaces

                            Tags: whitespace

                            Aliases: no-trailing-spaces

                            Parameters: br_spaces (number; default: 0)

                            This rule is triggered on any lines that end with whitespace. To fix this, find the line that is triggered and remove any trailing spaces from the end.

                            The brspaces parameter allows an exception to this rule for a specific amount of trailing spaces used to insert an explicit line break/br element. For example, set brspaces to 2 to allow exactly 2 spaces at the end of a line.

                            Note: you have to set brspaces to 2 or higher for this exception to take effect - you can't insert a br element with just a single trailing space, so if you set brspaces to 1, the exception will be disabled, just as if it was set to the default of 0.

                            Headers should be surrounded by blank lines
                            Open

                            ### Added
                            Severity: Info
                            Found in CHANGELOG.md by markdownlint

                            MD022 - Headers should be surrounded by blank lines

                            Tags: headers, blank_lines

                            Aliases: blanks-around-headers

                            This rule is triggered when headers (any style) are either not preceded or not followed by a blank line:

                            # Header 1
                            Some text
                            
                            Some more text
                            ## Header 2

                            To fix this, ensure that all headers have a blank line both before and after (except where the header is at the beginning or end of the document):

                            # Header 1
                            
                            Some text
                            
                            Some more text
                            
                            ## Header 2

                            Rationale: Aside from aesthetic reasons, some parsers, including kramdown, will not parse headers that don't have a blank line before, and will parse them as regular text.

                            Trailing spaces
                            Open

                            - Fixed a bug during function packing that prevents the API backend to run  
                            Severity: Info
                            Found in CHANGELOG.md by markdownlint

                            MD009 - Trailing spaces

                            Tags: whitespace

                            Aliases: no-trailing-spaces

                            Parameters: br_spaces (number; default: 0)

                            This rule is triggered on any lines that end with whitespace. To fix this, find the line that is triggered and remove any trailing spaces from the end.

                            The brspaces parameter allows an exception to this rule for a specific amount of trailing spaces used to insert an explicit line break/br element. For example, set brspaces to 2 to allow exactly 2 spaces at the end of a line.

                            Note: you have to set brspaces to 2 or higher for this exception to take effect - you can't insert a br element with just a single trailing space, so if you set brspaces to 1, the exception will be disabled, just as if it was set to the default of 0.

                            Headers should be surrounded by blank lines
                            Open

                            ## [v0.52.0] - 2018-09-19
                            Severity: Info
                            Found in CHANGELOG.md by markdownlint

                            MD022 - Headers should be surrounded by blank lines

                            Tags: headers, blank_lines

                            Aliases: blanks-around-headers

                            This rule is triggered when headers (any style) are either not preceded or not followed by a blank line:

                            # Header 1
                            Some text
                            
                            Some more text
                            ## Header 2

                            To fix this, ensure that all headers have a blank line both before and after (except where the header is at the beginning or end of the document):

                            # Header 1
                            
                            Some text
                            
                            Some more text
                            
                            ## Header 2

                            Rationale: Aside from aesthetic reasons, some parsers, including kramdown, will not parse headers that don't have a blank line before, and will parse them as regular text.

                            Headers should be surrounded by blank lines
                            Open

                            ### Changed
                            Severity: Info
                            Found in CHANGELOG.md by markdownlint

                            MD022 - Headers should be surrounded by blank lines

                            Tags: headers, blank_lines

                            Aliases: blanks-around-headers

                            This rule is triggered when headers (any style) are either not preceded or not followed by a blank line:

                            # Header 1
                            Some text
                            
                            Some more text
                            ## Header 2

                            To fix this, ensure that all headers have a blank line both before and after (except where the header is at the beginning or end of the document):

                            # Header 1
                            
                            Some text
                            
                            Some more text
                            
                            ## Header 2

                            Rationale: Aside from aesthetic reasons, some parsers, including kramdown, will not parse headers that don't have a blank line before, and will parse them as regular text.

                            Headers should be surrounded by blank lines
                            Open

                            ### Added
                            Severity: Info
                            Found in CHANGELOG.md by markdownlint

                            MD022 - Headers should be surrounded by blank lines

                            Tags: headers, blank_lines

                            Aliases: blanks-around-headers

                            This rule is triggered when headers (any style) are either not preceded or not followed by a blank line:

                            # Header 1
                            Some text
                            
                            Some more text
                            ## Header 2

                            To fix this, ensure that all headers have a blank line both before and after (except where the header is at the beginning or end of the document):

                            # Header 1
                            
                            Some text
                            
                            Some more text
                            
                            ## Header 2

                            Rationale: Aside from aesthetic reasons, some parsers, including kramdown, will not parse headers that don't have a blank line before, and will parse them as regular text.

                            Severity
                            Category
                            Status
                            Source
                            Language