Showing 3,291 of 8,320 total issues
Function RegisterForm
has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring. Open
export const RegisterForm = ({ setLoginRoute }: { setLoginRoute: DispatchLoginRouter }): ReactElement => {
const { t } = useTranslation();
const requireNameForRegister = Boolean(useSetting('Accounts_RequireNameForSignUp'));
const requiresPasswordConfirmation = useSetting('Accounts_RequirePasswordConfirmation');
- Read upRead up
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 ThreadList
has 152 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ThreadList: VFC = () => {
const t = useTranslation();
const { closeTab } = useRoomToolbox();
Function ChatTable
has 152 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ChatTable = () => {
const t = useTranslation();
const [text, setText] = useState('');
const userIdLoggedIn = useUserId();
const directoryRoute = useRoute('omnichannel-directory');
Function MailerPage
has 151 lines of code (exceeds 25 allowed). Consider refactoring. Open
const MailerPage = () => {
const t = useTranslation();
const dispatchToastMessage = useToastMessageDispatch();
const {
MatrixBridge
has 44 functions (exceeds 20 allowed). Consider refactoring. Open
export class MatrixBridge implements IFederationBridge {
protected bridgeInstance: Bridge;
protected isRunning = false;
Function MonitorsTable
has 150 lines of code (exceeds 25 allowed). Consider refactoring. Open
const MonitorsTable = () => {
const t = useTranslation();
const setModal = useSetModal();
const [text, setText] = useState('');
Function updateIncomingIntegration
has 148 lines of code (exceeds 25 allowed). Consider refactoring. Open
async updateIncomingIntegration(integrationId, integration) {
if (!this.userId) {
throw new Meteor.Error('error-invalid-user', 'Invalid user', {
method: 'updateOutgoingIntegration',
});
Function ContactTable
has 148 lines of code (exceeds 25 allowed). Consider refactoring. Open
function ContactTable(): ReactElement {
const { current, itemsPerPage, setItemsPerPage, setCurrent, ...paginationProps } = usePagination();
const { sortBy, sortDirection, setSort } = useSort<'username' | 'phone' | 'name' | 'visitorEmails.address' | 'lastchat'>('username');
const isCallReady = useIsCallReady();
Function convertMessages
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
async convertMessages({
beforeImportFn,
afterImportFn,
onErrorFn,
afterImportAllMessagesFn,
- Read upRead up
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 NewImportPage
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
function NewImportPage() {
const t = useTranslation();
const dispatchToastMessage = useToastMessageDispatch();
const handleError = useErrorHandler();
- Read upRead up
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 RoomBody
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
const RoomBody = (): ReactElement => {
const chat = useChat();
if (!chat) {
throw new Error('No ChatContext provided');
}
- Read upRead up
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 rocketchat.e2e.ts
has 413 lines of code (exceeds 250 allowed). Consider refactoring. Open
import QueryString from 'querystring';
import URL from 'url';
import type { IE2EEMessage, IMessage, IRoom, ISubscription } from '@rocket.chat/core-typings';
import { isE2EEMessage } from '@rocket.chat/core-typings';
File push.ts
has 412 lines of code (exceeds 250 allowed). Consider refactoring. Open
import type { IAppsTokens, RequiredField, Optional, IPushNotificationConfig } from '@rocket.chat/core-typings';
import { AppsTokens } from '@rocket.chat/models';
import { serverFetch as fetch } from '@rocket.chat/server-fetch';
import { pick } from '@rocket.chat/tools';
import Ajv from 'ajv';
Function ImportProgressPage
has 147 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ImportProgressPage = function ImportProgressPage() {
const queryClient = useQueryClient();
const streamer = useStream('importers');
const t = useTranslation();
const dispatchToastMessage = useToastMessageDispatch();
File templates.ts
has 411 lines of code (exceeds 250 allowed). Consider refactoring. Open
import type { LayoutBlock } from '@rocket.chat/ui-kit';
import { SurfaceOptions } from '../Components/Preview/Display/Surface/constant';
type payload = {
surface: SurfaceOptions;
File listeners.module.ts
has 411 lines of code (exceeds 250 allowed). Consider refactoring. Open
import type { AppStatus } from '@rocket.chat/apps-engine/definition/AppStatus';
import type { ISetting as AppsSetting } from '@rocket.chat/apps-engine/definition/settings';
import type { IServiceClass } from '@rocket.chat/core-services';
import { EnterpriseSettings } from '@rocket.chat/core-services';
import { isSettingColor, isSettingEnterprise, UserStatus } from '@rocket.chat/core-typings';
File SAML.ts
has 409 lines of code (exceeds 250 allowed). Consider refactoring. Open
import type { ServerResponse } from 'http';
import type { IUser, IIncomingMessage, IPersonalAccessToken } from '@rocket.chat/core-typings';
import { CredentialTokens, Rooms, Users } from '@rocket.chat/models';
import { Random } from '@rocket.chat/random';
Function insertAdminUserFromEnv
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
export async function insertAdminUserFromEnv() {
if (process.env.ADMIN_PASS) {
if ((await (await getUsersInRole('admin')).count()) === 0) {
const adminUser = {
name: 'Administrator',
- Read upRead up
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 onUserStream
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
async onUserStream(type: string, data: IOnUserStreamData): Promise<void> {
switch (type) {
case 'handshake':
let timeout: NodeJS.Timeout;
- Read upRead up
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 createRetentionSettings
has 143 lines of code (exceeds 25 allowed). Consider refactoring. Open
settingsRegistry.addGroup('RetentionPolicy', async function () {
const globalQuery = {
_id: 'RetentionPolicy_Enabled',
value: true,
};