Showing 3,268 of 8,229 total issues
Function _retrySubscription
has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring. Open
Autoupdate._retrySubscription = () => {
Meteor.subscribe("meteor_autoupdate_clientVersions", {
onError(error) {
Meteor._debug("autoupdate subscription failed", error);
failures++;
- 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 rooms.ts
has 538 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { Media } from '@rocket.chat/core-services';
import type { IRoom } from '@rocket.chat/core-typings';
import { Messages, Rooms, Users } from '@rocket.chat/models';
import type { Notifications } from '@rocket.chat/rest-typings';
import { isGETRoomsNameExists } from '@rocket.chat/rest-typings';
Function addSettings
has 222 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function addSettings(): Promise<void> {
return settingsRegistry.addGroup('LDAP', async function () {
const enableQuery = { _id: 'LDAP_Enable', value: true };
await this.with(
File voip.ts
has 536 lines of code (exceeds 250 allowed). Consider refactoring. Open
import type {
IQueueSummary,
ILivechatAgent,
IVoipRoom,
IUser,
File email.ts
has 531 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { settingsRegistry } from '../../app/settings/server';
export const createEmailSettings = () =>
settingsRegistry.addGroup('Email', async function () {
await this.section('Style', async function () {
File Manager.ts
has 520 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { Team } from '@rocket.chat/core-services';
import type { ILDAPEntry, IUser, IRoom, IRole, IImportUser, IImportRecord } from '@rocket.chat/core-typings';
import { Users, Roles, Subscriptions as SubscriptionsRaw, Rooms } from '@rocket.chat/models';
import type ldapjs from 'ldapjs';
Function createLayoutSettings
has 210 lines of code (exceeds 25 allowed). Consider refactoring. Open
settingsRegistry.addGroup('Layout', async function () {
await this.section('Login', async function () {
await this.add('Layout_Login_Hide_Logo', false, {
type: 'boolean',
public: true,
File rooms.ts
has 516 lines of code (exceeds 250 allowed). Consider refactoring. Open
import type { IMessage, IRoom, IUser, RoomAdminFieldsType } from '@rocket.chat/core-typings';
import Ajv from 'ajv';
import type { PaginatedRequest } from '../helpers/PaginatedRequest';
import type { PaginatedResult } from '../helpers/PaginatedResult';
Function useAnalyticsEventTracking
has 209 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const useAnalyticsEventTracking = () => {
const router = useRouter();
useEffect(
() =>
File OutgoingWebhookForm.tsx
has 515 lines of code (exceeds 250 allowed). Consider refactoring. Open
import type { IOutgoingIntegration } from '@rocket.chat/core-typings';
import type { SelectOption } from '@rocket.chat/fuselage';
import {
FieldError,
AccordionItem,
File codes.js
has 514 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* This file is part of https://github.com/martynsmith/node-irc
* by https://github.com/martynsmith
*/
Function getTriggersToExecute
has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring. Open
getTriggersToExecute(room, message) {
const triggersToExecute = new Set();
if (room) {
switch (room.t) {
case 'd':
- 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 AppMenu
has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring. Open
function AppMenu({ app, isAppDetailsPage, ...props }) {
const t = useTranslation();
const dispatchToastMessage = useToastMessageDispatch();
const setModal = useSetModal();
const router = useRouter();
- 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 validate
has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring. Open
public validate(xml: string, callback: IResponseValidateCallback): void {
// We currently use RelayState to save SAML provider
SAMLUtils.log(`Validating response with relay state: ${xml}`);
let error: Error | null = null;
- 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 statistics.ts
has 503 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { log } from 'console';
import os from 'os';
import { Analytics, Team, VideoConf, Presence } from '@rocket.chat/core-services';
import type { IRoom, IStats } from '@rocket.chat/core-typings';
Function PreferencesMessagesSection
has 198 lines of code (exceeds 25 allowed). Consider refactoring. Open
const PreferencesMessagesSection = () => {
const t = useTranslation();
const { control } = useFormContext();
const alsoSendThreadMessageToChannelOptions = useMemo(
Function AccessibilityPage
has 194 lines of code (exceeds 25 allowed). Consider refactoring. Open
const AccessibilityPage = () => {
const t = useTranslation();
const dispatchToastMessage = useToastMessageDispatch();
const preferencesValues = useAccessiblityPreferencesValues();
Function PreferencesNotificationsSection
has 194 lines of code (exceeds 25 allowed). Consider refactoring. Open
const PreferencesNotificationsSection = () => {
const t = useTranslation();
const [notificationsPermission, setNotificationsPermission] = useState<NotificationPermission>();
Function generateEml
has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring. Open
export const generateEml = async (): Promise<void> => {
setImmediate(async () => {
const smarshMissingEmail = settings.get('Smarsh_MissingEmail_Email');
const timeZone = settings.get<string>('Smarsh_Timezone');
- 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 prepareUsingLocalFile
has 192 lines of code (exceeds 25 allowed). Consider refactoring. Open
async prepareUsingLocalFile(fullFilePath: string): Promise<ImporterProgress> {
this.logger.debug('start preparing import operation');
await this.converter.clearImportData();
const zip = new this.AdmZip(fullFilePath);