dashpresshq/dashpress

View on GitHub

Showing 459 of 459 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

export function useUserDeletionMutation() {
  const domainMessages = useDomainMessages(LANG_DOMAINS.ACCOUNT.USERS);
  const router = useRouter();
  return useApiMutateOptimisticOptions<IAccountProfile[], string>({
    mutationFn: async (username) =>
Severity: Major
Found in src/frontend/views/users/users.store.ts and 1 other location - About 5 hrs to fix
src/frontend/views/roles/roles.store.ts on lines 39..52

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 154.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

export function useRoleDeletionMutation() {
  const domainMessages = useDomainMessages(LANG_DOMAINS.ACCOUNT.ROLES);
  const router = useRouter();
  return useApiMutateOptimisticOptions<IRolesList[], string>({
    mutationFn: async (roleId) =>
Severity: Major
Found in src/frontend/views/roles/roles.store.ts and 1 other location - About 5 hrs to fix
src/frontend/views/users/users.store.ts on lines 42..55

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 154.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Function WidgetScriptDocumentation has 139 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function WidgetScriptDocumentation() {
  return (
    <DocumentationRoot>
      <p>
        The widget script is the script that allows you to provide the data that
Severity: Major
Found in src/frontend/docs/scripts/widget-scripts.tsx - About 5 hrs to fix

    Function EntityFieldsSettings has 136 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function EntityFieldsSettings() {
      const tabFromUrl = useRouteParam("tab");
      const changeTabParam = useChangeRouterParam("tab");
      const domainMessages = useAppConfigurationDomainMessages(
        "entity_columns_labels"
    Severity: Major
    Found in src/frontend/views/entity/Fields/index.tsx - About 5 hrs to fix

      Function useEntityCrudView has 121 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function useEntityCrudView(entity: string) {
        const entityCrudSettings = useEntityCrudSettings(entity);
        const entityFields = useEntityFields(entity);
      
        const upsertCrudSettingsMutation = useUpsertConfigurationMutation(
      Severity: Major
      Found in src/frontend/views/entity/Crud/index.tsx - About 4 hrs to fix

        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

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

            return (
              <AppLayout>
                <ContentLayout.Center>
                  <SectionBox title={domainMessages.TEXT_LANG.CREATE} backLink={backLink}>
                    <SchemaForm<ICreateUserForm>
          Severity: Major
          Found in src/frontend/views/users/Create/index.tsx and 1 other location - About 4 hrs to fix
          src/frontend/views/roles/Create/index.tsx on lines 27..41

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 125.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

            return (
              <AppLayout>
                <ContentLayout.Center>
                  <SectionBox title={domainMessages.TEXT_LANG.CREATE} backLink={backLink}>
                    <SchemaForm<IBaseRoleForm>
          Severity: Major
          Found in src/frontend/views/roles/Create/index.tsx and 1 other location - About 4 hrs to fix
          src/frontend/views/users/Create/index.tsx on lines 74..88

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 125.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Function useTableColumns has 111 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export const useTableColumns = (
            entity: string
          ): Partial<DataStateKeys<ITableColumn[]>> => {
            const portalTableColumns = usePortalTableColumns(entity);
            const getEntityFieldLabels = useEntityFieldLabels(entity);
          Severity: Major
          Found in src/frontend/views/data/Table/useTableColumns.tsx - About 4 hrs to fix

            Function FormIntegrationsDocumentation has 108 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export function FormIntegrationsDocumentation() {
              const { _ } = useLingui();
              const domainMessages = useDomainMessages(
                LANG_DOMAINS.INTEGRATIONS.FORM_ACTIONS
              );
            Severity: Major
            Found in src/frontend/docs/form-integrations.tsx - About 4 hrs to fix

              Function ListUsers has 107 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export function ListUsers() {
                const domainMessages = useDomainMessages(LANG_DOMAINS.ACCOUNT.USERS);
              
                useSetPageDetails({
                  pageTitle: domainMessages.TEXT_LANG.TITLE,
              Severity: Major
              Found in src/frontend/views/users/List.tsx - About 4 hrs to fix

                Function EntityRelationDetails has 106 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export function EntityRelationDetails() {
                  const childEntity = useRouteParam("childEntity");
                  const childEntityCrudConfig = useEntityCrudConfig(childEntity);
                  const entityId = useEntityId();
                  const parentEntity = useEntitySlug();
                Severity: Major
                Found in src/frontend/views/data/Details/RelationsDetails.tsx - About 4 hrs to fix

                  File ServerError.tsx has 342 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import type { CustomNextPage } from "@/frontend/_layouts/types";
                  
                  import { BaseErrorCmp } from "./_Base";
                  
                  // eslint-disable-next-line react/function-component-definition
                  Severity: Minor
                  Found in src/frontend/views/errors/ServerError.tsx - About 4 hrs to fix

                    Similar blocks of code found in 2 locations. Consider refactoring.
                    Open

                    const DropdownMenuItem = React.forwardRef<
                      React.ElementRef<typeof DropdownMenuPrimitive.Item>,
                      React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {
                        inset?: boolean;
                      }
                    Severity: Major
                    Found in src/frontend/components/ui/dropdown-menu.tsx and 1 other location - About 4 hrs to fix
                    src/frontend/components/ui/dropdown-menu.tsx on lines 94..109

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 119.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Similar blocks of code found in 2 locations. Consider refactoring.
                    Open

                    const DropdownMenuLabel = React.forwardRef<
                      React.ElementRef<typeof DropdownMenuPrimitive.Label>,
                      React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {
                        inset?: boolean;
                      }
                    Severity: Major
                    Found in src/frontend/components/ui/dropdown-menu.tsx and 1 other location - About 4 hrs to fix
                    src/frontend/components/ui/dropdown-menu.tsx on lines 76..91

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 119.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    File Stories.tsx has 340 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    /* eslint-disable react/function-component-definition */
                    import { action } from "@storybook/addon-actions";
                    import type { Story } from "@storybook/react";
                    import { Field, Form } from "react-final-form";
                    import { fakeMessageDescriptor } from "translations/fake";
                    Severity: Minor
                    Found in src/frontend/components/app/form/input/Stories.tsx - About 4 hrs to fix

                      Similar blocks of code found in 2 locations. Consider refactoring.
                      Open

                        integrationConfigurationSchema: {
                          accessKeyId: {
                            label: msg`Access Key ID`,
                            type: "text",
                            validations: [
                      Severity: Major
                      Found in src/backend/storage/integrations/aws/index.ts and 1 other location - About 4 hrs to fix
                      src/backend/integrations/libs/twilio/sendSms.ts on lines 14..42

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 116.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 2 locations. Consider refactoring.
                      Open

                      const CONFIG_SCHEMA: IAppliedSchemaFormConfig<IConfig> = {
                        from: {
                          label: msg`From`,
                          type: "text",
                          validations: [
                      Severity: Major
                      Found in src/backend/integrations/libs/twilio/sendSms.ts and 1 other location - About 4 hrs to fix
                      src/backend/storage/integrations/aws/index.ts on lines 11..39

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 116.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 2 locations. Consider refactoring.
                      Open

                      const SelectScrollUpButton = React.forwardRef<
                        React.ElementRef<typeof SelectPrimitive.ScrollUpButton>,
                        React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>
                      >(({ className, ...props }, ref) => (
                        <SelectPrimitive.ScrollUpButton
                      Severity: Major
                      Found in src/frontend/components/ui/select.tsx and 1 other location - About 4 hrs to fix
                      src/frontend/components/ui/select.tsx on lines 62..76

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 115.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 2 locations. Consider refactoring.
                      Open

                      const SelectScrollDownButton = React.forwardRef<
                        React.ElementRef<typeof SelectPrimitive.ScrollDownButton>,
                        React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>
                      >(({ className, ...props }, ref) => (
                        <SelectPrimitive.ScrollDownButton
                      Severity: Major
                      Found in src/frontend/components/ui/select.tsx and 1 other location - About 4 hrs to fix
                      src/frontend/components/ui/select.tsx on lines 45..59

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 115.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Severity
                      Category
                      Status
                      Source
                      Language