Showing 671 of 671 total issues
Function matchUser
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private matchUser(value: string, userSets: IUser[] = []) {
let foundUser: IUser | null = null;
for (const user of userSets) {
const { id, name, email } = user;
if (value === id || value === name || value === email) {
- 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 Sort
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function Sort(props: ISortProps) {
const { children, onChange, sorts: outerSorts } = props;
const sortBaseRef = useRef<ISortBaseRef>(null);
const view = useView();
- 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 BaseProvider
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const BaseProvider: FC<IBaseProviderProps> = ({ children, serverData, fallback }) => {
const { baseId } = useContext(AnchorContext);
const { data: baseData } = useQuery({
queryKey: ['base', baseId],
queryFn: ({ queryKey }) =>
- 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 inOp
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public inOp(): InOpContext {
const _localctx: InOpContext = new InOpContext(this._ctx, this.state);
this.enterRule(_localctx, 16, Query.RULE_inOp);
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 pathMatcher
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export function pathMatcher<T>(path: (string | number)[], matchList: string[]): T | null {
if (path.length !== matchList.length) {
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
Avoid deeply nested control flow statements. Open
if (currentLineWidth + ellipsisWidth > maxWidth) {
let tempLine = currentLine;
let tempLineWidth = currentLineWidth;
while (tempLineWidth + ellipsisWidth > maxWidth) {
tempLine = tempLine.substring(0, tempLine.length - 1);
Function useGridColumns
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export function useGridColumns(hasMenu?: boolean, hiddenFieldIds?: string[]) {
const view = useView() as GridView | undefined;
const originFields = useFields();
const totalFields = useFields({ withHidden: true, withDenied: true });
const fieldEditable = useFieldCellEditable();
- 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 shouldResetFieldValue
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const shouldResetFieldValue = (newOperator: string, oldOperator: string): boolean => {
const getOperatorType = (operator: string) => {
if (EMPTY_OPERATORS.includes(operator)) {
return 'empty';
}
- 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 FilePreviewDialog
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
(props, ref) => {
const { files } = props;
const filesRef = useRef<IFileItem[]>();
const {
currentFile,
- 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 alterTableAddField
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private async alterTableAddField(dbTableName: string, fieldInstances: IFieldInstance[]) {
for (let i = 0; i < fieldInstances.length; i++) {
const { dbFieldType, dbFieldName, type, isLookup, unique, notNull } = fieldInstances[i];
const alterTableQuery = this.knex.schema
- 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;
}
Avoid deeply nested control flow statements. Open
if (this._input.LA(1) === Token.EOF) {
this.matchedEOF = true;
}
Avoid deeply nested control flow statements. Open
} else if (content[cursor] === _newline) {
if (quoted) {
cell += _newline;
} else {
endOfCell = true;
Avoid deeply nested control flow statements. Open
if (this._input.LA(1) === Token.EOF) {
this.matchedEOF = true;
}
Function deleteLinkOptionsDependenciesByViewId
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
async deleteLinkOptionsDependenciesByViewId(tableId: string, viewId: string) {
const foreignFields = await this.getLinkForeignFields(tableId);
for (const field of foreignFields) {
const { id: fieldId, tableId, options: rawOptions } = field;
- 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 (quoted) {
cell += delimiter;
} else {
endOfCell = true;
break;
Function appendBuilder
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
appendBuilder(): Knex.QueryBuilder {
const queryBuilder = this.originQueryBuilder;
if (!this.aggregationFields || !this.aggregationFields.length) {
return queryBuilder;
- 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 updateMultipleOrders
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export async function updateMultipleOrders(params: {
parentId: string;
position: 'before' | 'after';
itemLength: number;
anchorItem: { id: string; order: 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 eval
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
eval(
params: TypedValue<number | string | null | (number | string | null)[]>[]
): number | string | null {
let min: number | null = 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 eval
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
eval(
params: TypedValue<number | string | null | (number | string | null)[]>[]
): number | string | null {
let max: number | null = 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"