dashpresshq/dashpress

View on GitHub

Showing 459 of 459 total issues

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

                <FormGrid.Item span="6">
                  <Field name="height" validateFields={[]}>
                    {({ input, meta }) => (
                      <FormSelect
                        label={msg`Height`}
Severity: Major
Found in src/frontend/views/Dashboard/Widget/_manage/Form.tsx and 1 other location - About 3 hrs to fix
src/frontend/views/Dashboard/Widget/_manage/Form.tsx on lines 212..223

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 113.

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

                <FormGrid.Item span="6">
                  <Field name="span" validateFields={[]}>
                    {({ input, meta }) => (
                      <FormSelect
                        label={msg`Width`}
Severity: Major
Found in src/frontend/views/Dashboard/Widget/_manage/Form.tsx and 1 other location - About 3 hrs to fix
src/frontend/views/Dashboard/Widget/_manage/Form.tsx on lines 224..235

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 113.

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 RenderFormInput has 94 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function RenderFormInput(props: IRenderFormInputProps) {
  const {
    formProps: formProps$1,
    label,
    type,
Severity: Major
Found in src/frontend/components/app/form/schema/_RenderFormInput.tsx - About 3 hrs to fix

    File Form.tsx has 319 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import type { MessageDescriptor } from "@lingui/core";
    import { msg } from "@lingui/macro";
    import { useMutation } from "@tanstack/react-query";
    import { useEffect, useState } from "react";
    import { Field, Form } from "react-final-form";
    Severity: Minor
    Found in src/frontend/views/Dashboard/Widget/_manage/Form.tsx - About 3 hrs to fix

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

            return (
              <ActionButtons
                size="icon"
                actionButtons={[
                  {
      Severity: Major
      Found in src/frontend/views/users/List.tsx and 1 other location - About 3 hrs to fix
      src/frontend/views/roles/List.tsx on lines 39..58

      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 108.

      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 (
              <ActionButtons
                size="icon"
                actionButtons={[
                  {
      Severity: Major
      Found in src/frontend/views/roles/List.tsx and 1 other location - About 3 hrs to fix
      src/frontend/views/users/List.tsx on lines 48..67

      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 108.

      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 4 locations. Consider refactoring.
      Open

                      {dataSourceConfig.fields.includes("database") && (
                        <Field
                          name="database"
                          validate={required}
                          validateFields={[]}
      Severity: Major
      Found in src/frontend/views/setup/Credentials/Form.tsx and 3 other locations - About 3 hrs to fix
      src/frontend/views/setup/Credentials/Form.tsx on lines 91..97
      src/frontend/views/setup/Credentials/Form.tsx on lines 98..104
      src/frontend/views/setup/Credentials/Form.tsx on lines 133..143

      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 105.

      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 4 locations. Consider refactoring.
      Open

                      {dataSourceConfig.fields.includes("user") && (
                        <Field name="user" validate={required} validateFields={[]}>
                          {({ input, meta }) => (
                            <FormInput label={msg`User`} meta={meta} input={input} />
                          )}
      Severity: Major
      Found in src/frontend/views/setup/Credentials/Form.tsx and 3 other locations - About 3 hrs to fix
      src/frontend/views/setup/Credentials/Form.tsx on lines 91..97
      src/frontend/views/setup/Credentials/Form.tsx on lines 118..132
      src/frontend/views/setup/Credentials/Form.tsx on lines 133..143

      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 105.

      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 4 locations. Consider refactoring.
      Open

                      {dataSourceConfig.fields.includes("host") && (
                        <Field name="host" validate={required} validateFields={[]}>
                          {({ input, meta }) => (
                            <FormInput label={msg`Host`} meta={meta} input={input} />
                          )}
      Severity: Major
      Found in src/frontend/views/setup/Credentials/Form.tsx and 3 other locations - About 3 hrs to fix
      src/frontend/views/setup/Credentials/Form.tsx on lines 98..104
      src/frontend/views/setup/Credentials/Form.tsx on lines 118..132
      src/frontend/views/setup/Credentials/Form.tsx on lines 133..143

      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 105.

      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 4 locations. Consider refactoring.
      Open

                      {dataSourceConfig.fields.includes("port") && (
                        <Field name="port" validate={required} validateFields={[]}>
                          {({ input, meta }) => (
                            <FormNumberInput
                              label={msg`Port`}
      Severity: Major
      Found in src/frontend/views/setup/Credentials/Form.tsx and 3 other locations - About 3 hrs to fix
      src/frontend/views/setup/Credentials/Form.tsx on lines 91..97
      src/frontend/views/setup/Credentials/Form.tsx on lines 98..104
      src/frontend/views/setup/Credentials/Form.tsx on lines 118..132

      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 105.

      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 generateMenuItems has 86 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        async generateMenuItems(): Promise<INavigationMenuItem[]> {
          let navItems: INavigationMenuItem[] = [];
      
          navItems = navItems.concat([
            {
      Severity: Major
      Found in src/backend/menu/menu.service.ts - About 3 hrs to fix

        Function FieldsSettingsDocumentation has 86 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export function FieldsSettingsDocumentation() {
          return (
            <DocumentationRoot>
              <p>
                You will be able to make field-level customizations on the tables,
        Severity: Major
        Found in src/frontend/docs/fields.tsx - About 3 hrs to fix

          Function useEntityFormView has 85 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function useEntityFormView(entity: string): Record<
            string,
            {
              label: MessageDescriptor;
              Cmp: ReactElement;
          Severity: Major
          Found in src/frontend/views/entity/Form/index.tsx - About 3 hrs to fix

            Function ListRoles has 82 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export function ListRoles() {
              const domainMessages = useDomainMessages(LANG_DOMAINS.ACCOUNT.ROLES);
              useSetPageDetails({
                pageTitle: domainMessages.TEXT_LANG.TITLE,
                viewKey: `list-roles`,
            Severity: Major
            Found in src/frontend/views/roles/List.tsx - About 3 hrs to fix

              File NotFound.tsx has 299 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/NotFound.tsx - About 3 hrs to fix

                Function UsersLinkToDatabase has 79 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export function UsersLinkToDatabase() {
                  const domainMessages = useDomainMessages({
                    plural: msg`Users Link To Database`,
                    singular: msg`Users Link To Database`,
                  });
                Severity: Major
                Found in src/frontend/views/users/DatabaseLink/index.tsx - About 3 hrs to fix

                  Function RolesDocumentation has 79 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export function RolesDocumentation() {
                    return (
                      <DocumentationRoot>
                        <p>
                          DashPress has two default roles which are not editable or deletable and
                  Severity: Major
                  Found in src/frontend/docs/roles.tsx - About 3 hrs to fix

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

                    const AlertDialogTitle = React.forwardRef<
                      React.ElementRef<typeof AlertDialogPrimitive.Title>,
                      React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Title>
                    >(({ className, ...props }, ref) => (
                      <AlertDialogPrimitive.Title
                    Severity: Major
                    Found in src/frontend/components/ui/alert-dialog.tsx and 11 other locations - About 3 hrs to fix
                    src/frontend/components/ui/alert-dialog.tsx on lines 90..99
                    src/frontend/components/ui/dialog.tsx on lines 15..27
                    src/frontend/components/ui/dialog.tsx on lines 86..98
                    src/frontend/components/ui/dialog.tsx on lines 101..110
                    src/frontend/components/ui/dropdown-menu.tsx on lines 41..53
                    src/frontend/components/ui/dropdown-menu.tsx on lines 112..121
                    src/frontend/components/ui/select.tsx on lines 112..121
                    src/frontend/components/ui/select.tsx on lines 149..158
                    src/frontend/components/ui/tabs.tsx on lines 6..18
                    src/frontend/components/ui/tabs.tsx on lines 21..33
                    src/frontend/components/ui/tabs.tsx on lines 36..48

                    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 98.

                    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 12 locations. Consider refactoring.
                    Open

                    const DropdownMenuSubContent = React.forwardRef<
                      React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,
                      React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>
                    >(({ className, ...props }, ref) => (
                      <DropdownMenuPrimitive.SubContent
                    Severity: Major
                    Found in src/frontend/components/ui/dropdown-menu.tsx and 11 other locations - About 3 hrs to fix
                    src/frontend/components/ui/alert-dialog.tsx on lines 78..87
                    src/frontend/components/ui/alert-dialog.tsx on lines 90..99
                    src/frontend/components/ui/dialog.tsx on lines 15..27
                    src/frontend/components/ui/dialog.tsx on lines 86..98
                    src/frontend/components/ui/dialog.tsx on lines 101..110
                    src/frontend/components/ui/dropdown-menu.tsx on lines 112..121
                    src/frontend/components/ui/select.tsx on lines 112..121
                    src/frontend/components/ui/select.tsx on lines 149..158
                    src/frontend/components/ui/tabs.tsx on lines 6..18
                    src/frontend/components/ui/tabs.tsx on lines 21..33
                    src/frontend/components/ui/tabs.tsx on lines 36..48

                    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 98.

                    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 12 locations. Consider refactoring.
                    Open

                    const SelectLabel = React.forwardRef<
                      React.ElementRef<typeof SelectPrimitive.Label>,
                      React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>
                    >(({ className, ...props }, ref) => (
                      <SelectPrimitive.Label
                    Severity: Major
                    Found in src/frontend/components/ui/select.tsx and 11 other locations - About 3 hrs to fix
                    src/frontend/components/ui/alert-dialog.tsx on lines 78..87
                    src/frontend/components/ui/alert-dialog.tsx on lines 90..99
                    src/frontend/components/ui/dialog.tsx on lines 15..27
                    src/frontend/components/ui/dialog.tsx on lines 86..98
                    src/frontend/components/ui/dialog.tsx on lines 101..110
                    src/frontend/components/ui/dropdown-menu.tsx on lines 41..53
                    src/frontend/components/ui/dropdown-menu.tsx on lines 112..121
                    src/frontend/components/ui/select.tsx on lines 149..158
                    src/frontend/components/ui/tabs.tsx on lines 6..18
                    src/frontend/components/ui/tabs.tsx on lines 21..33
                    src/frontend/components/ui/tabs.tsx on lines 36..48

                    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 98.

                    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