RocketChat/Rocket.Chat

View on GitHub

Showing 3,233 of 8,169 total issues

File emojis.ts has 4630 lines of code (exceeds 250 allowed). Consider refactoring.
Open

const emojis = {
    ':england:': '๐Ÿด๓ ง๓ ข๓ ฅ๓ ฎ๓ ง๓ ฟ',
    ':scotland:': '๐Ÿด๓ ง๓ ข๓ ณ๓ ฃ๓ ด๓ ฟ',
    ':wales:': '๐Ÿด๓ ง๓ ข๓ ท๓ ฌ๓ ณ๓ ฟ',
    ':men_holding_hands_medium_light_skin_tone_light_skin_tone:': '๐Ÿ‘จ๐Ÿผโ€๐Ÿคโ€๐Ÿ‘จ๐Ÿป',
Severity: Major
Found in packages/livechat/src/lib/emoji/emojis.ts - About 1 wk to fix

    File omnichannel.ts has 3497 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import type {
        IOmnichannelCannedResponse,
        ILivechatAgent,
        ILivechatDepartment,
        ILivechatDepartmentAgents,
    Severity: Major
    Found in packages/rest-typings/src/v1/omnichannel.ts - About 1 wk to fix

      File Users.js has 2516 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import { ILivechatAgentStatus } from '@rocket.chat/core-typings';
      import { Subscriptions } from '@rocket.chat/models';
      import { escapeRegExp } from '@rocket.chat/string-helpers';
      
      import { BaseRaw } from './BaseRaw';
      Severity: Major
      Found in apps/meteor/server/models/raw/Users.js - About 1 wk to fix

        File LivechatRooms.ts has 2483 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import type {
            IOmnichannelRoom,
            RocketChatRecordDeleted,
            IOmnichannelRoomClosingInfo,
            DeepWritable,
        Severity: Major
        Found in apps/meteor/server/models/raw/LivechatRooms.ts - About 6 days to fix

          Function createSetupWSettings has 1348 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              settingsRegistry.addGroup('Setup_Wizard', async function () {
                  await this.section('Organization_Info', async function () {
                      await this.add('Organization_Type', '', {
                          type: 'select',
                          values: [
          Severity: Major
          Found in apps/meteor/server/settings/setup-wizard.ts - About 6 days to fix

            Function addManagementRoutes has a Cognitive Complexity of 274 (exceeds 5 allowed). Consider refactoring.
            Open

                addManagementRoutes() {
                    const orchestrator = this._orch;
                    const manager = this._manager;
            
                    const handleError = (message: string, e: any) => {
            Severity: Minor
            Found in apps/meteor/ee/server/apps/communication/rest.ts - About 5 days 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

            File emojiPicker.ts has 1943 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /*
             * This file is automatically generated from generateEmojiIndex.mjs
             * Last generated Tue Apr 09 2019 15:27:21 GMT-0300 (-03)
             *
             * Mapping category hashes into human readable and translated names
            Severity: Major
            Found in apps/meteor/app/emoji-emojione/lib/emojiPicker.ts - About 5 days to fix

              Function addManagementRoutes has 1017 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  addManagementRoutes() {
                      const orchestrator = this._orch;
                      const manager = this._manager;
              
                      const handleError = (message: string, e: any) => {
              Severity: Major
              Found in apps/meteor/ee/server/apps/communication/rest.ts - About 5 days to fix

                File UiKitParserModal.spec.ts has 1857 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import type { OverflowElement } from '../../blocks/elements/OverflowElement';
                import type { PlainText } from '../../blocks/text/PlainText';
                import { BlockContext } from '../../rendering/BlockContext';
                import { UiKitParserModal } from './UiKitParserModal';
                import { uiKitModal } from './uiKitModal';
                Severity: Major
                Found in packages/ui-kit/src/surfaces/modal/UiKitParserModal.spec.ts - About 5 days to fix

                  File UiKitParserContextualBar.spec.ts has 1857 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import type { OverflowElement } from '../../blocks/elements/OverflowElement';
                  import type { PlainText } from '../../blocks/text/PlainText';
                  import { BlockContext } from '../../rendering/BlockContext';
                  import { UiKitParserContextualBar } from './UiKitParserContextualBar';
                  import { uiKitContextualBar } from './uiKitContextualBar';

                    File UiKitParserBanner.spec.ts has 1856 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    import type { PlainText } from '../../blocks/text/PlainText';
                    import { BlockContext } from '../../rendering/BlockContext';
                    import { UiKitParserBanner } from './UiKitParserBanner';
                    import { uiKitBanner } from './uiKitBanner';
                    
                    
                    Severity: Major
                    Found in packages/ui-kit/src/surfaces/banner/UiKitParserBanner.spec.ts - About 5 days to fix

                      File Rooms.ts has 1675 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      import type {
                          IDirectMessageRoom,
                          IMessage,
                          IOmnichannelGenericRoom,
                          IRoom,
                      Severity: Major
                      Found in apps/meteor/server/models/raw/Rooms.ts - About 4 days to fix

                        File wordList.ts has 1635 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        export default [
                            'acrobat',
                            'africa',
                            'alaska',
                            'albert',
                        Severity: Major
                        Found in apps/meteor/app/e2e/client/wordList.ts - About 4 days to fix

                          UsersRaw has 215 functions (exceeds 20 allowed). Consider refactoring.
                          Open

                          export class UsersRaw extends BaseRaw {
                              constructor(db, trash) {
                                  super(db, 'users', trash, {
                                      collectionNameResolver(name) {
                                          return name;
                          Severity: Major
                          Found in apps/meteor/server/models/raw/Users.js - About 4 days to fix

                            File Messages.ts has 1530 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            import type {
                                ILivechatDepartment,
                                IMessage,
                                IRoom,
                                IUser,
                            Severity: Major
                            Found in apps/meteor/server/models/raw/Messages.ts - About 4 days to fix

                              File Sessions.ts has 1508 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              import type {
                                  ISession,
                                  UserSessionAggregation,
                                  DeviceSessionAggregation,
                                  OSSessionAggregation,
                              Severity: Major
                              Found in apps/meteor/server/models/raw/Sessions.ts - About 4 days to fix

                                File Subscriptions.ts has 1466 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                import type {
                                    AtLeast,
                                    IRole,
                                    IRoom,
                                    ISubscription,
                                Severity: Major
                                Found in apps/meteor/server/models/raw/Subscriptions.ts - About 3 days to fix

                                  Function createAccountSettings has 762 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      settingsRegistry.addGroup('Accounts', async function () {
                                          await this.section('Two Factor Authentication', async function () {
                                              const enable2FA = {
                                                  _id: 'Accounts_TwoFactorAuthentication_Enabled',
                                                  value: true,
                                  Severity: Major
                                  Found in apps/meteor/server/settings/accounts.ts - About 3 days to fix

                                    File UiKitParserMessage.spec.ts has 1388 lines of code (exceeds 250 allowed). Consider refactoring.
                                    Open

                                    import { BlockContext } from '../../rendering/BlockContext';
                                    import { UiKitParserMessage } from './UiKitParserMessage';
                                    import { uiKitMessage } from './uiKitMessage';
                                    
                                    class TestParser extends UiKitParserMessage<unknown> {
                                    Severity: Major
                                    Found in packages/ui-kit/src/surfaces/message/UiKitParserMessage.spec.ts - About 3 days to fix

                                      File UiKitParserAttachment.spec.ts has 1388 lines of code (exceeds 250 allowed). Consider refactoring.
                                      Open

                                      import { BlockContext } from '../../rendering/BlockContext';
                                      import { UiKitParserAttachment } from './UiKitParserAttachment';
                                      import { uiKitAttachment } from './uiKitAttachment';
                                      
                                      class TestParser extends UiKitParserAttachment<unknown> {
                                      Severity: Major
                                      Found in packages/ui-kit/src/surfaces/attachment/UiKitParserAttachment.spec.ts - About 3 days to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language