Showing 8,229 of 8,229 total issues
Function get
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const get: FileUploadClass['get'] = async function (this: FileUploadClass, file, req, res) {
const { query } = URL.parse(req.url || '', true);
const forceDownload = typeof query.download !== 'undefined';
const fileUrl = await this.store.getRedirectURL(file, forceDownload);
- 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 archiveRoom
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
async archiveRoom(rid) {
check(rid, String);
const userId = Meteor.userId();
if (!userId) {
- 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 validateStatus
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static validateStatus(doc: Document): {
success: boolean;
message: string;
statusCode: 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 updateGlobalSettings
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static updateGlobalSettings(samlConfigs: Record<string, any>): void {
debug = Boolean(samlConfigs.debug);
globalSettings.generateUsername = Boolean(samlConfigs.generateUsername);
globalSettings.nameOverwrite = Boolean(samlConfigs.nameOverwrite);
- 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 fillTemplateData
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static fillTemplateData(template: string, data: Record<string, string>): string {
let newTemplate = template;
for (const variable in data) {
if (variable in data) {
- 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 useInviteToken
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const useInviteToken = async (userId: string, token: string) => {
if (!userId) {
throw new Meteor.Error('error-invalid-user', 'The user is invalid', {
method: 'useInviteToken',
field: 'userId',
- 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 validateMessage
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const validateMessage = async (message: any, room: any, user: any) => {
check(
message,
objectMaybeIncluding({
_id: 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 loadMessageHistory
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export async function loadMessageHistory({
userId,
rid,
end,
limit = 20,
- 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 saveSettings
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
async (
params: {
_id: ISetting['_id'];
value: ISetting['value'];
}[] = [],
- 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 parseMessageTextPerUser
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export async function parseMessageTextPerUser(
messageText: string,
message: Pick<IMessage, 'u' | 'msg' | 't' | 'attachments'>,
receiver: Pick<IUser, 'language'>,
): Promise<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 TooltipProvider
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const TooltipProvider: FC = ({ children }) => {
const lastAnchor = useRef<HTMLElement>();
const hasHover = !useMediaQuery('(hover: none)');
const [tooltip, setTooltip] = useDebouncedState<ReactNode>(null, 300);
- 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 useComposerBoxPopupQueries
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const useComposerBoxPopupQueries = <T extends { _id: string; sort?: number }>(filter: unknown, popup?: ComposerPopupOption<T>) => {
const [counter, setCounter] = useState(0);
useEffect(() => {
setCounter(0);
- 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 AppsProvider
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const AppsProvider: FC = ({ children }) => {
const isAdminUser = usePermission('manage-apps');
const queryClient = useQueryClient();
- 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 shouldBypass
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const shouldBypass = ({ msg, method, params }: Meteor.IDDPMessage): boolean => {
if (msg !== 'method') {
return true;
}
- 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 useImagesList
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const useImagesList = (
options: ChannelsImagesProps,
): {
filesList: ImagesList;
initialItemCount: number;
- 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 useOmnichannelCloseRoute
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const useOmnichannelCloseRoute = () => {
const hideConversationAfterClosing = useUserPreference<boolean>('omnichannelHideConversationAfterClosing') ?? true;
const router = useRouter();
const navigateHome = useCallback(() => {
- 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 PlanCardTrial
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const PlanCardTrial = ({ licenseInformation }: PlanCardProps): ReactElement => {
const { t } = useTranslation();
const planName = useLicenseName();
const isSalesAssisted = licenseInformation.grantedBy?.method !== 'self-service' || true;
- 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 useMessageComposerMergedRefs
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const useMessageComposerMergedRefs = <T>(...refs: Ref<T>[]): RefCallback<T> => {
return useCallback((refValue: T) => {
refs.filter(Boolean).forEach((ref) => {
if (isRefCallback<T>(ref)) {
ref(refValue);
- 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 useUserCustomFields
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const useUserCustomFields = (customFields: CustomField): CustomFieldDisplay[] | undefined => {
const customFieldsToShowSetting = useSetting('Accounts_CustomFieldsToShowInUserInfo');
let customFieldsToShowObj: CustomField[] | undefined;
try {
- 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 useArchiveRoom
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const useArchiveRoom = (room: Pick<IRoom, RoomAdminFieldsType>) => {
const t = useTranslation();
const dispatchToastMessage = useToastMessageDispatch();
const archiveAction = useEndpoint('POST', '/v1/rooms.changeArchivationState');
- 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"