vorteil/direktiv

View on GitHub

Showing 1,235 of 1,235 total issues

Function MirrorBreadcrumb has 42 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const MirrorBreadcrumb = () => {
  const pages = usePages();
  const namespace = useNamespace();
  const { isMirrorPage, isSyncDetailPage, sync } = pages.mirror.useParams();
  const { icon: Icon } = pages.mirror;
Severity: Minor
Found in ui/src/components/Breadcrumb/MirrorBreadcrumb.tsx - About 1 hr to fix

    Function ExplorerHeader has 42 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const ExplorerHeader: FC = () => {
      const pages = usePages();
      const namespace = useNamespace();
      const { path } = pages.explorer.useParams();
    
    
    Severity: Minor
    Found in ui/src/pages/namespace/Explorer/Tree/Header.tsx - About 1 hr to fix

      Function InputOutput has 42 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const InputOutput = () => {
        const instanceId = useInstanceId();
        const { data } = useInstanceDetails({ instanceId });
        const tabs = ["input", "output"] as const;
      
      
      Severity: Minor
      Found in ui/src/pages/namespace/Instances/Detail/Main/InputOutput/index.tsx - About 1 hr to fix

        Method parallelLogic.processActionResults has 18 return statements (exceeds 4 allowed).
        Open

        func (logic *parallelLogic) processActionResults(ctx context.Context, children []*ChildInfo, results *actionResultPayload) (*Transition, error) {
            var err error
        
            var found bool
            var idx int
        Severity: Major
        Found in pkg/flow/states/parallel.go - About 1 hr to fix

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

              if usernameMatch && passwordMatch {
                  // set active comsumer.
                  r = gateway.InjectContextActiveConsumer(r, consumer)
                  // set headers if configured.
                  if ba.AddUsernameHeader {
          Severity: Major
          Found in pkg/gateway/plugins/auth/basic-auth.go and 1 other location - About 1 hr to fix
          pkg/gateway/plugins/auth/key-auth.go on lines 64..80

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

          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

              if c.APIKey == key {
                  // set active consumer
                  r = gateway.InjectContextActiveConsumer(r, c)
          
                  // set headers if configured
          Severity: Major
          Found in pkg/gateway/plugins/auth/key-auth.go and 1 other location - About 1 hr to fix
          pkg/gateway/plugins/auth/basic-auth.go on lines 62..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 169.

          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 resolver = zodResolver(
              GroupFormSchema.refine(
                (x) => !(unallowedNames ?? []).some((n) => n === x.group),
                {
                  path: ["group"],
          Severity: Major
          Found in ui/src/pages/namespace/Permissions/Groups/Create.tsx and 1 other location - About 1 hr to fix
          ui/src/pages/namespace/Permissions/Groups/Edit.tsx on lines 41..49

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

          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 resolver = zodResolver(
              GroupFormSchema.refine(
                (x) => !(unallowedNames ?? []).some((n) => n === x.group),
                {
                  path: ["group"],
          Severity: Major
          Found in ui/src/pages/namespace/Permissions/Groups/Edit.tsx and 1 other location - About 1 hr to fix
          ui/src/pages/namespace/Permissions/Groups/Create.tsx on lines 38..46

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

          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

            rest.get(apiEndpoint, (req, res, ctx) =>
              req?.headers?.get("direktiv-token") === API_KEY
                ? res(
                    ctx.json({
                      response: "this works",
          Severity: Major
          Found in ui/src/api/__tests__/apiFactory.test.ts and 1 other location - About 1 hr to fix
          ui/src/api/__tests__/apiFactory.test.ts 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 68.

          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 Main: FC<PropsWithChildren> = ({ children }) => (
            <div className="flex grow flex-col lg:pl-52">
              <main className="flex flex-1 flex-col">{children}</main>
            </div>
          );
          Severity: Major
          Found in ui/src/design/Appshell/index.tsx and 1 other location - About 1 hr to fix
          ui/src/design/Appshell/index.tsx on lines 25..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 68.

          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

            rest.get(apiEndpointWithDynamicSegment, (req, res, ctx) =>
              req?.headers?.get("direktiv-token") === API_KEY
                ? res(
                    ctx.json({
                      response: "dynamic segment this works",
          Severity: Major
          Found in ui/src/api/__tests__/apiFactory.test.ts and 1 other location - About 1 hr to fix
          ui/src/api/__tests__/apiFactory.test.ts on lines 34..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 68.

          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 SidebarMain: FC<PropsWithChildren> = ({ children }) => (
            <div className="hidden flex-1 overflow-y-auto lg:block">
              <nav className="mt-5 space-y-1 px-3">{children}</nav>
            </div>
          );
          Severity: Major
          Found in ui/src/design/Appshell/index.tsx and 1 other location - About 1 hr to fix
          ui/src/design/Appshell/index.tsx on lines 31..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 68.

          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 fsController.createFile has 66 lines of code (exceeds 50 allowed). Consider refactoring.
          Open

          func (e *fsController) createFile(w http.ResponseWriter, r *http.Request) {
              ns := extractContextNamespace(r)
          
              db, err := e.db.BeginTx(r.Context())
              if err != nil {
          Severity: Minor
          Found in pkg/api/filesystem.go - About 1 hr to fix

            Function JqState has 65 lines of code (exceeds 50 allowed). Consider refactoring.
            Open

            func JqState(l *lexer.L) lexer.StateFunc {
                src := make([]string, 3)
                var jdxJ int
            
                mover := func(rewind int, forward bool) {
            Severity: Minor
            Found in pkg/jqer/jqer.go - About 1 hr to fix

              Function useApiCommandTemplate has 40 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export const useApiCommandTemplate = (namespace: string, workflow: string) => {
                const baseUrl = window.location.origin;
                const memoizedTemplates: TemplateType[] = useMemo(
                  () => [
                    {
              Severity: Minor
              Found in ui/src/pages/namespace/Explorer/Workflow/ApiCommands/utils.ts - About 1 hr to fix

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

                export const tokenKeys = {
                  tokenList: (namespace: string, { apiKey }: { apiKey?: string }) =>
                    [
                      {
                        scope: "token-list",
                Severity: Major
                Found in ui/src/api/enterprise/tokens/index.ts and 6 other locations - About 1 hr to fix
                ui/src/api/enterprise/groups/index.ts on lines 1..10
                ui/src/api/enterprise/policy/index.ts on lines 1..4
                ui/src/api/notifications/index.ts on lines 1..10
                ui/src/api/registries/index.ts on lines 1..10
                ui/src/api/secrets/index.ts on lines 1..10
                ui/src/api/syncs/index.ts on lines 1..10

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

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

                export const secretKeys = {
                  secretsList: (namespace: string, { apiKey }: { apiKey?: string }) =>
                    [
                      {
                        scope: "secrets-list",
                Severity: Major
                Found in ui/src/api/secrets/index.ts and 6 other locations - About 1 hr to fix
                ui/src/api/enterprise/groups/index.ts on lines 1..10
                ui/src/api/enterprise/policy/index.ts on lines 1..4
                ui/src/api/enterprise/tokens/index.ts on lines 1..10
                ui/src/api/notifications/index.ts on lines 1..10
                ui/src/api/registries/index.ts on lines 1..10
                ui/src/api/syncs/index.ts on lines 1..10

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

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

                export const registriesKeys = {
                  registriesList: (namespace: string, { apiKey }: { apiKey?: string }) =>
                    [
                      {
                        scope: "registries-list",
                Severity: Major
                Found in ui/src/api/registries/index.ts and 6 other locations - About 1 hr to fix
                ui/src/api/enterprise/groups/index.ts on lines 1..10
                ui/src/api/enterprise/policy/index.ts on lines 1..4
                ui/src/api/enterprise/tokens/index.ts on lines 1..10
                ui/src/api/notifications/index.ts on lines 1..10
                ui/src/api/secrets/index.ts on lines 1..10
                ui/src/api/syncs/index.ts on lines 1..10

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

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

                export const policyKeys = {
                  get: (namespace: string, { apiKey }: { apiKey?: string }) =>
                    [{ scope: "policy", apiKey, namespace }] as const,
                };
                Severity: Major
                Found in ui/src/api/enterprise/policy/index.ts and 6 other locations - About 1 hr to fix
                ui/src/api/enterprise/groups/index.ts on lines 1..10
                ui/src/api/enterprise/tokens/index.ts on lines 1..10
                ui/src/api/notifications/index.ts on lines 1..10
                ui/src/api/registries/index.ts on lines 1..10
                ui/src/api/secrets/index.ts on lines 1..10
                ui/src/api/syncs/index.ts on lines 1..10

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

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

                export const notificationKeys = {
                  notifications: (namespace: string, { apiKey }: { apiKey?: string }) =>
                    [
                      {
                        scope: "notifications",
                Severity: Major
                Found in ui/src/api/notifications/index.ts and 6 other locations - About 1 hr to fix
                ui/src/api/enterprise/groups/index.ts on lines 1..10
                ui/src/api/enterprise/policy/index.ts on lines 1..4
                ui/src/api/enterprise/tokens/index.ts on lines 1..10
                ui/src/api/registries/index.ts on lines 1..10
                ui/src/api/secrets/index.ts on lines 1..10
                ui/src/api/syncs/index.ts on lines 1..10

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

                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