grigori-gru/jira-to-matrix

View on GitHub

Showing 110 of 172 total issues

Function handleKnownRoom has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    async handleKnownRoom({ keepTimestamp, roomId, alias, status }) {
        const data = await this.chatApi.getRoomAndClient(roomId);
        if (!data) {
            logger.debug(`No bot can get room meta by alias ${alias} they are not joined. Try remove it.`);

Severity: Minor
Found in src/bot/actions/archive-project.ts - About 45 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

Function getCurrentIssueColor has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    async getCurrentIssueColor(key: string, hookLabels?: GitlabLabelHook[]): Promise<string[]> {
        const issue = await this.getIssue(key);
        if (issue.state === 'closed') {
            return [Colors.gray];
        }
Severity: Minor
Found in src/task-trackers/gitlab/index.ts - About 45 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

Function getBody has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

const getBody = event => {
    const imageData = getImageData(event);
    if (imageData) {
        const filePath = `./${MEDIA_DIR_NAME}/${imageData.fileName}`;
        // replace all spaces to be access in markdown to spaced file names
Severity: Minor
Found in src/lib/git-lib.ts - About 35 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

Avoid too many return statements within this function.
Open

            return StateEnum.ERROR_ARCHIVING;
Severity: Major
Found in src/bot/actions/archive-project.ts - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

                return translate('notValid', { body: customMonths });
    Severity: Major
    Found in src/bot/commands/command-list/archive-project.ts - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                          return translate('keyAlreadyExistForAdd', { typeTaskFromUser: userFromCommand, projectKey });
      Severity: Major
      Found in src/bot/commands/command-list/autoinvite.ts - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                        return translate('autoinviteKeyDeleted', {
                            projectKey,
                            matrixUserFromCommand: userFromCommand,
                            typeTaskFromUser,
                        });
        Severity: Major
        Found in src/bot/commands/command-list/autoinvite.ts - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                              return translate('noRulesToWatchIssue');
          Severity: Major
          Found in src/bot/commands/command-list/speci.ts - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                            return translate('notValid', { body: status });
            Severity: Major
            Found in src/bot/commands/command-list/archive-project.ts - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                      return ADMINS_EXISTS;
              Severity: Major
              Found in src/bot/commands/command-list/common-actions.ts - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                            return utils.ignoreKeysInProject(projectKey, namesIssueTypeInProject);
                Severity: Major
                Found in src/bot/commands/command-list/autoinvite.ts - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                              return translate('issueNotExistOrPermDen');
                  Severity: Major
                  Found in src/bot/commands/command-list/kick.ts - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                                    return;
                    Severity: Major
                    Found in src/bot/commands/command-list/create.ts - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                          return ALL_KICKED;
                      Severity: Major
                      Found in src/bot/commands/command-list/common-actions.ts - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                    return utils.ignoreKeysInProject(projectKey, namesIssueTypeInProject);
                        Severity: Major
                        Found in src/bot/commands/command-list/ignore.ts - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                          return;
                          Severity: Major
                          Found in src/bot/commands/command-list/create.ts - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                        return resMap[res];
                            Severity: Major
                            Found in src/bot/commands/command-list/kick.ts - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                                  return translate('keyNotFoundForDelete', { projectKey });
                              Severity: Major
                              Found in src/bot/commands/command-list/ignore.ts - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                                return;
                                Severity: Major
                                Found in src/bot/commands/command-list/archive.ts - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                                  return translate('ignoreKeyAdded', { projectKey, typeTaskFromUser });
                                  Severity: Major
                                  Found in src/bot/commands/command-list/ignore.ts - About 30 mins to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language