Showing 671 of 671 total issues
Function getDefaultValue
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private getDefaultValue(type: FieldType, options: unknown, defaultValue: unknown) {
switch (type) {
case FieldType.Date:
return defaultValue === 'now' ? new Date().toISOString() : defaultValue;
case FieldType.SingleSelect:
- 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 createDBTable
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private async createDBTable(baseId: string, tableRo: ICreateTableRo) {
const userId = this.cls.get('user.id');
const tableRaws = await this.prismaService.txClient().tableMeta.findMany({
where: { baseId, deletedTime: null },
select: { name: true, order: 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 SelectOptions
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const SelectOptions = (props: {
isMultiple: boolean;
options: Partial<ISelectFieldOptions> | undefined;
isLookup?: boolean;
onChange?: (options: Partial<ISelectFieldOptions>) => void;
- 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
switch (authScheme) {
case 'bearer':
oauthDef = secScheme;
break;
case 'basic':
Function VisibleFields
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
}> = ({ footer, children }) => {
const activeViewId = useViewId();
const totalFields = useFields({ withHidden: true, withDenied: true });
const view = useView() as KanbanView | undefined;
const columnMeta = view?.columnMeta;
- 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 (typeof sample[key] !== 'string') {
value = JSON.stringify(sample[key]);
}
Avoid deeply nested control flow statements. Open
if (sample === undefined) return null;
Function Container
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const Container = (props: IPageParams & { uiConfig?: IUIConfig }) => {
const { baseId, positionId: dashboardId, pluginInstallId, uiConfig } = props;
const [isIframeMode, setIsIframeMode] = useState(true);
const pluginBridge = usePluginBridge();
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 drawCacheContent
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const drawCacheContent = (
cacheCanvas: HTMLCanvasElement | undefined,
props: ICacheDrawerProps
) => {
if (!cacheCanvas) return;
- 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 drawActiveCell
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const drawActiveCell = (ctx: CanvasRenderingContext2D, props: ILayoutDrawerProps) => {
const {
theme,
mouseState,
scrollState,
- 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 drawColumnHeader
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const drawColumnHeader = (ctx: CanvasRenderingContext2D, props: IFieldHeadDrawerProps) => {
const { x, y, width, height, theme, fill, column, hasMenu, spriteManager } = props;
const { name, icon, description, hasMenu: hasColumnMenu, isPrimary } = column;
const {
cellLineColor,
- 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 (secDefinition.in === 'header') {
apiKeyAuthDef = secDefinition;
}
Avoid deeply nested control flow statements. Open
if (library === client.key) {
validLibrary = true;
break;
}
Function useColumnFreeze
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const useColumnFreeze = (coordInstance: CoordinateManager, scrollState: IScrollState) => {
const [columnFreezeState, setColumnFreezeState] = useState<IColumnFreezeState>(
DEFAULT_FREEZE_COLUMN_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 drawRect
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const drawRect = (ctx: CanvasRenderingContext2D, props: IRectProps) => {
const { x, y, width, height, fill, stroke, radius: _radius } = props;
ctx.beginPath();
if (fill) ctx.fillStyle = fill;
- 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 measure
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
measure: (cell: ISelectCell, props: ICellMeasureProps) => {
const { displayData, readonly } = cell;
const { ctx, theme, width, height } = props;
const { cellTextColor, fontSizeXS, iconSizeSM, iconSizeXS } = theme;
- 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 likeOp
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public likeOp(): LikeOpContext {
const _localctx: LikeOpContext = new LikeOpContext(this._ctx, this.state);
this.enterRule(_localctx, 14, Query.RULE_likeOp);
let _la: number;
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 numberLiteral
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public numberLiteral(): NumberLiteralContext {
const _localctx: NumberLiteralContext = new NumberLiteralContext(this._ctx, this.state);
this.enterRule(_localctx, 26, Query.RULE_numberLiteral);
let _la: number;
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 booleanLiteral
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public booleanLiteral(): BooleanLiteralContext {
const _localctx: BooleanLiteralContext = new BooleanLiteralContext(this._ctx, this.state);
this.enterRule(_localctx, 28, Query.RULE_booleanLiteral);
let _la: number;
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 valueList
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public valueList(): ValueListContext {
const _localctx: ValueListContext = new ValueListContext(this._ctx, this.state);
this.enterRule(_localctx, 20, Query.RULE_valueList);
let _la: number;
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"