dashpresshq/dashpress

View on GitHub

Showing 459 of 459 total issues

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

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

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

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

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

              .map(async (entity, index) => {
                const dateField =
                  await this._entitiesApiService.getEntityFirstFieldType(
                    entity.value,
                    "date"
      Severity: Minor
      Found in src/backend/dashboard-widgets/dashboard-widgets.service.ts - About 1 hr to fix

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

          async listData(
            entity: string,
            searchValue?: string
          ): Promise<{ value: string; label: string }[]> {
            const [relationshipSettings, primaryField] = await Promise.all([
        Severity: Minor
        Found in src/backend/data/data.service.ts - About 1 hr to fix

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

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

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

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

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

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

            export function AsyncFormSelect(props: IProps) {
              const { _ } = useLingui();
            
              const { input, url, referenceUrl } = props;
            
            
            Severity: Minor
            Found in src/frontend/components/app/form/input/select-async.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

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

            export function EntityRelationDetails() {
              const childEntity = useRouteParam("childEntity");
              const childEntityCrudConfig = useEntityCrudConfig(childEntity);
              const entityId = useEntityId();
              const parentEntity = useEntitySlug();
            Severity: Minor
            Found in src/frontend/views/data/Details/RelationsDetails.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

            Function AccountProfile has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export function AccountProfile() {
              const authenticatedUserBag = useAuthenticatedUserBag();
              const updateProfileMutation = useUpdateProfileMutation();
              const domainMessages = useDomainMessages(LANG_DOMAINS.ACCOUNT.PROFILE);
            
            
            Severity: Minor
            Found in src/frontend/views/account/Profile/index.tsx - About 1 hr to fix

              Function useTableState has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export const useTableState = (
                contextKey: string,
                persistentFilters: IDataTableProps["persistentFilters"],
                defaultTableState?: IDataTableProps["defaultTableState"]
              ) => {
              Severity: Minor
              Found in src/frontend/views/data/Table/hooks/useTableState.ts - About 1 hr to fix

                Function create has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  async create(
                    entity: string,
                    data: Record<string, unknown>,
                    accountProfile: IAccountProfile
                  ): Promise<string | number> {
                Severity: Minor
                Found in src/backend/data/data.service.ts - About 1 hr to fix

                  Function render has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    render() {
                      const { error } = this.state;
                      const { children } = this.props;
                      if (error) {
                        return (
                  Severity: Minor
                  Found in src/frontend/components/app/error-boundary.tsx - About 1 hr to fix

                    Function GET has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        GET: async (): Promise<Record<string, string>> => {
                          const latestVersion$1 = await latestVersion("dashpress");
                    
                          const versionText =
                            latestVersion$1 === version
                    Severity: Minor
                    Found in src/pages/api/versions.ts - About 1 hr to fix

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

                                    tokenValidityDurationInDays: {
                                      label: msg`Token Validity Duration In Days`,
                                      type: "number",
                                      validations: [
                                        {
                      Severity: Major
                      Found in src/frontend/views/settings/System/index.tsx and 2 other locations - About 1 hr to fix
                      src/frontend/views/entity/Diction/index.tsx on lines 68..82
                      src/frontend/views/entity/Diction/index.tsx on lines 83..97

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

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

                                    singular: {
                                      label: msg`Singular`,
                                      type: "text",
                                      validations: [
                                        {
                      Severity: Major
                      Found in src/frontend/views/entity/Diction/index.tsx and 2 other locations - About 1 hr to fix
                      src/frontend/views/entity/Diction/index.tsx on lines 68..82
                      src/frontend/views/settings/System/index.tsx on lines 58..72

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

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

                                    plural: {
                                      label: msg`Plural`,
                                      type: "text",
                                      validations: [
                                        {
                      Severity: Major
                      Found in src/frontend/views/entity/Diction/index.tsx and 2 other locations - About 1 hr to fix
                      src/frontend/views/entity/Diction/index.tsx on lines 83..97
                      src/frontend/views/settings/System/index.tsx on lines 58..72

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

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

                      export function createConfigDomainPersistenceService<T>(
                        configDomain: ConfigDomain
                      ): AbstractConfigDataPersistenceService<T> {
                        const configBag: Record<
                          ConfigAdaptorTypes,
                      Severity: Minor
                      Found in src/backend/lib/config-persistence/index.ts - About 1 hr to fix

                        Function showData has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          async showData(
                            entity: string,
                            id: string | number,
                            column?: string
                          ): Promise<Record<string, unknown>> {
                        Severity: Minor
                        Found in src/backend/data/data.service.ts - About 1 hr to fix

                          Function getEntitySelections has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          export const getEntitySelections = (
                            entityFields: IEntityField[],
                            entitySelections: Record<string, IColorableSelection[]>,
                            entityFieldTypes: Record<string, FormFieldTypes>
                          ): Record<string, IColorableSelection[]> => {
                          Severity: Minor
                          Found in src/shared/logic/entities/getEntitySelections.ts - About 1 hr to fix

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

                                await this._credentialsApiService.upsertGroup(
                                  {
                                    key: this.makeCredentialsGroupKey(storageKey),
                                    fields: typescriptSafeObjectDotKeys(
                                      STORAGE_INTEGRATIONS[storageKey].integrationConfigurationSchema
                            Severity: Major
                            Found in src/backend/storage/storage.service.ts and 1 other location - About 1 hr to fix
                            src/backend/integrations/integrations.service.ts on lines 118..126

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

                            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