Showing 715 of 715 total issues
Function getFieldsByProjection
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public async getFieldsByProjection(
tableId: string,
projection?: { [fieldNameOrId: string]: boolean },
fieldKeyType: FieldKeyType = FieldKeyType.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 castToSingleSelect
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private async castToSingleSelect(cellValues: unknown[]): Promise<unknown[]> {
const allValuesSet = new Set<string>();
const { preventAutoNewOptions } = this.field.options as ISelectFieldOptions;
const existsChoicesNameMap = this.cache.choicesMap as Record<string, ISelectFieldChoice>;
const newCellValues = this.mapFieldsCellValuesWithValidate(cellValues, (cellValue: unknown) => {
- 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 getSearchFields
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
async getSearchFields(
originFieldInstanceMap: Record<string, IFieldInstance>,
search?: [string, string?, boolean?],
viewId?: string,
projection?: 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 selectionCoverAttachments
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const selectionCoverAttachments = (selection: CombinedSelection, fields: Field[]) => {
const { type, ranges } = selection;
switch (type) {
case SelectionRegionType.Cells: {
const [start, end] = ranges;
- 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 checkConfig
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private checkConfig() {
const { tokenExpireIn } = this.config;
if (ms(tokenExpireIn) >= ms('7d')) {
throw new BadRequestException('Token expire in must be more than 7 days');
}
- 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 ResetPasswordPage
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const ResetPasswordPage = () => {
const [error, setError] = useState<string>();
const [password, setPassword] = useState<string>();
const router = useRouter();
const code = router.query.code as 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 sentryFlushServerSide
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const sentryFlushServerSide = async (flushAfter: number) => {
if (typeof window === 'undefined') {
try {
await sentryFlush(flushAfter);
} catch (e) {
- 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 AddDateFieldDialog
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const AddDateFieldDialog = () => {
const { t } = useTranslation(tableConfig.i18nNamespaces);
const view = useView();
const tableId = useTableId();
const permission = useTablePermission();
- 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 InplaceFieldConfigPanel
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const InplaceFieldConfigPanel = (props: IInplaceFieldConfigPanel) => {
const baseId = useBaseId() as string;
const { t } = useTranslation(['table']);
const { tableId, workSheets, insertConfig, onChange, errorMessage } = props;
- 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 NumberFormatting
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const NumberFormatting: React.FC<IProps> = (props) => {
const { formatting = defaultNumberFormatting, onChange } = props;
const { type, precision } = formatting;
const { t } = useTranslation(['table']);
- 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 Account
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const Account: React.FC = () => {
const { user: sessionUser, refresh, refreshAvatar } = useSession();
const { t } = useTranslation('common');
const updateUserAvatarMutation = useMutation(updateUserAvatar, {
- 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 LoginPage
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const LoginPage = (props: { children?: React.ReactNode | React.ReactNode[] }) => {
const { children } = props;
const { t } = useTranslation(authConfig.i18nNamespaces);
const router = useRouter();
const redirect = decodeURIComponent((router.query.redirect as 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 OAuthAppDecisionPage
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const OAuthAppDecisionPage = () => {
const router = useRouter();
const { user } = useSession();
const transactionId = router.query.transaction_id as string;
const getPreviewUrl = usePreviewUrl();
- 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 ExpirationSelect
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const ExpirationSelect = (props: IExpirationSelect) => {
const { onChange } = props;
const [isCustom, setIsCustom] = useState<boolean>(false);
const [date, setDate] = useState<Date>();
const { t } = useTranslation('token');
- 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 NotificationsManage
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const NotificationsManage: React.FC = () => {
const queryClient = useQueryClient();
const notification = useNotification();
const { t } = useTranslation('common');
- 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"