dashpresshq/dashpress

View on GitHub

Showing 165 of 459 total issues

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

export const isAuthenticatedValidationImpl: ValidationImplType<void> = async (
  req,
  protectedRoute: boolean
) => {
  try {

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

    export const useEntityReferenceCount = (
      entities: string[],
      reference: { entity: string; entityId: string }
    ) => {
      const multipleEntityReferenceFields =
    Severity: Minor
    Found in src/frontend/hooks/data/data.store.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 useRevealedCredentialsList has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export const useRevealedCredentialsList = (
          group: IntegrationsConfigurationGroup
        ) => {
          const rootPassword = usePasswordStore((state) => state.password);
          const queryClient = useQueryClient();
        Severity: Minor
        Found in src/frontend/views/settings/Variables/configurations.store.ts - About 1 hr to fix

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

          const buildFilterConfigFromType = (prop: {
            entityType: FormFieldTypes;
            entityFieldSelections: IColorableSelection[];
            isIdField: boolean;
            referenceField?: string;
          Severity: Minor
          Found in src/frontend/views/data/Table/useTableColumns.tsx - About 1 hr to fix

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

            export function PersistentDocumentation() {
              return (
                <DocumentationRoot>
                  <p>
                    Persistent query is used to define a set of queries that are persisted
            Severity: Minor
            Found in src/frontend/docs/persistent-query.tsx - About 1 hr to fix

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

              export const doesPermissionAllowPermission = (
                permissions: string[],
                requiredPermission: string,
                checkGranular: boolean
              ): boolean => {
              Severity: Minor
              Found in src/shared/logic/permissions/index.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 rgbToOklch has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    const rgbToOklch = (rgb: TRGB): TLCH => {
                      const r = rgb.r / 255;
                      const g = rgb.g / 255;
                      const b = rgb.b / 255;
                  
                  
                  Severity: Minor
                  Found in src/frontend/lib/colors/conversion.ts - About 1 hr to fix

                    Function do has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      do: async (config: IActionConfig, messageConfig: IConfig) => {
                        return await makeIntegrationRequest("POST", {
                          url: `https://api.sendgrid.com/v3/mail/send`,
                          body: JSON.stringify({
                            personalizations: [
                    Severity: Minor
                    Found in src/backend/integrations/libs/sendgrid/sendMail.ts - About 1 hr to fix

                      Function EntityCrudSettings has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export function EntityCrudSettings() {
                        const tabFromUrl = useRouteParam("tab");
                        const changeTabParam = useChangeRouterParam("tab");
                        const entity = useEntitySlug();
                      
                      
                      Severity: Minor
                      Found in src/frontend/views/entity/Crud/index.tsx - About 1 hr to fix

                        Function getEntityRelationsForUserRole has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          async getEntityRelationsForUserRole(
                            entity: string,
                            userRole: string
                          ): Promise<IEntityRelation[]> {
                            const [validRelations, entityLabels, entityOrders] = await Promise.all([
                        Severity: Minor
                        Found in src/backend/entities/entities.service.ts - About 1 hr to fix

                          Function Template has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          const Template: Story<ITableProps<unknown>> = (args) => {
                            const [paginatedDataState, setPaginatedDataState] = useState<
                              IPaginatedDataState<any>
                            >({ ...DEFAULT_TABLE_STATE });
                          
                          
                          Severity: Minor
                          Found in src/frontend/components/app/table/Stories.tsx - About 1 hr to fix

                            Function ConfirmAlert has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            export function ConfirmAlert() {
                              const { _ } = useLingui();
                              const [title, action, onClose] = useConfirmAlertStore((store) => [
                                store.title,
                                store.action,
                            Severity: Minor
                            Found in src/frontend/components/app/confirm-alert.tsx - About 1 hr to fix

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

                              export function StorageIntegrations() {
                                const fileStorageDomainMessages = useDomainMessages(
                                  LANG_DOMAINS.INTEGRATIONS.FILE_STORAGE
                                );
                                useSetPageDetails({
                              Severity: Minor
                              Found in src/frontend/views/integrations/storage/index.tsx - About 1 hr to fix

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

                                export const crudEnabledValidationImpl: ValidationImplType<void> = async (
                                  req,
                                  action: unknown
                                ) => {
                                  progammingError("Please provide the action for the CRUD check", !action);
                                Severity: Minor
                                Found in src/backend/lib/request/validations/implementations/crud-enabled.ts - About 1 hr to fix

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

                                          .map(async (entity, index) => {
                                            const dateField =
                                              await this._entitiesApiService.getEntityFirstFieldType(
                                                entity.value,
                                                "date"
                                  Severity: Minor
                                  Found in src/backend/dashboard-widgets/dashboard-widgets.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 FormSelect has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      export function FormSelect(formInput: IFormSelect) {
                                        const {
                                          input,
                                          selectData,
                                          meta,
                                      Severity: Minor
                                      Found in src/frontend/components/app/form/input/select.tsx - About 1 hr to fix

                                        Function filterOperatorToQuery has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                        Open

                                          filterOperatorToQuery(
                                            query: T,
                                            column: string,
                                            { operator, value, value2 }: IColumnFilterBag<unknown>,
                                            groupOperator: "and" | "or"
                                        Severity: Minor
                                        Found in src/backend/data/data-access/_Base.ts - About 1 hr 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