Showing 671 of 671 total issues
Function appendDefaultValue
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
private async appendDefaultValue(
records: { id: string; fields: { [fieldNameOrId: string]: unknown } }[],
fieldKeyType: FieldKeyType,
fieldRaws: IFieldRaws
) {
- 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 Invite
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
export const Invite = (props: IInvite) => {
const { className, disabledLink, loading, roleSelect, sendInviteEmail, createInviteLink } = props;
const { t } = useTranslation('common');
const [inviteType, setInviteType] = useState<'link' | 'email'>('email');
- 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 ChatWindow
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
export const ChatWindow = () => {
const messageStore = useMessageStore();
const chatWindowRef = useRef<HTMLDivElement>(null);
const [chat] = useState(getDefaultChat);
const messageList = messageStore.messageList.filter((message) => message.chatId === chat?.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 MessageView
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
export const MessageView: React.FC<Props> = ({ message, chat }) => {
const userStore = useUserStore();
const isCurrentUser = message.creatorId === userStore.currentUser.id;
const isAiCode = message.content.includes('```ai');
const [debugAI, setDebugAI] = useState(false);
- 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 SingleNumberShowAs
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
export const SingleNumberShowAs: React.FC<ISingleNumberShowAsProps> = (props) => {
const { showAs, onChange } = props;
const { type, color, maxValue, showValue } = (showAs || {}) as ISingleNumberShowAs;
const selectedType = showAs == null ? numberFlag : type;
const { t } = useTranslation(tableConfig.i18nNamespaces);
- 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 CreateRecordModal
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export const CreateRecordModal = (props: ICreateRecordModalProps) => {
const { children, callback } = props;
const tableId = useTableId();
const viewId = useViewId();
const showFields = useFields();
- 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 checkIsColumnHeader
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
const checkIsColumnHeader = (props: ICheckRegionProps): IRegionData | null => {
const {
position,
scrollState,
coordInstance,
- 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 useScrollFrameRate
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export const useScrollFrameRate = (scrollFunction?: (deltaX: number, deltaY: number) => void) => {
const requestRef = useRef(0);
const lastTimeRef = useRef(0);
const frameCountRef = useRef(0);
const totalFpsRef = useRef(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 ChartPie
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export const ChartPie = (props: { config: IPieConfig }) => {
const { config } = props;
const queryData = useBaseQueryData();
const pieConfig = usePieConfig(config.dimension, queryData?.rows);
const [hoverLegend, setHoverLegend] = useState<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 getPayloads
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
const getPayloads = function (openApi, path, method) {
if (typeof openApi.paths[path][method].parameters !== 'undefined') {
for (let i in openApi.paths[path][method].parameters) {
const param = openApi.paths[path][method].parameters[i];
if (
- 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 QueryFilter
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export const QueryFilter = (props: IQueryEditorProps<IBaseQueryFilter>) => {
const { value, onChange } = props;
const filterValue = useMemo(() => {
function transform(
filter: IBaseQueryFilter | IBaseQueryFilterItem
- 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 getColumnThemeByField
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
const getColumnThemeByField = ({
field,
theme,
sortFieldIds,
groupFieldIds,
- 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 createTableFromImport
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
async createTableFromImport(baseId: string, importRo: IImportOptionRo, maxRowCount?: number) {
const userId = this.cls.get('user.id');
const { attachmentUrl, fileType, worksheets, notification = false, tz } = importRo;
const importer = importerFactory(fileType, {
- 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 eval
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
eval(params: TypedValue<boolean | boolean[] | null[]>[]): boolean {
const count = params.reduce((result, param) => {
if (param.isMultiple) {
if (!Array.isArray(param.value) || param.value == null) {
return result;
- 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 getReturnType
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
getReturnType(params?: TypedValue[]) {
if (params == null) return { type: CellValueType.String };
this.validateParams(params);
- 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 countCalculator
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
const countCalculator = (
params: TypedValue<IUnionType>[],
calcFn: (v: IUnionType) => boolean
): number => {
return params.reduce((result, param) => {
- 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 convertLinkOptionsDependenciesByFieldIds
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
async convertLinkOptionsDependenciesByFieldIds(
tableId: string,
newField: IFieldInstance,
oldField: IFieldInstance
) {
- 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 parse
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
async parse(
options?: { skipFirstNLines: number; key: string },
chunk?: (chunk: Record<string, unknown[][]>) => Promise<void>,
onFinished?: () => void,
onError?: (errorMsg: 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 transformTextFile2UTF8
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export const transformTextFile2UTF8 = (file: File): Promise<File> => {
return new Promise((resolve, reject) => {
const reader = new FileReader();
reader.onload = (event) => {
- 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 redo
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
async redo(operation: IPasteSelectionOperation) {
const { params, result } = operation;
const { tableId } = params;
const { updateRecords, newRecords, newFields } = result;
- 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"