RocketChat/Rocket.Chat

View on GitHub

Showing 3,268 of 8,229 total issues

File setup-wizard.ts has 1352 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { settingsRegistry } from '../../app/settings/server';

export const createSetupWSettings = () =>
    settingsRegistry.addGroup('Setup_Wizard', async function () {
        await this.section('Organization_Info', async function () {
Severity: Major
Found in apps/meteor/server/settings/setup-wizard.ts - About 3 days to fix

    File channels.ts has 1207 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import { Team, Room } from '@rocket.chat/core-services';
    import type { IRoom, ISubscription, IUser, RoomType, IUpload } from '@rocket.chat/core-typings';
    import { Integrations, Messages, Rooms, Subscriptions, Uploads, Users } from '@rocket.chat/models';
    import {
        isChannelsAddAllProps,
    Severity: Major
    Found in apps/meteor/app/api/server/v1/channels.ts - About 3 days to fix

      File rest.ts has 1071 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import { AppStatus, AppStatusUtils } from '@rocket.chat/apps-engine/definition/AppStatus';
      import type { IAppInfo } from '@rocket.chat/apps-engine/definition/metadata';
      import type { AppManager } from '@rocket.chat/apps-engine/server/AppManager';
      import { AppInstallationSource } from '@rocket.chat/apps-engine/server/storage';
      import type { IUser, IMessage } from '@rocket.chat/core-typings';
      Severity: Major
      Found in apps/meteor/ee/server/apps/communication/rest.ts - About 2 days to fix

        File users.ts has 1060 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import { MeteorError, Team, api } from '@rocket.chat/core-services';
        import type { IExportOperation, ILoginToken, IPersonalAccessToken, IUser, UserStatus } from '@rocket.chat/core-typings';
        import { Users, Subscriptions } from '@rocket.chat/models';
        import {
            isUserCreateParamsPOST,
        Severity: Major
        Found in apps/meteor/app/api/server/v1/users.ts - About 2 days to fix

          File groups.ts has 1047 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import { Team, isMeteorError } from '@rocket.chat/core-services';
          import type { IIntegration, IUser, IRoom, RoomType } from '@rocket.chat/core-typings';
          import { Integrations, Messages, Rooms, Subscriptions, Uploads, Users } from '@rocket.chat/models';
          import { check, Match } from 'meteor/check';
          import { Meteor } from 'meteor/meteor';
          Severity: Major
          Found in apps/meteor/app/api/server/v1/groups.ts - About 2 days to fix

            Function createEmailSettings has 527 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                settingsRegistry.addGroup('Email', async function () {
                    await this.section('Style', async function () {
                        await this.add('email_plain_text_only', false, {
                            type: 'boolean',
                        });
            Severity: Major
            Found in apps/meteor/server/settings/email.ts - About 2 days to fix

              RoomsRaw has 132 functions (exceeds 20 allowed). Consider refactoring.
              Open

              export class RoomsRaw extends BaseRaw<IRoom> implements IRoomsModel {
                  constructor(db: Db, trash?: Collection<RocketChatRecordDeleted<IRoom>>) {
                      super(db, 'room', trash);
                  }
              
              
              Severity: Major
              Found in apps/meteor/server/models/raw/Rooms.ts - About 2 days to fix

                File SlackAdapter.js has 975 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import http from 'http';
                import https from 'https';
                import url from 'url';
                
                import { Message } from '@rocket.chat/core-services';
                Severity: Major
                Found in apps/meteor/app/slackbridge/server/SlackAdapter.js - About 2 days to fix

                  File ImportDataConverter.ts has 975 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import type {
                      IImportUser,
                      IImportMessage,
                      IImportMessageReaction,
                      IImportChannel,
                  Severity: Major
                  Found in apps/meteor/app/importer/server/classes/ImportDataConverter.ts - About 2 days to fix

                    File defaultBlockedDomainsList.ts has 945 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    export const emailDomainDefaultBlackList = [
                        '0-mail.com',
                        '0815.ru',
                        '0815.su',
                        '0clickemail.com',
                    Severity: Major
                    Found in apps/meteor/app/lib/server/lib/defaultBlockedDomainsList.ts - About 2 days to fix

                      SubscriptionsRaw has 120 functions (exceeds 20 allowed). Consider refactoring.
                      Open

                      export class SubscriptionsRaw extends BaseRaw<ISubscription> implements ISubscriptionsModel {
                          constructor(db: Db, trash?: Collection<RocketChatRecordDeleted<ISubscription>>) {
                              super(db, 'subscription', trash);
                          }
                      
                      
                      Severity: Major
                      Found in apps/meteor/server/models/raw/Subscriptions.ts - About 2 days to fix

                        Function OutgoingWebhookForm has 462 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        const OutgoingWebhookForm = () => {
                            const t = useTranslation();
                        
                            const {
                                control,

                          LivechatRoomsRaw has 117 functions (exceeds 20 allowed). Consider refactoring.
                          Open

                          export class LivechatRoomsRaw extends BaseRaw<IOmnichannelRoom> implements ILivechatRoomsModel {
                              constructor(db: Db, trash?: Collection<RocketChatRecordDeleted<IOmnichannelRoom>>) {
                                  super(db, 'room', trash);
                              }
                          
                          
                          Severity: Major
                          Found in apps/meteor/server/models/raw/LivechatRooms.ts - About 2 days to fix

                            File api.ts has 902 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            import type { IMethodConnection, IUser, IRoom } from '@rocket.chat/core-typings';
                            import { Logger } from '@rocket.chat/logger';
                            import { Users } from '@rocket.chat/models';
                            import { Random } from '@rocket.chat/random';
                            import type { JoinPathPattern, Method } from '@rocket.chat/rest-typings';
                            Severity: Major
                            Found in apps/meteor/app/api/server/api.ts - About 2 days to fix

                              Function get has 435 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  get: async (): Promise<IStats> => {
                                      const readPreference = readSecondaryPreferred(db);
                              
                                      const statistics = {} as IStats;
                                      const statsPms = [];
                              Severity: Major
                              Found in apps/meteor/app/statistics/server/lib/statistics.ts - About 2 days to fix

                                File chat.ts has 874 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                import type { IMessage, IRoom, MessageAttachment, ReadReceipt, OtrSystemMessages, MessageUrl } from '@rocket.chat/core-typings';
                                import Ajv from 'ajv';
                                
                                import type { PaginatedRequest } from '../helpers/PaginatedRequest';
                                
                                
                                Severity: Major
                                Found in packages/rest-typings/src/v1/chat.ts - About 2 days to fix

                                  Function createOauthSettings has 418 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      settingsRegistry.addGroup('OAuth', async function () {
                                          await this.section('Drupal', async function () {
                                              const enableQuery = {
                                                  _id: 'Accounts_OAuth_Drupal',
                                                  value: true,
                                  Severity: Major
                                  Found in apps/meteor/server/settings/oauth.ts - About 2 days to fix

                                    File service.ts has 852 lines of code (exceeds 250 allowed). Consider refactoring.
                                    Open

                                    import { Room, Authorization, Message, ServiceClassInternal } from '@rocket.chat/core-services';
                                    import type {
                                        IListRoomsFilter,
                                        ITeamAutocompleteResult,
                                        ITeamCreateParams,
                                    Severity: Major
                                    Found in apps/meteor/server/services/team/service.ts - About 2 days to fix

                                      File WebRTCClass.js has 829 lines of code (exceeds 250 allowed). Consider refactoring.
                                      Open

                                      import { Emitter } from '@rocket.chat/emitter';
                                      import { Meteor } from 'meteor/meteor';
                                      import { ReactiveVar } from 'meteor/reactive-var';
                                      import { Tracker } from 'meteor/tracker';
                                      
                                      
                                      Severity: Major
                                      Found in apps/meteor/app/webrtc/client/WebRTCClass.js - About 1 day to fix

                                        MessagesRaw has 99 functions (exceeds 20 allowed). Consider refactoring.
                                        Open

                                        export class MessagesRaw extends BaseRaw<IMessage> implements IMessagesModel {
                                            constructor(db: Db, trash?: Collection<RocketChatRecordDeleted<IMessage>>) {
                                                super(db, 'message', trash);
                                            }
                                        
                                        
                                        Severity: Major
                                        Found in apps/meteor/server/models/raw/Messages.ts - About 1 day to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language