dashpresshq/dashpress

View on GitHub
src/backend/data/data.service.ts

Summary

Maintainability
C
1 day
Test Coverage
A
97%

File data.service.ts has 367 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { runFormAction } from "@/backend/form-actions/run-form-action";
import { NotFoundError, progammingError } from "@/backend/lib/errors";
import { compileTemplateString } from "@/shared/lib/strings/templates";
import type { PaginatedData, QueryFilterSchema } from "@/shared/types/data";
import { DataEventActions, FilterOperators } from "@/shared/types/data";
Severity: Minor
Found in src/backend/data/data.service.ts - About 4 hrs to fix

    Function update has 40 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      async update(
        entity: string,
        id: string,
        data: Record<string, unknown>,
        accountProfile: IAccountProfile,
    Severity: Minor
    Found in src/backend/data/data.service.ts - About 1 hr to fix

      Function delete has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        async delete(
          entity: string,
          id: string,
          accountProfile: IAccountProfile
        ): Promise<void> {
      Severity: Minor
      Found in src/backend/data/data.service.ts - About 1 hr to fix

        Function getRelationshipSettings has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          async getRelationshipSettings(entity: string): Promise<{
            format: string;
            fields: string[];
          }> {
            const relationshipSettings = await this._configurationApiService.show(
        Severity: Minor
        Found in src/backend/data/data.service.ts - About 1 hr to fix

          Function listData has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            async listData(
              entity: string,
              searchValue?: string
            ): Promise<{ value: string; label: string }[]> {
              const [relationshipSettings, primaryField] = await Promise.all([
          Severity: Minor
          Found in src/backend/data/data.service.ts - About 1 hr to fix

            Function create has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              async create(
                entity: string,
                data: Record<string, unknown>,
                accountProfile: IAccountProfile
              ): Promise<string | number> {
            Severity: Minor
            Found in src/backend/data/data.service.ts - About 1 hr to fix

              Function showData has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                async showData(
                  entity: string,
                  id: string | number,
                  column?: string
                ): Promise<Record<string, unknown>> {
              Severity: Minor
              Found in src/backend/data/data.service.ts - About 1 hr to fix

                There are no issues that match your filters.

                Category
                Status