dashpresshq/dashpress

View on GitHub

Showing 459 of 459 total issues

Function useSyncTableState has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function useSyncTableState<T>(
  table: Table<Record<string, unknown>>,
  overridePaginatedDataState: IPaginatedDataState<T> | undefined,
  syncPaginatedDataStateOut: (params: IPaginatedDataState<T>) => void
) {
Severity: Minor
Found in src/frontend/components/app/table/hooks.tsx - About 1 hr to fix

    Function useStringSelections has 34 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function useStringSelections(key: string) {
      const [values, set] = useSelectionStore((store) => [store.values, store.set]);
    
      const selections = values[key] || {};
    
    
    Severity: Minor
    Found in src/frontend/lib/selection/index.ts - About 1 hr to fix

      Function useWaitForResponseMutationOptions has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function useWaitForResponseMutationOptions<V, R = void>(
        options: IWaitForResponseMutationOptions<V, R>
      ) {
        const queryClient = useQueryClient();
        const { toast } = useToast();

        Function integrationsConfigurationDetailsRequestHandler has 34 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export const integrationsConfigurationDetailsRequestHandler = (
          group: IntegrationsConfigurationGroup
        ) => {
          return requestHandler(
            {
        Severity: Minor
        Found in src/pages/api/integrations/_base/[key].ts - About 1 hr to fix

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

            const isChecking = useSetupCheck([
              {
                key: "hasDbCredentials",
                value: false,
                url: NAVIGATION_LINKS.SETUP.CREDENTIALS,
          Severity: Major
          Found in src/frontend/views/setup/User/index.tsx and 1 other location - About 1 hr to fix
          src/frontend/views/SignIn/index.tsx on lines 49..60

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

          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 setupCheck = useSetupCheck([
              {
                key: "hasDbCredentials",
                value: false,
                url: NAVIGATION_LINKS.SETUP.CREDENTIALS,
          Severity: Major
          Found in src/frontend/views/SignIn/index.tsx and 1 other location - About 1 hr to fix
          src/frontend/views/setup/User/index.tsx on lines 22..33

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

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

          export function DetailsCanvas() {
            const router = useRouter();
            const [closeDetailsCanvas, detailsCanvasEntity, detailsCanvasId] =
              useDetailsOffCanvasStore((state) => [state.close, state.entity, state.id]);
          
          
          Severity: Minor
          Found in src/frontend/views/data/Table/_WholeEntityTable/DetailsCanvas.tsx - About 1 hr to fix

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

            export const RESET_PASSWORD_FORM_SCHEMA: IAppliedSchemaFormConfig<IResetPasswordForm> =
              {
                password: {
                  label: msg`Password`,
                  type: "password",
            Severity: Major
            Found in src/shared/form-schemas/users/reset-password.ts and 3 other locations - About 1 hr to fix
            src/pages/api/integrations/_base/[key].ts on lines 16..27
            src/shared/form-schemas/profile/update.ts on lines 9..20
            src/shared/form-schemas/roles/base.ts on lines 9..19

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

            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

            export const UPSERT_INTEGRATION_VALUE_FORM_SCHEMA: IAppliedSchemaFormConfig<IUpdateIntegrationValueForm> =
              {
                value: {
                  label: msg`Value`,
                  type: "text",
            Severity: Major
            Found in src/pages/api/integrations/_base/[key].ts and 3 other locations - About 1 hr to fix
            src/shared/form-schemas/profile/update.ts on lines 9..20
            src/shared/form-schemas/roles/base.ts on lines 9..19
            src/shared/form-schemas/users/reset-password.ts on lines 9..20

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

            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

                deSelectMutiple: (items: string[]) => {
                  const update = Object.fromEntries(items.map((item) => [item, false]));
            
                  setSelections({ ...selections, ...update });
                },
            Severity: Major
            Found in src/frontend/lib/selection/index.ts and 1 other location - About 1 hr to fix
            src/frontend/lib/selection/index.ts on lines 45..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 61.

            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

                selectMutiple: (items: string[]) => {
                  const update = Object.fromEntries(items.map((item) => [item, true]));
                  setSelections({ ...selections, ...update });
                },
            Severity: Major
            Found in src/frontend/lib/selection/index.ts and 1 other location - About 1 hr to fix
            src/frontend/lib/selection/index.ts on lines 53..57

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

            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

            export const BASE_ROLE_FORM_SCHEMA: IAppliedSchemaFormConfig<IBaseRoleForm> = {
              name: {
                label: msg`Name`,
                type: "text",
                validations: [
            Severity: Major
            Found in src/shared/form-schemas/roles/base.ts and 3 other locations - About 1 hr to fix
            src/pages/api/integrations/_base/[key].ts on lines 16..27
            src/shared/form-schemas/profile/update.ts on lines 9..20
            src/shared/form-schemas/users/reset-password.ts on lines 9..20

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

            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

            export const UPDATE_PROFILE_FORM_SCHEMA: IAppliedSchemaFormConfig<IUpdateProfileForm> =
              {
                name: {
                  label: msg`Name`,
                  type: "text",
            Severity: Major
            Found in src/shared/form-schemas/profile/update.ts and 3 other locations - About 1 hr to fix
            src/pages/api/integrations/_base/[key].ts on lines 16..27
            src/shared/form-schemas/roles/base.ts on lines 9..19
            src/shared/form-schemas/users/reset-password.ts on lines 9..20

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

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

            export function EntityFormExtensionSettings() {
              const entity = useEntitySlug();
            
              const domainMessages = useAppConfigurationDomainMessages(
                "entity_form_extension"
            Severity: Minor
            Found in src/frontend/views/entity/Form/index.tsx - About 1 hr to fix

              Function Select has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
              Open

              export function Select({
                onChange,
                options: fullOptions,
                disabled,
                isLoading,
              Severity: Minor
              Found in src/frontend/components/ui/select.tsx - 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

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

                        <Field name="numberInput" validateFields={[]} validate={required}>
                          {(formProps) => (
                            <FormNumberInput
                              label={fakeMessageDescriptor("Example Number Input")}
                              {...formProps}
              Severity: Major
              Found in src/frontend/components/app/form/input/Stories.tsx and 5 other locations - About 1 hr to fix
              src/frontend/components/app/form/input/Stories.tsx on lines 59..66
              src/frontend/components/app/form/input/Stories.tsx on lines 68..75
              src/frontend/components/app/form/input/Stories.tsx on lines 223..230
              src/frontend/components/app/form/input/Stories.tsx on lines 261..268
              src/frontend/components/app/form/input/Stories.tsx on lines 280..287

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

              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 VariablesSettings() {
                useSetPageDetails({
                  pageTitle: ManageVariablesPageTitle,
                  viewKey: SETTINGS_VIEW_KEY,
                  permission: UserPermissions.CAN_CONFIGURE_APP,
              Severity: Major
              Found in src/frontend/views/settings/Variables/index.tsx and 1 other location - About 1 hr to fix
              src/frontend/views/integrations/Variables/index.tsx on lines 11..23

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

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

                        <Field name="dateInput" validateFields={[]} validate={required}>
                          {(formProps) => (
                            <FormDateInput
                              label={fakeMessageDescriptor("Example Date Input")}
                              {...formProps}
              Severity: Major
              Found in src/frontend/components/app/form/input/Stories.tsx and 5 other locations - About 1 hr to fix
              src/frontend/components/app/form/input/Stories.tsx on lines 59..66
              src/frontend/components/app/form/input/Stories.tsx on lines 68..75
              src/frontend/components/app/form/input/Stories.tsx on lines 242..249
              src/frontend/components/app/form/input/Stories.tsx on lines 261..268
              src/frontend/components/app/form/input/Stories.tsx on lines 280..287

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

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

                        <Field name="textArea" validateFields={[]} validate={required}>
                          {(formProps) => (
                            <FormTextArea
                              label={fakeMessageDescriptor("Example Text Area Input")}
                              {...formProps}
              Severity: Major
              Found in src/frontend/components/app/form/input/Stories.tsx and 5 other locations - About 1 hr to fix
              src/frontend/components/app/form/input/Stories.tsx on lines 59..66
              src/frontend/components/app/form/input/Stories.tsx on lines 68..75
              src/frontend/components/app/form/input/Stories.tsx on lines 223..230
              src/frontend/components/app/form/input/Stories.tsx on lines 242..249
              src/frontend/components/app/form/input/Stories.tsx on lines 280..287

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

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

                        <Field name="richText" validateFields={[]} validate={required}>
                          {(formProps) => (
                            <FormRichTextArea
                              label={fakeMessageDescriptor("Example Rich Text")}
                              {...formProps}
              Severity: Major
              Found in src/frontend/components/app/form/input/Stories.tsx and 5 other locations - About 1 hr to fix
              src/frontend/components/app/form/input/Stories.tsx on lines 59..66
              src/frontend/components/app/form/input/Stories.tsx on lines 68..75
              src/frontend/components/app/form/input/Stories.tsx on lines 223..230
              src/frontend/components/app/form/input/Stories.tsx on lines 242..249
              src/frontend/components/app/form/input/Stories.tsx on lines 261..268

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

              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