Showing 671 of 671 total issues
Function RatingEditorBase
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
> = (props, ref) => {
const { cell, onChange } = props;
const focusRef = useRef<HTMLInputElement>(null);
const [value, setValue] = useState<number | null>(cell.data);
const [lastTime, setLastTime] = 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 filterDirectedGraph
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
export function filterDirectedGraph(
undirectedGraph: IGraphItem[],
fieldIds: string[]
): IGraphItem[] {
const result: IGraphItem[] = [];
- 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 topoOrderWithStart
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
export function topoOrderWithStart(startNodeId: string, graph: IGraphItem[]): string[] {
const visitedNodes = new Set<string>();
const sortedNodes: string[] = [];
// Build adjacency list and reverse adjacency list
- 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 diffLinkCellChange
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
private diffLinkCellChange(
fieldMapByTableId: { [tableId: string]: IFieldMap },
originRecordMapByTableId: IRecordMapByTableId,
updatedRecordMapByTableId: IRecordMapByTableId
): ICellChange[] {
- 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 getPreviewUrlTokenMap
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
private async getPreviewUrlTokenMap(
records: ISnapshotBase<IRecord>[],
fields: IFieldInstance[],
fieldKeyType: FieldKeyType
) {
- 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 ContentCard
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
const ContentCard = () => {
const baseId = useBaseId() as string;
const queryClient = useQueryClient();
const { t } = useTranslation(tableConfig.i18nNamespaces);
const { data, isLoading } = useQuery({
- 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 14 (exceeds 5 allowed). Consider refactoring. Open
async undo(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"
Further reading
Function TableImport
has 317 lines of code (exceeds 300 allowed). Consider refactoring. Open
export const TableImport = (props: ITableImportProps) => {
const base = useBase();
const router = useRouter();
const { t } = useTranslation(['table']);
const [step, setStep] = useState(Step.UPLOAD);
Function onMixedTextClick
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
export const onMixedTextClick = (type: SingleLineTextDisplayType, text: string) => {
let url = '';
if (type === SingleLineTextDisplayType.Url) {
try {
- 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 HideFields
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
}> = ({ footer, children }) => {
const activeViewId = useViewId();
const fields = useFields({ withHidden: true, withDenied: true });
const view = useView() as GridView | undefined;
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 mixRanges
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
export const mixRanges = (ranges: IRange[], newRange: IRange): IRange[] => {
const result: IRange[] = [];
let added = false;
for (const range of 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 drawSprite
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public drawSprite(ctx: CanvasRenderingContext2D, props: ISpriteDrawerProps) {
const { sprite, variant = 'normal', x, y, size, alpha = 1, theme, colors } = props;
const [fgColor, bgColor] = colors ?? getColors(variant, theme);
const rSize = size * Math.ceil(window.devicePixelRatio);
const key = `${bgColor}_${fgColor}_${rSize}_${sprite}`;
- 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 reducer
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
export const reducer = (state: State, action: Action): State => {
switch (action.type) {
case 'ADD_TOAST':
return {
...state,
- 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 ChartTooltipContent
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
(
{
active,
payload,
className,
- 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 13 (exceeds 5 allowed). Consider refactoring. Open
eval(params: TypedValue<string | number | null>[], context: IFormulaContext): string | null {
const startDate = getDayjs(params[0].value as string, context.timeZone);
if (startDate == 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 getCommentList
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
async getCommentList(
tableId: string,
recordId: string,
getCommentListQuery: IGetCommentListQueryRo
) {
- 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 cleanForeignKey
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
async cleanForeignKey(options: ILinkFieldOptions) {
const { fkHostTableName, relationship, selfKeyName, foreignKeyName, isOneWay } = options;
const dropTable = async (tableName: string) => {
const alterTableSchema = this.knex.schema.dropTable(tableName);
- 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 getFilterDateTimeRange
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
protected getFilterDateTimeRange(
dateFieldOptions: IDateFieldOptions,
filterValue: IDateFilter
): [string, string] {
const filterValueByDate = dateFilterSchema.parse(filterValue);
- 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 performGroupedAggregation
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
async performGroupedAggregation(params: {
aggregations: IRawAggregations;
statisticFields: IAggregationField[] | undefined;
filter?: IFilter;
search?: [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 recordsPresignedUrl
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
@Timing()
private async recordsPresignedUrl(
records: ISnapshotBase<IRecord>[],
fields: IFieldInstance[],
fieldKeyType: FieldKeyType
- 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"