Showing 671 of 671 total issues
Function convertCellValue2DBValue
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
convertCellValue2DBValue(value: unknown): unknown {
if (this.isMultipleCellValue) {
return value == null ? value : JSON.stringify(value);
}
if (typeof value === 'number' && (isNaN(value) || !isFinite(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 updateOptionsFromUserField
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private async updateOptionsFromUserField(
tableId: string,
field: UserFieldDto
): Promise<IOpsMap | undefined> {
const { dbTableName } = await this.prismaService.txClient().tableMeta.findFirstOrThrow({
- 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 alterSymmetricFieldChange
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private async alterSymmetricFieldChange(
tableId: string,
oldField: LinkFieldDto,
newField: LinkFieldDto
) {
- 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 prepareUpdateLinkField
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private async prepareUpdateLinkField(tableId: string, fieldRo: IFieldRo, oldFieldVo: IFieldVo) {
if (!majorFieldKeysChanged(oldFieldVo, fieldRo)) {
return mergeWith({}, oldFieldVo, fieldRo, (_oldValue: unknown, newValue: unknown) => {
if (Array.isArray(newValue)) {
return newValue;
- 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 6 (exceeds 5 allowed). Consider refactoring. Open
eval(params: TypedValue<string | number | null | (string | number | null)[]>[]): number | null {
const findString = params[0].value;
const targetString = convertValueToString(params[1]);
let startPosition = params[2]?.value ?? 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 stringToFloat
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function stringToFloat(value: string | unknown): number | null {
if (!isParsableNumeric(typeof value === 'number' ? value.toString(10) : value ?? '')) {
return null;
}
const v = Number.parseFloat(typeof value === 'string' ? value : (value as number).toString(10));
- 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 generateReferenceFieldOps
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private async generateReferenceFieldOps(fieldId: string) {
const topoOrdersContext = await this.fieldCalculationService.getTopoOrdersContext([fieldId]);
const { fieldMap, topoOrdersByFieldId, fieldId2TableId } = topoOrdersContext;
const topoOrders = topoOrdersByFieldId[fieldId];
- 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 getFilterLinkRecordsByTable
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
async getFilterLinkRecordsByTable(tableId: string, filter?: IFilter) {
if (!filter) {
return [];
}
const linkFields = await this.prismaService.field.findMany({
- 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 renameViewIndexes
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private async renameViewIndexes(dbTableName: string, old2NewViewIdMap: Record<string, string>) {
const columnInfoQuery = this.dbProvider.columnInfo(dbTableName);
const columns = await this.prismaService
.txClient()
.$queryRawUnsafe<{ name: string }[]>(columnInfoQuery);
- 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 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 getGroupRelatedData
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public async getGroupRelatedData(tableId: string, query?: IGetRecordsRo) {
const { viewId, groupBy: extraGroupBy, filter, search, collapsedGroupIds } = query || {};
let groupPoints: IGroupPoint[] = [];
const groupBy = parseGroup(extraGroupBy);
- 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 handleAggregation
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private async handleAggregation(params: {
dbTableName: string;
fieldInstanceMap: Record<string, IFieldInstance>;
fieldInstanceMapWithoutHiddenFields: Record<string, IFieldInstance>;
filter?: IFilter;
- 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 getModifiedSystemOpsMap
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
async getModifiedSystemOpsMap(
tableId: string,
records: {
fields: Record<string, unknown>;
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 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 shouldSkipCompute
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private shouldSkipCompute(field: IFieldInstance, recordItem: IRecordItem) {
if (!field.isComputed && field.type !== FieldType.Link) {
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 getFieldsByProjection
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private 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 presigned
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
async presigned(
bucket: string,
dir: string,
presignedParams: IPresignParams
): Promise<IPresignRes> {
- 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 joinOriginLookup
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private joinOriginLookup(lookupField: IFieldInstance, lookupValues: unknown[] | unknown) {
if (Array.isArray(lookupValues)) {
const flatten = lookupValues.map((value) => {
if (Array.isArray(value)) {
return lookupField.cellValue2String(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 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"