Showing 3,291 of 8,320 total issues
Function Register
has 142 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const Register: FunctionalComponent<{ path: string }> = () => {
const { t } = useTranslation();
const topRef = useRef<HTMLDivElement>(null);
const bottomRef = useRef<HTMLDivElement>(null);
Function AccountTokensTable
has 142 lines of code (exceeds 25 allowed). Consider refactoring. Open
const AccountTokensTable = (): ReactElement => {
const t = useTranslation();
const dispatchToastMessage = useToastMessageDispatch();
const setModal = useSetModal();
const userId = useUserId();
Function createPushSettings
has 141 lines of code (exceeds 25 allowed). Consider refactoring. Open
settingsRegistry.addGroup('Push', async function () {
await this.add('Push_enable', true, {
type: 'boolean',
public: true,
alert: 'Push_Setting_Requires_Restart_Alert',
File message.ts
has 400 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { MessageTypesValues } from '../../app/lib/lib/MessageTypes';
import { settingsRegistry } from '../../app/settings/server';
export const createMessageSettings = () =>
settingsRegistry.addGroup('Message', async function () {
Function getEmojisBySearchTerm
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
export const getEmojisBySearchTerm = (
searchTerm: string,
actualTone: number,
recentEmojis: string[],
setRecentEmojis: (emojis: string[]) => void,
- 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 AppsPageContent
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
const AppsPageContent = (): ReactElement => {
const t = useTranslation();
const { marketplaceApps, installedApps, privateApps, reload } = useAppsResult();
const [text, setText] = useDebouncedState('', 500);
const { current, itemsPerPage, setItemsPerPage: onSetItemsPerPage, setCurrent: onSetCurrent, ...paginationProps } = usePagination();
- 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 RoomMenu
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
const RoomMenu = ({
rid,
unread,
threadUnread,
alert,
- 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 MessageBox.tsx
has 397 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* eslint-disable complexity */
import type { IMessage, ISubscription } from '@rocket.chat/core-typings';
import { useContentBoxSize, useMutableCallback } from '@rocket.chat/fuselage-hooks';
import {
MessageComposerAction,
Function constructor
has 138 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(options: StoreOptions) {
options = {
onCopyError: this.onCopyError,
onFinishUpload: this.onFinishUpload,
onRead: this.onRead,
File LivechatDepartment.ts
has 396 lines of code (exceeds 250 allowed). Consider refactoring. Open
import type { ILivechatDepartment, RocketChatRecordDeleted } from '@rocket.chat/core-typings';
import type { ILivechatDepartmentModel } from '@rocket.chat/model-typings';
import { LivechatDepartmentAgents, LivechatUnitMonitors } from '@rocket.chat/models';
import { escapeRegExp } from '@rocket.chat/string-helpers';
import type {
File service.ts
has 396 lines of code (exceeds 250 allowed). Consider refactoring. Open
import type { IOmnichannelVoipService, FindVoipRoomsParams } from '@rocket.chat/core-services';
import { api, ServiceClassInternal, Voip } from '@rocket.chat/core-services';
import type {
IVoipExtensionBase,
IVoipExtensionWithAgentInfo,
File license.ts
has 396 lines of code (exceeds 250 allowed). Consider refactoring. Open
import type {
ILicenseTag,
LicenseEvents,
ILicenseV2,
ILicenseV3,
VideoConfManager
has 41 functions (exceeds 20 allowed). Consider refactoring. Open
export const VideoConfManager = new (class VideoConfManager extends Emitter<VideoConfEvents> {
private userId: string | undefined;
private currentCallHandler: ReturnType<typeof setTimeout> | undefined;
Function LeaveMessage
has 136 lines of code (exceeds 25 allowed). Consider refactoring. Open
const LeaveMessage: FunctionalComponent<{ path: string }> = () => {
const {
config: {
departments = [],
messages: { offlineMessage, offlineSuccessMessage, offlineUnavailableMessage },
Function onChangeRoomMembership
has 136 lines of code (exceeds 25 allowed). Consider refactoring. Open
public async onChangeRoomMembership(roomChangeMembershipInput: FederationRoomChangeMembershipDto): Promise<void> {
const {
externalRoomId,
normalizedInviteeId,
normalizedRoomId,
Function PruneMessagesWithData
has 136 lines of code (exceeds 25 allowed). Consider refactoring. Open
const PruneMessagesWithData = (): ReactElement => {
const t = useTranslation();
const room = useRoom();
const setModal = useSetModal();
const { closeTab: close } = useRoomToolbox();
Function saveUserProfile
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
async function saveUserProfile(
this: Meteor.MethodThisType,
settings: {
email?: string;
username?: string;
- 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 compareBSONValues
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
export const compareBSONValues = (a: unknown, b: unknown): number => {
if (a === undefined) {
return b === undefined ? 0 : -1;
}
- 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 onEmailReceived
has 135 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function onEmailReceived(email: ParsedMail, inbox: string, department = ''): Promise<void> {
logger.info(`New email conversation received on inbox ${inbox}. Will be assigned to department ${department}`);
if (!email.from?.value?.[0]?.address) {
return;
}
File ModerationReports.ts
has 391 lines of code (exceeds 250 allowed). Consider refactoring. Open
import type {
IMessage,
IModerationAudit,
IModerationReport,
RocketChatRecordDeleted,