dashpresshq/dashpress

View on GitHub

Showing 459 of 459 total issues

Function EntityCreate has 45 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function EntityCreate() {
  const routeParams = useRouteParams();
  const entity = useEntitySlug();
  const entityCrudConfig = useEntityCrudConfig(entity);

Severity: Minor
Found in src/frontend/views/data/Create/index.tsx - About 1 hr to fix

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

    export default requestHandler(
      {
        POST: async (getValidatedRequest) => {
          const validatedRequest = await getValidatedRequest([
            {
    Severity: Major
    Found in src/pages/api/setup/credentials.ts and 3 other locations - About 1 hr to fix
    src/pages/api/auth/signin.ts on lines 5..24
    src/pages/api/config/[key]/__guest.ts on lines 6..26
    src/pages/api/setup/user.ts on lines 5..22

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

    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

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

          <ContentLayout>
            <ContentLayout.Left>
              <MenuSection menuItems={menuItems} />
            </ContentLayout.Left>
            <ContentLayout.Right>{children}</ContentLayout.Right>
    Severity: Major
    Found in src/frontend/views/entity/_Base.tsx and 1 other location - About 1 hr to fix
    src/frontend/views/settings/_Base.tsx on lines 72..77

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

    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 default requestHandler(
      {
        POST: async (getValidatedRequest) => {
          const validatedRequest = await getValidatedRequest([
            {
    Severity: Major
    Found in src/pages/api/auth/signin.ts and 3 other locations - About 1 hr to fix
    src/pages/api/config/[key]/__guest.ts on lines 6..26
    src/pages/api/setup/credentials.ts on lines 119..138
    src/pages/api/setup/user.ts on lines 5..22

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

    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 default requestHandler(
      {
        GET: async (getValidatedRequest) => {
          const validatedRequest = await getValidatedRequest([
            {
    Severity: Major
    Found in src/pages/api/config/[key]/__guest.ts and 3 other locations - About 1 hr to fix
    src/pages/api/auth/signin.ts on lines 5..24
    src/pages/api/setup/credentials.ts on lines 119..138
    src/pages/api/setup/user.ts on lines 5..22

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

    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 default requestHandler(
      {
        POST: async (getValidatedRequest) => {
          const validatedRequest = await getValidatedRequest([
            {
    Severity: Major
    Found in src/pages/api/setup/user.ts and 3 other locations - About 1 hr to fix
    src/pages/api/auth/signin.ts on lines 5..24
    src/pages/api/config/[key]/__guest.ts on lines 6..26
    src/pages/api/setup/credentials.ts on lines 119..138

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

    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

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

          <ContentLayout>
            <ContentLayout.Left>
              <MenuSection menuItems={menuItems} />
            </ContentLayout.Left>
            <ContentLayout.Right>{children}</ContentLayout.Right>
    Severity: Major
    Found in src/frontend/views/settings/_Base.tsx and 1 other location - About 1 hr to fix
    src/frontend/views/entity/_Base.tsx on lines 109..114

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

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

    export function ActionsIntegrations() {
      const currentKey = useRouteParam("key");
      const domainMessages = useDomainMessages(LANG_DOMAINS.INTEGRATIONS.ACTIONS);
    
      const integrationsList = useIntegrationsList();
    Severity: Minor
    Found in src/frontend/views/integrations/actions/index.tsx - About 1 hr to fix

      Function ManageCredentialGroup has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

      export function ManageCredentialGroup({
        group,
        currentTab,
      }: {
        group: IntegrationsConfigurationGroup;
      Severity: Minor
      Found in src/frontend/views/settings/Variables/ManageCredentialGroup.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 useApi has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

      export function useApi<T>(endPoint: string, options: IUseApiOptions<T>) {
        const isRestoring = useIsRestoring();
      
        const builtOptions = buildApiOptions(options);
        const router = useRouter();
      Severity: Minor
      Found in src/frontend/lib/data/useApi/index.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

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

          GET: async (getValidatedRequest) => {
            const validatedRequest = await getValidatedRequest([
              "authenticatedUser",
              { _type: "requestQuery", options: REQUEST_QUERY_FIELD },
            ]);
      Severity: Major
      Found in src/pages/api/dashboards/[dashboardId]/index.ts and 1 other location - About 1 hr to fix
      src/pages/api/account/[username]/index.ts on lines 22..34

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

      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

        GET: async (getValidatedRequest) => {
          const validatedRequest = await getValidatedRequest([
            "authenticatedUser",
            {
              _type: "requestQuery",
      Severity: Major
      Found in src/pages/api/user-preferences/[key].ts and 2 other locations - About 1 hr to fix
      src/pages/api/account/change-password.ts on lines 8..20
      src/pages/api/account/mine.ts on lines 8..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 70.

      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

                <ControlledFormDateInput
                  onChange={(value) => {
                    setFilter({
                      ...filterValue,
                      value: new Date(value || "").toDateString(),
      Severity: Major
      Found in src/frontend/components/app/table/filters/Date/index.tsx and 1 other location - About 1 hr to fix
      src/frontend/components/app/table/filters/Date/index.tsx on lines 52..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 70.

      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

          DELETE: async (getValidatedRequest) => {
            const validatedRequest = await getValidatedRequest([
              "authenticatedUser",
              {
                _type: "requestQuery",
      Severity: Major
      Found in src/pages/api/account/[username]/index.ts and 1 other location - About 1 hr to fix
      src/pages/api/dashboards/[dashboardId]/index.ts on lines 10..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 70.

      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

                <ControlledFormDateInput
                  onChange={(value) => {
                    setFilter({
                      ...filterValue,
                      value2: new Date(value || "").toDateString(),
      Severity: Major
      Found in src/frontend/components/app/table/filters/Date/index.tsx and 1 other location - About 1 hr to fix
      src/frontend/components/app/table/filters/Date/index.tsx on lines 43..51

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

      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

        PATCH: async (getValidatedRequest) => {
          const validatedRequest = await getValidatedRequest([
            "authenticatedUser",
            {
              _type: "requestBody",
      Severity: Major
      Found in src/pages/api/account/mine.ts and 2 other locations - About 1 hr to fix
      src/pages/api/account/change-password.ts on lines 8..20
      src/pages/api/user-preferences/[key].ts on lines 8..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 70.

      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 const useIntegrationsList = () => {
        const domainMessages = useDomainMessages(LANG_DOMAINS.INTEGRATIONS.ACTIONS);
      
        return useApi<IIntegrationsList[]>("/api/integrations/actions/list", {
          errorMessage: domainMessages.TEXT_LANG.NOT_FOUND,
      Severity: Major
      Found in src/frontend/views/integrations/actions/actions.store.ts and 1 other location - About 1 hr to fix
      src/frontend/views/integrations/storage/storage.store.ts on lines 16..24

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

      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

          PATCH: async (getValidatedRequest) => {
            const validatedRequest = await getValidatedRequest([
              "authenticatedUser",
              {
                _type: "requestBody",
      Severity: Major
      Found in src/pages/api/account/change-password.ts and 2 other locations - About 1 hr to fix
      src/pages/api/account/mine.ts on lines 8..20
      src/pages/api/user-preferences/[key].ts on lines 8..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 70.

      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 const useStorageIntegrationsList = () => {
        const domainMessages = useDomainMessages(
          LANG_DOMAINS.INTEGRATIONS.FILE_STORAGE
        );
        return useApi<IStorageIntegration[]>("/api/integrations/storage/list", {
      Severity: Major
      Found in src/frontend/views/integrations/storage/storage.store.ts and 1 other location - About 1 hr to fix
      src/frontend/views/integrations/actions/actions.store.ts on lines 23..30

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

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

      export function EntityPersistentQuerySettings() {
        const entity = useEntitySlug();
        const domainMessages = useAppConfigurationDomainMessages("persistent_query");
      
        const upsertPeristentQueryMutation = useUpsertConfigurationMutation(
      Severity: Minor
      Found in src/frontend/views/entity/PersistentQuery/index.tsx - About 1 hr to fix
        Severity
        Category
        Status
        Source
        Language