hadmean/hadmean

View on GitHub

Showing 419 of 427 total issues

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

import { NotFoundError, progammingError } from "backend/lib/errors";
import {
  DataEventActions,
  FilterOperators,
  PaginatedData,
Severity: Minor
Found in src/backend/data/data.service.ts - 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 Stories.tsx has 368 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /* eslint-disable react/function-component-definition */
      
      import { Story } from "@storybook/react";
      import { Field, Form } from "react-final-form";
      import { action } from "@storybook/addon-actions";
      Severity: Minor
      Found in src/frontend/design-system/components/Form/Stories.tsx - 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 28..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 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 72..86

        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 EntityRelationDetails has 107 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

              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 12..40

              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 10..38

              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

                              <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 226..237

              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="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 214..225

              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

                        loader={
                          <>
                            {Array.from({ length: 4 }, (_, k) => k).map((key) => (
                              <Fragment key={key}>
                                <BaseSkeleton height="18px" width="100px" bottom={8} />
              Severity: Major
              Found in src/frontend/views/settings/Versions/index.tsx and 1 other location - About 3 hrs to fix
              src/frontend/views/data/Details/DetailsView.tsx on lines 92..101

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

              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

                    loader={
                      <>
                        {Array.from({ length: 7 }, (_, k) => k).map((key) => (
                          <Fragment key={key}>
                            <BaseSkeleton height="18px" width="100px" bottom={8} />
              Severity: Major
              Found in src/frontend/views/data/Details/DetailsView.tsx and 1 other location - About 3 hrs to fix
              src/frontend/views/settings/Versions/index.tsx on lines 39..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 112.

              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 Form.tsx has 327 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import { useEntityConfiguration } from "frontend/hooks/configuration/configuration.store";
              import { Field, Form } from "react-final-form";
              import { ISummaryWidgetConfig, IWidgetConfig } from "shared/types/dashboard";
              import { ROYGBIV, ROYGBIV_CONFIG } from "shared/constants/colors";
              import { IconInputField } from "frontend/components/IconInputField";
              Severity: Minor
              Found in src/frontend/views/Dashboard/Widget/_manage/Form.tsx - About 3 hrs to fix

                Function RenderFormInput has 93 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/SchemaForm/_RenderFormInput.tsx - About 3 hrs to fix

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

                        return (
                          <ActionButtons
                            justIcons
                            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 37..56

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

                  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
                            justIcons
                            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 46..65

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

                  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 99..105
                  src/frontend/views/setup/Credentials/Form.tsx on lines 119..133
                  src/frontend/views/setup/Credentials/Form.tsx on lines 134..144

                  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("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 92..98
                  src/frontend/views/setup/Credentials/Form.tsx on lines 99..105
                  src/frontend/views/setup/Credentials/Form.tsx on lines 134..144

                  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

                  Severity
                  Category
                  Status
                  Source
                  Language