Showing 671 of 671 total issues
Function sendCommentNotify
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private async sendCommentNotify(
tableId: string,
recordId: string,
commentId: string,
notifyVo: { quoteId: string | null; content: string | 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 flatten
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const flatten = (arr: IUnionType[]) => {
let result: IUnionType[] = [];
for (const item of arr) {
if (item !== 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
Avoid deeply nested control flow statements. Open
if (this._input.LA(1) === Token.EOF) {
this.matchedEOF = true;
}
Function getFieldsByQuery
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
async getFieldsByQuery(tableId: string, query?: IGetFieldsQuery): Promise<IFieldVo[]> {
const fieldsPlain = await this.prismaService.txClient().field.findMany({
where: { tableId, deletedTime: null },
orderBy: [
{
- 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 getDerivateByLink
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private async getDerivateByLink(tableId: string, innerOpsMap: IOpsMap['key']) {
const changes: ICellContext[] = [];
for (const recordId in innerOpsMap) {
for (const op of innerOpsMap[recordId]) {
const context = RecordOpBuilder.editor.setRecord.detect(op);
- 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 getLines
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
getLines(linesChunk: Buffer): Buffer[] {
const delimiterLength = this._delimiterBuffer.length;
const lines: Buffer[] = [];
let delimiterHits = 0;
let lastSplitIndex = 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 updateRecordIndexes
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
async updateRecordIndexes(
tableId: string,
recordsWithOrder: {
id: string;
order?: Record<string, 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 getPreviewUrl
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
async getPreviewUrl<T extends string | string[] = string | string[]>(
bucket: string,
token: T,
meta?: { expiresIn?: number }
): Promise<T> {
- 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 calculateLink
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private calculateLink(
field: LinkFieldDto,
virtualField: IFieldInstance,
record: IRecord,
lookupValues: 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 buildLinkSelectedQuery
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
async buildLinkSelectedQuery(
queryBuilder: Knex.QueryBuilder,
tableId: string,
dbTableName: string,
filterLinkCellSelected: [string, 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 getContextByDelete
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private async getContextByDelete(linkFieldRaws: Field[], recordIds: string[]) {
const cellContextsMap: { [tableId: string]: ICellContext[] } = {};
const keyToValue = (key: string | string[] | null) =>
key ? (Array.isArray(key) ? key.map((id) => ({ id })) : { id: key }) : 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 updateRecordByApi
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
tableId: string,
recordId: string,
fieldId: string,
newValue: unknown,
expectStatus = 200,
Function UnionShowAs
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const UnionShowAs: FC<IUnionShowAsProps> = (props) => {
const { showAs, cellValueType, isMultipleCellValue, onChange } = props;
const ShowAsComponent = useMemo(() => {
if (cellValueType === CellValueType.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
Avoid deeply nested control flow statements. Open
if (!lowers.has(joined)) {
lowers.set(joined, { orig: preference, pos: pos++ });
}
Function StatisticMenu
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const StatisticMenu = () => {
const view = useView();
const isTouchDevice = useIsTouchDevice();
const { t } = useTranslation(tableConfig.i18nNamespaces);
const { statisticMenu, closeStatisticMenu } = useGridViewStore();
- 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 ShareFormLinkEditor
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const ShareFormLinkEditor = (props: IShareFormLinkEditorProps) => {
const { cellValue, shareId, className, field, onChange } = props;
const [open, setOpen] = useState(false);
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 KanbanStack
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const KanbanStack = forwardRef<VirtuosoHandle, IKanbanStackProps>((props, forwardRef) => {
const { stack, cards, setCardMap } = props;
const { t } = useTranslation(tableConfig.i18nNamespaces);
const { stackField, permission, recordQuery } = useKanban() as Required<IKanbanContext>;
const [skipIndex, setSkipIndex] = useState(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 SystemInfo
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const SystemInfo: React.FC<{ field: Partial<IFieldVo> }> = ({ field }) => {
const [show, setShow] = useLocalStorage<boolean>(LocalStorageKeys.FieldSystem);
const { t } = useTranslation(['table']);
if (!field.id) {
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 BaseSidebarHeaderLeft
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const BaseSidebarHeaderLeft = () => {
const base = useBase();
const router = useRouter();
const [renaming, setRenaming] = useState<boolean>();
const [baseName, setBaseName] = useState<string>(base.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 getServerSideProps
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
withAuthSSR<IViewPageProps>(async (context, ssrApi) => {
const { tableId, viewId, baseId, recordId, fromNotify: notifyId } = context.query;
let recordServerData;
if (recordId) {
if (notifyId) {
- 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"