Showing 504 of 504 total issues
File selection.service.ts
has 660 lines of code (exceeds 300 allowed). Consider refactoring. Open
import { BadRequestException, Injectable } from '@nestjs/common';
import type {
IDateFieldOptions,
IFieldOptionsRo,
IFieldOptionsVo,
File GridViewBase.tsx
has 639 lines of code (exceeds 300 allowed). Consider refactoring. Open
import { RowHeightLevel, contractColorForTheme } from '@teable/core';
import type {
IRectangle,
IPosition,
IGridRef,
File view-open-api.service.ts
has 588 lines of code (exceeds 300 allowed). Consider refactoring. Open
import {
BadRequestException,
Injectable,
Logger,
NotFoundException,
Function FormulaEditor
has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring. Open
export const FormulaEditor: FC<IFormulaEditorProps> = (props) => {
const { expression, onConfirm } = props;
const fields = useFields({ withHidden: true, withDenied: true });
const { theme } = useTheme();
const { t } = useTranslation();
- 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 54 (exceeds 5 allowed). Consider refactoring. Open
function parse(raw: string, preferences: string[] | undefined, options: IOptions) {
const lowers = new Map<string, { orig: string; pos: number }>();
const header = raw.replace(/[ \t]/g, '');
if (preferences) {
- 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
File baseRenderer.ts
has 565 lines of code (exceeds 300 allowed). Consider refactoring. Open
import { LRUCache } from 'lru-cache';
import { parseToRGB } from '../../utils';
import type {
ILineProps,
IMultiLineTextProps,
File date-time.ts
has 563 lines of code (exceeds 300 allowed). Consider refactoring. Open
import type { ManipulateType, UnitType } from 'dayjs';
import dayjs, { extend, isDayjs } from 'dayjs';
import customParseFormat from 'dayjs/plugin/customParseFormat';
import isBetween from 'dayjs/plugin/isBetween';
import relativeTime from 'dayjs/plugin/relativeTime';
File date-time.spec.ts
has 563 lines of code (exceeds 300 allowed). Consider refactoring. Open
/* eslint-disable sonarjs/no-duplicate-string */
import dayjs from 'dayjs';
import type { IRecord } from '../../models';
import { CellValueType } from '../../models/field/constant';
import { TypedValue } from '../typed-value';
File json.visitor.spec.ts
has 547 lines of code (exceeds 300 allowed). Consider refactoring. Open
/* eslint-disable @typescript-eslint/no-explicit-any */
import { parseTQL } from './json.visitor';
describe('JsonVisitor', () => {
const mockFilterData = (value: any = null, operator = '=') => {
Function LinkListBase
has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring. Open
const LinkListBase: ForwardRefRenderFunction<ILinkListRef, ILinkListProps> = (
props,
forwardRef
) => {
const { readonly, type, rowCount, cellValue, recordQuery, isMultiple, onChange, onExpand } =
- 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
File numeric.ts
has 545 lines of code (exceeds 300 allowed). Consider refactoring. Open
import { CellValueType } from '../../models/field/constant';
import type { TypedValue } from '../typed-value';
import { FormulaFunc, FormulaFuncType, FunctionName } from './common';
abstract class NumericFunc extends FormulaFunc {
Function InfiniteScrollerBase
has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring. Open
const InfiniteScrollerBase: ForwardRefRenderFunction<ScrollerRef, ScrollerProps> = (props, ref) => {
const {
coordInstance,
containerWidth,
containerHeight,
- 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 calcCells
has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring. Open
export const calcCells = (props: ILayoutDrawerProps, renderRegion: RenderRegion) => {
const {
coordInstance,
visibleRegion,
activeCell,
- 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
File lookup.e2e-spec.ts
has 508 lines of code (exceeds 300 allowed). Consider refactoring. Open
/* eslint-disable sonarjs/no-duplicate-string */
/* eslint-disable @typescript-eslint/no-non-null-assertion */
/* eslint-disable @typescript-eslint/no-explicit-any */
import type { INestApplication } from '@nestjs/common';
import type {
Function parseClipboardText
has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring. Open
export const parseClipboardText = (content: string) => {
if (!content.includes('"')) {
return content.split(newline).map((row) => row.split(delimiter));
}
- 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
FieldSupplementService
has 49 functions (exceeds 20 allowed). Consider refactoring. Open
@Injectable()
export class FieldSupplementService {
constructor(
private readonly fieldService: FieldService,
private readonly prismaService: PrismaService,
Function drawMultiLineText
has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring. Open
export const drawMultiLineText = (ctx: CanvasRenderingContext2D, props: IMultiLineTextProps) => {
const {
x = 0,
y = 0,
text,
- 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 getHeadersArray
has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring. Open
const getHeadersArray = function (openApi, path, method) {
const headers = [];
const pathObj = openApi.paths[path][method];
// 'accept' header:
- 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
File base-duplicate.service.ts
has 485 lines of code (exceeds 300 allowed). Consider refactoring. Open
import { Injectable, Logger, NotFoundException } from '@nestjs/common';
import type { ILinkFieldOptions } from '@teable/core';
import {
FieldType,
generateBaseId,
File numeric.spec.ts
has 482 lines of code (exceeds 300 allowed). Consider refactoring. Open
import { CellValueType } from '../../models/field/constant';
import { TypedValue } from '../typed-value';
import {
Abs,
Average,