vorteil/direktiv

View on GitHub

Showing 1,322 of 1,322 total issues

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

      <PaginationLink
        icon="left"
        onClick={() =>
          previousPage && setOffset(setOffsetByPageNumber(previousPage))
        }
Severity: Minor
Found in ui/src/components/Pagination/index.tsx and 1 other location - About 35 mins to fix
ui/src/components/Pagination/index.tsx on lines 65..70

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

export const namespaceKeys = {
  all: (apiKey: string | undefined) =>
    [{ scope: "namespace-list", apiKey }] as const,
};
Severity: Minor
Found in ui/src/api/namespaces/index.ts and 1 other location - About 35 mins to fix
ui/src/api/version/index.ts on lines 1..3

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

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

                  {field === "TRIGGER" && (
                    <Options
                      field={field}
                      value={filters[field]?.value}
                      setFilter={setFilter}
Severity: Minor
Found in ui/src/pages/namespace/Instances/components/Filters/index.tsx and 1 other location - About 35 mins to fix
ui/src/pages/namespace/Instances/components/Filters/index.tsx on lines 163..169

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

        onClick={() => {
          navigate(
            pages.instances.createHref({
              namespace,
              instance: instance.id,
Severity: Minor
Found in ui/src/pages/namespace/Monitoring/Instances/Row.tsx and 1 other location - About 35 mins to fix
ui/src/pages/namespace/Mirror/Detail/Row/index.tsx on lines 35..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 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

      onClick={() => {
        navigate(
          pages.mirror.createHref({
            namespace,
            sync: item.id,
Severity: Minor
Found in ui/src/pages/namespace/Mirror/Detail/Row/index.tsx and 1 other location - About 35 mins to fix
ui/src/pages/namespace/Monitoring/Instances/Row.tsx on lines 37..44

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

                  {field === "STATUS" && (
                    <Options
                      field={field}
                      value={filters[field]?.value}
                      setFilter={setFilter}
Severity: Minor
Found in ui/src/pages/namespace/Instances/components/Filters/index.tsx and 1 other location - About 35 mins to fix
ui/src/pages/namespace/Instances/components/Filters/index.tsx on lines 170..176

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

              <TooltipTrigger asChild>
                <CopyButton
                  value={logData ?? ""}
                  buttonProps={{
                    variant: "outline",
Severity: Minor
Found in ui/src/pages/namespace/Services/Detail/Pods/index.tsx and 1 other location - About 35 mins to fix
ui/src/pages/namespace/Instances/Detail/Main/InputOutput/Toolbar.tsx on lines 33..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 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

    for _, id := range result.Updates {
        v := searchSrc[id]
        v.Error = nil
        // v is passed un-cloned.
        if err := m.runtimeClient.updateService(v); err != nil {
Severity: Minor
Found in pkg/refactor/service/manager.go and 1 other location - About 30 mins to fix
pkg/refactor/service/manager.go on lines 132..141

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

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

func WriteJSON(w http.ResponseWriter, v any) {
    w.Header().Set("Content-Type", "application/json")
    w.WriteHeader(http.StatusOK)

    payLoad := struct {
Severity: Minor
Found in pkg/refactor/gateway2/helper.go and 1 other location - About 30 mins to fix
pkg/refactor/api/api.go on lines 221..231

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

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

func writeJSON(w http.ResponseWriter, v any) {
    w.Header().Set("Content-Type", "application/json")
    w.WriteHeader(http.StatusOK)

    payLoad := struct {
Severity: Minor
Found in pkg/refactor/api/api.go and 1 other location - About 30 mins to fix
pkg/refactor/gateway2/helper.go on lines 21..31

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

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

    for _, id := range result.Creates {
        v := searchSrc[id]
        v.Error = nil
        // v is passed un-cloned.
        if err := m.runtimeClient.createService(v); err != nil {
Severity: Minor
Found in pkg/refactor/service/manager.go and 1 other location - About 30 mins to fix
pkg/refactor/service/manager.go on lines 143..152

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

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 (
    <>
      <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 (
            <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 (
              <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/Service/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

              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

                  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
                  Severity
                  Category
                  Status
                  Source
                  Language