vorteil/direktiv

View on GitHub

Showing 1,235 of 1,235 total issues

Function buildEnvVars has 60 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func buildEnvVars(forSidecar bool, c *core.Config, sv *core.ServiceFileData) []corev1.EnvVar {
    proxyEnvs := []corev1.EnvVar{}

    if len(c.KnativeProxyHTTP) > 0 {
        proxyEnvs = append(proxyEnvs, corev1.EnvVar{
Severity: Minor
Found in pkg/service/helper.go - About 1 hr to fix

    Function ServicesBreadcrumb has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const ServicesBreadcrumb = () => {
      const pages = usePages();
      const namespace = useNamespace();
      const { isServicePage, isServiceDetailPage, service } =
        pages.services.useParams();
    Severity: Minor
    Found in ui/src/components/Breadcrumb/ServicesBreadcrumb.tsx - About 1 hr to fix

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

          const { result } = renderHook(
            () =>
              useQuery({
                queryKey: ["getmyapikey", API_KEY],
                queryFn: () =>
      Severity: Major
      Found in ui/src/api/__tests__/apiFactory.test.ts and 2 other locations - About 1 hr to fix
      ui/src/api/__tests__/apiFactory.test.ts on lines 272..285
      ui/src/api/__tests__/apiFactory.test.ts on lines 296..309

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

      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

          const { result } = renderHook(
            () =>
              useQuery({
                queryKey: ["getmyapikey", API_KEY],
                queryFn: () =>
      Severity: Major
      Found in ui/src/api/__tests__/apiFactory.test.ts and 2 other locations - About 1 hr to fix
      ui/src/api/__tests__/apiFactory.test.ts on lines 272..285
      ui/src/api/__tests__/apiFactory.test.ts on lines 325..338

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

      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

              <TableCell className="w-0">
                <TooltipCopyBadge value={instance.id} variant="outline">
                  {instance.id.slice(0, 8)}
                </TooltipCopyBadge>
              </TableCell>
      Severity: Major
      Found in ui/src/pages/namespace/Monitoring/Instances/Row.tsx and 2 other locations - About 1 hr to fix
      ui/src/pages/namespace/Events/History/Row.tsx on lines 32..36
      ui/src/pages/namespace/Instances/List/Row.tsx on lines 58..62

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

      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

              <TableCell data-testid="instance-column-id">
                <TooltipCopyBadge value={instance.id} variant="outline">
                  {instance.id.slice(0, 8)}
                </TooltipCopyBadge>
              </TableCell>
      Severity: Major
      Found in ui/src/pages/namespace/Instances/List/Row.tsx and 2 other locations - About 1 hr to fix
      ui/src/pages/namespace/Events/History/Row.tsx on lines 32..36
      ui/src/pages/namespace/Monitoring/Instances/Row.tsx on lines 51..55

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

      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

              <TableCell headers="event-id">
                <TooltipCopyBadge value={event.id} variant="outline">
                  {event.id.slice(0, 8)}
                </TooltipCopyBadge>
              </TableCell>
      Severity: Major
      Found in ui/src/pages/namespace/Events/History/Row.tsx and 2 other locations - About 1 hr to fix
      ui/src/pages/namespace/Instances/List/Row.tsx on lines 58..62
      ui/src/pages/namespace/Monitoring/Instances/Row.tsx on lines 51..55

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

      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

          mutationFn: ({ secret }: { secret: SecretSchemaType }) =>
            deleteSecret({
              apiKey: apiKey ?? undefined,
              urlParams: {
                name: secret.name,
      Severity: Major
      Found in ui/src/api/secrets/mutate/delete.ts and 1 other location - About 1 hr to fix
      ui/src/api/files/mutate/deleteFile.ts on lines 48..55

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

      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

          mutationFn: ({ file }: { file: BaseFileSchemaType }) =>
            deleteFile({
              apiKey: apiKey ?? undefined,
              urlParams: {
                path: file.path,
      Severity: Major
      Found in ui/src/api/files/mutate/deleteFile.ts and 1 other location - About 1 hr to fix
      ui/src/api/secrets/mutate/delete.ts 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 63.

      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

          const { result } = renderHook(
            () =>
              useQuery({
                queryKey: ["getmyapikey", API_KEY],
                queryFn: () =>
      Severity: Major
      Found in ui/src/api/__tests__/apiFactory.test.ts and 2 other locations - About 1 hr to fix
      ui/src/api/__tests__/apiFactory.test.ts on lines 296..309
      ui/src/api/__tests__/apiFactory.test.ts on lines 325..338

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

      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 ParentInstanceSchema = z.object({
        branch: z.number(),
        id: z.string(),
        state: z.string(),
        step: z.number(),
      Severity: Major
      Found in ui/src/api/instances/schema.ts and 1 other location - About 1 hr to fix
      ui/src/api/secrets/schema.ts on lines 11..16

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

      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 SecretSchema = z.object({
        name: z.string(),
        createdAt: z.string(),
        updatedAt: z.string(),
        initialized: z.boolean(),
      Severity: Major
      Found in ui/src/api/secrets/schema.ts and 1 other location - About 1 hr to fix
      ui/src/api/instances/schema.ts on lines 30..35

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

      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

      Method generateEventLogic.Run has 59 lines of code (exceeds 50 allowed). Consider refactoring.
      Open

      func (logic *generateEventLogic) Run(ctx context.Context, wakedata []byte) (*Transition, error) {
          err := scheduleOnce(logic, wakedata)
          if err != nil {
              return nil, err
          }
      Severity: Minor
      Found in pkg/flow/states/generateEvent.go - About 1 hr to fix

        Function buildContainers has 59 lines of code (exceeds 50 allowed). Consider refactoring.
        Open

        func buildContainers(c *core.Config, sv *core.ServiceFileData) ([]corev1.Container, error) {
            // set resource limits.
            rl, err := buildResourceLimits(c, sv)
            if err != nil {
                return nil, err
        Severity: Minor
        Found in pkg/service/helper.go - About 1 hr to fix

          Function getLayoutedElements has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export const getLayoutedElements = (
            incomingEles: (Edge | Node)[],
            orientation: Orientation = "vertical"
          ) => {
            const dagreGraph = new dagre.graphlib.Graph();
          Severity: Minor
          Found in ui/src/design/WorkflowDiagram/utils.ts - About 1 hr to fix

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

                    <div className="text-sm">
                      <div className="text-gray-10 dark:text-gray-dark-10">
                        {t("pages.gateway.routes.columns.anonymous")}
                      </div>
                      <AllowAnonymous allow={route.allow_anonymous} />
            Severity: Major
            Found in ui/src/pages/namespace/Gateway/Routes/Detail/Header.tsx and 2 other locations - About 1 hr to fix
            ui/src/pages/namespace/Gateway/Routes/Detail/Header.tsx on lines 61..66
            ui/src/pages/namespace/Gateway/Routes/Detail/Header.tsx on lines 67..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 62.

            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

              const save = (value: ServiceFormSchemaType) => {
                const toSave = jsonToYaml(value);
                updateService({
                  path: data.path,
                  payload: { data: encode(toSave) },
            ui/src/pages/namespace/Explorer/Consumer/ConsumerEditor/index.tsx on lines 34..40
            ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/index.tsx on lines 34..40

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 62.

            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

              const save = (value: ConsumerFormSchemaType) => {
                const toSave = jsonToYaml(value);
                updateFile({
                  path: data.path,
                  payload: { data: encode(toSave) },
            ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/index.tsx on lines 34..40
            ui/src/pages/namespace/Explorer/Service/ServiceEditor/index.tsx on lines 37..43

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

            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

              const filteredItems = useMemo(
                () =>
                  (data?.data ?? [])?.filter(
                    (item) => !isSearch || item.url.includes(search)
                  ),
            Severity: Major
            Found in ui/src/pages/namespace/Settings/Registries/index.tsx and 2 other locations - About 1 hr to fix
            ui/src/pages/namespace/Explorer/Workflow/Settings/Variables/index.tsx on lines 53..59
            ui/src/pages/namespace/Settings/Secrets/index.tsx on lines 47..53

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

            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 getPermissionKeys = apiFactory({
              url: ({ baseUrl }: { baseUrl?: string }) =>
                `${baseUrl ?? ""}/api/v2/info/permissions`,
              method: "GET",
              schema: PermissionKeysSchema,
            Severity: Major
            Found in ui/src/api/enterprise/permissions/query/get.ts and 1 other location - About 1 hr to fix
            ui/src/api/namespaces/query/get.ts on lines 14..19

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

            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