vorteil/direktiv

View on GitHub

Showing 1,235 of 1,235 total issues

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

type ExtendedUseInfiniteQueryReturn =
  | {
      isAllowed: false;
      noPermissionMessage: string;
    }
Severity: Minor
Found in ui/src/api/useInfiniteQueryWithPermissions.ts and 1 other location - About 35 mins to fix
ui/src/api/useQueryWithPermissions.ts on lines 21..29

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

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

      queryClient.setQueryData<RegistryListSchemaType>(
        registriesKeys.registriesList(namespace, {
          apiKey: apiKey ?? undefined,
        }),
        (oldData) => updateCache(oldData, deletedItem)
Severity: Minor
Found in ui/src/api/registries/mutate/deleteRegistry.ts and 2 other locations - About 35 mins to fix
ui/src/api/enterprise/groups/mutation/delete.ts on lines 60..65
ui/src/api/enterprise/tokens/mutate/delete.ts on lines 60..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 46.

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 onSubmit: SubmitHandler<FormInput> = ({
    name,
    gitRef,
    url,
    formType,
Severity: Minor
Found in ui/src/components/NamespaceEdit/index.tsx and 1 other location - About 35 mins to fix
ui/e2e/jqplayground/utils.ts on lines 20..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 46.

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

          <Badge
            variant={statusToBadgeVariant(instance.status)}
            icon={instance.status}
          >
            {instance.status}
Severity: Minor
Found in ui/src/pages/namespace/Instances/Detail/Header/index.tsx and 1 other location - About 35 mins to fix
ui/src/pages/namespace/Instances/List/Row.tsx on lines 96..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 46.

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 setFilter = (newFilter: FiltersSchemaType) => {
    const newFilters = { ...filters, ...newFilter };
    onUpdate(newFilters);
    resetMenu();
  };
ui/src/pages/namespace/Instances/components/Filters/index.tsx on lines 70..74

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

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

Avoid too many return statements within this function.
Open

  return [...startSegment, ...activeSegment, ...endSegment];
Severity: Major
Found in ui/src/components/Pagination/describePagination.ts - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

        return (
          <Card className="m-5 flex grow">
            <NoPermissions>{noPermissionMessage}</NoPermissions>
          </Card>
        );
    Severity: Major
    Found in ui/src/pages/namespace/Explorer/Service/index.tsx - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

        if (!servicesList) return null;
      Severity: Major
      Found in ui/src/pages/namespace/Explorer/Service/index.tsx - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

            return new editorWorker();
        Severity: Major
        Found in ui/src/design/Editor/index.tsx - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

            return (
              <>
                <div className="space-y-5 border-b border-gray-5 bg-gray-1 p-5 pb-0 dark:border-gray-dark-5 dark:bg-gray-dark-1">
                  <div className="flex flex-col max-sm:space-y-4 sm:flex-row sm:items-center sm:justify-between">
                    <h3
          Severity: Major
          Found in ui/src/pages/namespace/Explorer/Workflow/index.tsx - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

              return (
                <>
                  <Header mirror={mirror} loading={!!pendingSyncs.length} />
                  <PaginationProvider items={syncs} pageSize={pageSize}>
                    {({
            Severity: Major
            Found in ui/src/pages/namespace/Mirror/Detail/index.tsx - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                  return (
                    <Card className="m-5 flex grow">
                      <NoPermissions>{noPermissionMessage}</NoPermissions>
                    </Card>
                  );
              Severity: Major
              Found in ui/src/pages/namespace/Explorer/Endpoint/index.tsx - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                  return (
                    <>
                      <div className="border-b border-gray-5 bg-gray-1 p-5 dark:border-gray-dark-5 dark:bg-gray-dark-1">
                        <div className="flex flex-col gap-5 max-sm:space-y-4 sm:flex-row sm:items-center sm:justify-between">
                          <h3 className="flex items-center gap-x-2 font-bold text-primary-500">
                Severity: Major
                Found in ui/src/pages/namespace/Explorer/Service/index.tsx - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                      return (
                        <Card className="m-5 flex grow">
                          <NoPermissions>{noPermissionMessage}</NoPermissions>
                        </Card>
                      );
                  Severity: Major
                  Found in ui/src/pages/namespace/Explorer/Consumer/index.tsx - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                      return (
                        <>
                          <div className="border-b border-gray-5 bg-gray-1 p-5 dark:border-gray-dark-5 dark:bg-gray-dark-1">
                            <div className="flex flex-col gap-5 max-sm:space-y-4 sm:flex-row sm:items-center sm:justify-between">
                              <h3 className="flex items-center gap-x-2 font-bold text-primary-500">
                    Severity: Major
                    Found in ui/src/pages/namespace/Explorer/Endpoint/index.tsx - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                        if (!isRouteListFetched) return null;
                      Severity: Major
                      Found in ui/src/pages/namespace/Explorer/Endpoint/index.tsx - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                          return (
                            <>
                              <div className="border-b border-gray-5 bg-gray-1 p-5 dark:border-gray-dark-5 dark:bg-gray-dark-1">
                                <div className="flex flex-col gap-5 max-sm:space-y-4 sm:flex-row sm:items-center sm:justify-between">
                                  <h3 className="flex items-center gap-x-2 font-bold text-primary-500">
                        Severity: Major
                        Found in ui/src/pages/namespace/Explorer/Consumer/index.tsx - About 30 mins to fix

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

                          func (s *sqlEventListenerStore) DeleteByID(ctx context.Context, id uuid.UUID) error {
                              q := "DELETE FROM event_listeners WHERE id = $1;"
                              tx := s.db.WithContext(ctx).Exec(q, id)
                              if tx.Error != nil {
                                  return tx.Error
                          Severity: Minor
                          Found in pkg/datastore/datastoresql/eventstore_listener.go and 2 other locations - About 30 mins to fix
                          pkg/datastore/datastoresql/eventstore_history.go on lines 64..72
                          pkg/datastore/datastoresql/eventstore_topic.go 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 100.

                          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

                          func (s *sqlEventTopicsStore) Delete(ctx context.Context, eventListenerID uuid.UUID) error {
                              q := "DELETE FROM event_topics WHERE event_listener_id = $1;"
                              tx := s.db.WithContext(ctx).Exec(q, eventListenerID)
                              if tx.Error != nil {
                                  return tx.Error
                          Severity: Minor
                          Found in pkg/datastore/datastoresql/eventstore_topic.go and 2 other locations - About 30 mins to fix
                          pkg/datastore/datastoresql/eventstore_history.go on lines 64..72
                          pkg/datastore/datastoresql/eventstore_listener.go on lines 98..106

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

                          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

                            await expect(
                              page.getByTestId("service-row").getByRole("cell", {
                                name: "gcr.io/direktiv/functions/http-request:1.0",
                                exact: true,
                              }),
                          Severity: Major
                          Found in ui/e2e/services/list.spec.ts and 5 other locations - About 30 mins to fix
                          ui/e2e/gateway/consumers/index.spec.ts on lines 129..134
                          ui/e2e/gateway/consumers/index.spec.ts on lines 166..171
                          ui/e2e/services/list.spec.ts on lines 112..117
                          ui/e2e/services/list.spec.ts on lines 318..323
                          ui/e2e/services/list.spec.ts on lines 351..356

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

                          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