teableio/teable

View on GitHub

Showing 671 of 671 total issues

Function compOp has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  public compOp(): CompOpContext {
    const _localctx: CompOpContext = new CompOpContext(this._ctx, this.state);
    this.enterRule(_localctx, 10, Query.RULE_compOp);
    let _la: number;
    try {
Severity: Minor
Found in packages/core/src/query/parser/Query.ts - About 55 mins to fix

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 convertViewDependenciesByFieldIds has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  async convertViewDependenciesByFieldIds(
    tableId: string,
    newField: IFieldInstance,
    oldField: IFieldInstance
  ) {

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 optionsRoToVoByCvType has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  private optionsRoToVoByCvType(
    cellValueType: CellValueType,
    options: IFieldOptionsVo = {}
  ): { type: FieldType; options: IFieldOptionsRo } {
    switch (cellValueType) {
Severity: Minor
Found in apps/nestjs-backend/src/features/selection/selection.service.ts - About 55 mins to fix

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 getValidFilterOperators has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

export function getValidFilterOperators(field: {
  cellValueType: CellValueType;
  type: FieldType;
  isMultipleCellValue?: boolean;
}): IOperator[] {
Severity: Minor
Found in packages/core/src/models/view/filter/operator.ts - About 55 mins to fix

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 ws_or_comment has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public ws_or_comment(): Ws_or_commentContext {
        let _localctx: Ws_or_commentContext = new Ws_or_commentContext(this._ctx, this.state);
        this.enterRule(_localctx, 4, Formula.RULE_ws_or_comment);
        let _la: number;
        try {
Severity: Minor
Found in packages/core/src/formula/parser/Formula.ts - About 55 mins to fix

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 assertIncludes has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

export function assertIncludes<T extends string[]>(
  v: string | undefined,
  stringArray: T,
  msgOrErrorFactory?: IMsgOrErrorFactory,
  caseInsensitive?: boolean
Severity: Minor
Found in packages/core/src/asserts/asserts.ts - About 55 mins to fix

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 json has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  json(field: IFieldInstance): Knex.QueryBuilder {
    const { type, dbFieldName, isMultipleCellValue } = field;

    if (this.isDistinct) {
      if (isUserOrLink(type)) {
Severity: Minor
Found in apps/nestjs-backend/src/db-provider/group-query/group-query.postgres.ts - About 55 mins to fix

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 json has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  json(field: IFieldInstance): Knex.QueryBuilder {
    const { type, dbFieldName, isMultipleCellValue } = field;

    if (this.isDistinct) {
      if (isUserOrLink(type)) {
Severity: Minor
Found in apps/nestjs-backend/src/db-provider/group-query/group-query.sqlite.ts - About 55 mins to fix

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 generateLinkOptionsVo has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  private async generateLinkOptionsVo(params: {
    tableId: string;
    optionsRo: ILinkFieldOptionsRo;
    fieldId: string;
    symmetricFieldId: string | undefined;

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 convertStringToCellValue has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  convertStringToCellValue(value: string): string | null {
    if (this.isLookup) {
      return null;
    }

Severity: Minor
Found in packages/core/src/models/field/derivate/date.field.ts - About 55 mins to fix

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 createForeignKey has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  async createForeignKey(options: ILinkFieldOptions) {
    const { relationship, fkHostTableName, selfKeyName, foreignKeyName, isOneWay } = options;

    let alterTableSchema: Knex.SchemaBuilder | undefined;

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 9 (exceeds 5 allowed). Consider refactoring.
Open

  eval(
    params: TypedValue<string | number | boolean | (string | number | boolean | null)[]>[]
  ): string | number | boolean | null | (string | number | boolean | null)[] {
    const paramsLength = params.length;
    const expression = params[0].value;
Severity: Minor
Found in packages/core/src/formula/functions/logical.ts - About 55 mins to fix

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 deleteCommentReaction has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  async deleteCommentReaction(
    tableId: string,
    recordId: string,
    commentId: string,
    reactionRo: { reaction: string }
Severity: Minor
Found in apps/nestjs-backend/src/features/comment/comment-open-api.service.ts - About 55 mins to fix

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 getJsonQueryColumn has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  protected getJsonQueryColumn(field: IFieldInstance, operator: IFilterOperator): string {
    const defaultJsonColumn = 'json_each.value';
    if (field.type === FieldType.Link) {
      const object = field.isMultipleCellValue ? defaultJsonColumn : field.dbFieldName;
      const path = ([contains.value, doesNotContain.value] as string[]).includes(operator)

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 register has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  static register(): DynamicModule {
    return BaseLoggerModule.forRootAsync({
      inject: [ClsService, ConfigService],
      useFactory: (cls: ClsService, config: ConfigService) => {
        const { level } = config.getOrThrow<ILoggerConfig>('logger');
Severity: Minor
Found in apps/nestjs-backend/src/logger/logger.module.ts - About 55 mins to fix

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 transformNodeValue has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  private transformNodeValue(typedValue: TypedValue, ctx: BinaryOpContext) {
    // A Node with a field value type requires dedicated string conversion logic to be executed.
    if (!typedValue.field) {
      return typedValue;
    }
Severity: Minor
Found in packages/core/src/formula/visitor.ts - About 55 mins to fix

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 identifier has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public identifier(): IdentifierContext {
        let _localctx: IdentifierContext = new IdentifierContext(this._ctx, this.state);
        this.enterRule(_localctx, 12, Formula.RULE_identifier);
        let _la: number;
        try {
Severity: Minor
Found in packages/core/src/formula/parser/Formula.ts - About 55 mins to fix

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 saveForeignKeyForOneOne has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  private async saveForeignKeyForOneOne(
    field: LinkFieldDto,
    fkMap: { [recordId: string]: IFkRecordItem }
  ) {
    const { selfKeyName, foreignKeyName, fkHostTableName } = field.options;
Severity: Minor
Found in apps/nestjs-backend/src/features/calculation/link.service.ts - About 55 mins to fix

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 GroupPointProvider has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

export const GroupPointProvider = ({ children }: GroupPointProviderProps) => {
  const { tableId, viewId, shareId } = useContext(ShareViewContext);
  const queryClient = useQueryClient();
  const view = useView(viewId);
  const { searchQuery } = useSearch();

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 saveForeignKeyToDb has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  private async saveForeignKeyToDb(fieldMap: IFieldMap, fkRecordMap: IFkRecordMap) {
    for (const fieldId in fkRecordMap) {
      const fkMap = fkRecordMap[fieldId];
      const field = fieldMap[fieldId] as LinkFieldDto;
      const relationship = field.options.relationship;
Severity: Minor
Found in apps/nestjs-backend/src/features/calculation/link.service.ts - About 55 mins to fix

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

Severity
Category
Status
Source
Language