Showing 671 of 671 total issues
Function mergeWithDefaultSort
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function mergeWithDefaultSort(
defaultViewSort?: string | null,
querySort?: ISortItem[]
): ISortItem[] {
if (!defaultViewSort && !querySort) {
- 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 batchUpdateFields
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
async batchUpdateFields(tableId: string, opData: { fieldId: string; ops: IOtOperation[] }[]) {
if (!opData.length) return;
const fieldRaw = await this.prismaService.txClient().field.findMany({
where: { tableId, id: { in: opData.map((data) => data.fieldId) }, deletedTime: 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
Function rowSelectionToIds
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private async rowSelectionToIds(tableId: string, query: IRangesToIdQuery): Promise<string[]> {
const { type, ranges } = query;
if (type === RangeType.Columns) {
const result = await this.recordService.getDocIdsByQuery(tableId, {
...query,
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
eval(params: TypedValue<string | number | null>[], context: IFormulaContext): number | null {
const startDate = getDayjs(params[0].value as string, context.timeZone);
const endDate = getDayjs(params[1].value as string, context.timeZone);
if (startDate == null || endDate == null) return 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
Function generateFilterItem
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const generateFilterItem = (field: IFieldInstance, value: unknown) => {
let operator: IOperator = isNot.value;
const { id: fieldId, type, isMultipleCellValue, options } = field;
if (shouldFilterByDefaultValue(field)) {
- 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 getValidStatisticFunc
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const getValidStatisticFunc = (field?: {
type: FieldType;
cellValueType: CellValueType;
isMultipleCellValue?: boolean;
}): StatisticsFunc[] => {
- 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 updatePlugin
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
async updatePlugin(id: string, updatePluginRo: IUpdatePluginRo): Promise<IUpdatePluginVo> {
const userId = this.cls.get('user.id');
const isAdmin = this.cls.get('user.isAdmin');
const { name, description, detailDesc, helpUrl, logo, i18n, positions, url } = updatePluginRo;
const res = await this.prismaService.$tx(async (prisma) => {
- 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 isLinkCellValue
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function isLinkCellValue(value: unknown): boolean {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function isLinkCellItem(item: any): boolean {
if (typeof item !== 'object' || item == null) {
return 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 getRecordIndexes
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
async getRecordIndexes(
tableId: string,
recordIds: string[],
viewId?: string
): Promise<Record<string, number>[] | undefined> {
- 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 undo
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
async undo(operation: IUpdateRecordsOperation) {
const { params, result } = operation;
const { tableId, recordIds, fieldIds } = params;
const { cellContexts, ordersMap } = 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 handleRowCount
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private async handleRowCount(params: {
tableId: string;
dbTableName: string;
fieldInstanceMap: Record<string, IFieldInstance>;
fieldInstanceMapWithoutHiddenFields: Record<string, 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 createBatch
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private async createBatch(
tableId: string,
records: IRecordInnerRo[],
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 calculateRollupAndLink
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private calculateRollupAndLink(
field: IFieldInstance,
relationship: Relationship,
lookupField: IFieldInstance,
record: IRecord,
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
async redo(operation: IUpdateRecordsOperation) {
const { params, result } = operation;
const { tableId, recordIds, fieldIds } = params;
const { cellContexts, ordersMap } = 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 reBuildFieldRaw
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private reBuildFieldRaw(
toBaseId: string,
field: IFieldInstance,
fieldRaw: Field,
old2NewTableIdMap: Record<string, 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 convertViewVoAttachmentUrl
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
convertViewVoAttachmentUrl(viewVo: IViewVo) {
if (viewVo.type === ViewType.Form) {
const formOptions = viewVo.options as IFormViewOptions;
formOptions?.coverUrl &&
(formOptions.coverUrl = formOptions.coverUrl
- 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 getFilterByCollapsedGroup
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private getFilterByCollapsedGroup({
groupBy,
groupPoints,
fieldInstanceMap,
collapsedGroupIds,
- 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 affectedRecordItemsQuerySql
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
affectedRecordItemsQuerySql(
startFieldIds: string[],
fieldMap: IFieldMap,
linkAdjacencyMap: IAdjacencyMap,
startRecordIds: 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 KanbanToolbar
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const KanbanToolbar: React.FC<{ disabled?: boolean }> = (props) => {
const { disabled } = props;
const view = useView() as KanbanView | undefined;
const allFields = useFields({ withHidden: true, withDenied: true });
const { onFilterChange, onSortChange } = useToolbarChange();
- 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 fetchRecordMap
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private async fetchRecordMap(
tableId2DbTableName: { [tableId: string]: string },
fieldMapByTableId: { [tableId: string]: IFieldMap },
recordMapByTableId: IRecordMapByTableId,
cellContexts: ICellContext[],
- 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"