Showing 8,229 of 8,229 total issues
Function ComposerOmnichannelInquiry
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const ComposerOmnichannelInquiry = (): ReactElement => {
const dispatchToastMessage = useToastMessageDispatch();
const room = useOmnichannelRoom();
const getInquire = useEndpoint('GET', `/v1/livechat/inquiries.getOne`);
- 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 AppSetting
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const AppSetting = ({ id, type, i18nLabel, i18nDescription, values, value, packageValue, ...props }: ISetting): ReactElement => {
const appId = useRouteParameter('id');
const tApp = useAppTranslation(appId || '');
const label = (i18nLabel && tApp(i18nLabel)) || id || tApp(id);
- 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 LegacyBanner
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const LegacyBanner: FC<LegacyBannerProps> = ({ config }) => {
const { closable = true, title, text, html, icon, modifiers } = config;
const inline = !modifiers?.includes('large');
const variant = modifiers?.includes('danger') ? 'danger' : 'info';
- 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 BusinessHoursRouter
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const BusinessHoursRouter = () => {
const router = useRouter();
const context = useRouteParameter('context');
const id = useRouteParameter('id');
const type = useRouteParameter('type') as LivechatBusinessHourTypes;
- 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 TriggersRow
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const TriggersRow = ({ _id, name, description, enabled, reload }: TriggersRowProps) => {
const t = useTranslation();
const setModal = useSetModal();
const triggersRoute = useRoute('omnichannel-triggers');
const deleteTrigger = useEndpoint('DELETE', '/v1/livechat/triggers/:_id', { _id });
- 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 AgentField
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const AgentField = ({ agent, isSmall = false }: AgentFieldProps) => {
const t = useTranslation();
const { username = '' } = agent ?? {};
const getUserInfo = useEndpoint('GET', '/v1/users.info');
const { data, isLoading } = useQuery(['/v1/users.info', username], () => getUserInfo({ username }));
- 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 TeamsInfo
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const TeamsInfo = ({
room,
retentionPolicy,
onClickHide,
onClickClose,
- 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 ChannelDesertionTable
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const ChannelDesertionTable: FC<ChannelDesertionTableProps> = ({
rooms,
eligibleRoomsLength,
onChangeRoomSelection,
selectedRooms,
- 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 WebhooksPage
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const WebhooksPage = ({ settings }: WebhooksPageProps) => {
const t = useTranslation();
const dispatchToastMessage = useToastMessageDispatch();
const defaultValues = getInitialValues(settings);
const {
- 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 MeetRoute
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const MeetRoute = () => {
const router = useRouter();
const dispatchToastMessage = useToastMessageDispatch();
const { t } = useTranslation();
- 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 ContactTable
has a Cognitive Complexity of 6 (exceeds 5 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();
- 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 AddAgent
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function AddAgent({ agentList, onAdd }: { agentList: IDepartmentAgent[]; onAdd: (agent: IDepartmentAgent) => void }) {
const t = useTranslation();
const [userId, setUserId] = useState('');
- 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 BaseTeamsChannels
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const BaseTeamsChannels = ({
loading,
channels = [],
text,
type,
- 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 CurrentUserDisplay
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const CurrentUserDisplay = ({ user }: CurrentUserDisplayProps) => {
const showRealNames = useSetting<boolean>('UI_Use_Real_Name');
const getRoles = useRolesDescription();
const { t } = useTranslation();
- 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 AddUsers
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const AddUsers = ({ rid, onClickBack, reload }: AddUsersProps): ReactElement => {
const t = useTranslation();
const dispatchToastMessage = useToastMessageDispatch();
const room = useRoom();
- 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 AppDetailsPageHeader
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const AppDetailsPageHeader = ({ app }: { app: App }): ReactElement => {
const t = useTranslation();
const {
iconFileData,
name,
- 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 AppRow
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const AppRow = ({ className, ...props }: App & { className?: string }): ReactElement => {
const { name, id, shortDescription, iconFileData, marketplaceVersion, iconFileContent, installed, bundledIn, version } = props;
const router = useRouter();
const context = useRouteParameter('context');
- 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 parseMessageTextToAstMarkdown
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const parseMessageTextToAstMarkdown = <
TMessage extends IMessage & Partial<ITranslatedMessage> = IMessage & Partial<ITranslatedMessage>,
>(
message: TMessage,
parseOptions: Options,
- 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 useOutsideClick
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const useOutsideClick = (
ref: RefObject<HTMLElement>,
onDismiss: (() => void) | undefined,
): {
onMouseDown: (e: MouseEvent) => 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 notifyNewMessageAudio
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function notifyNewMessageAudio(rid?: string): void {
// This logic is duplicated in /client/startup/unread.coffee.
const hasFocus = document.hasFocus();
const messageIsInOpenedRoom = RoomManager.opened === rid;
const muteFocusedConversations = getUserPreference(Meteor.userId(), 'muteFocusedConversations');
- 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"