vorteil/direktiv

View on GitHub

Showing 1,235 of 1,235 total issues

Method actionLogic.Run has 8 return statements (exceeds 4 allowed).
Open

func (logic *actionLogic) Run(ctx context.Context, wakedata []byte) (*Transition, error) {
    // first schedule
    if len(wakedata) == 0 {
        err := noMemory(logic)
        if err != nil {
Severity: Major
Found in pkg/flow/states/action.go - About 50 mins to fix

    Method logController.getNewer has 8 return statements (exceeds 4 allowed).
    Open

    func (m logController) getNewer(ctx context.Context, t time.Time, params map[string]string) ([]logEntry, error) {
        var logs []core.LogEntry
        var err error
    
        // Determine the track based on the provided parameters
    Severity: Major
    Found in pkg/api/plattformlogs.go - About 50 mins to fix

      Method jxController.handler has 8 return statements (exceeds 4 allowed).
      Open

      func (c *jxController) handler(w http.ResponseWriter, r *http.Request) {
          data, err := io.ReadAll(r.Body)
          if err != nil {
              return
          }
      Severity: Major
      Found in pkg/api/jx.go - About 50 mins to fix

        Method Workflow.validate has 8 return statements (exceeds 4 allowed).
        Open

        func (o *Workflow) validate() error {
            if len(o.States) == 0 {
                return errors.New("workflow has no defined states")
            }
        
        
        Severity: Major
        Found in pkg/model/workflow.go - About 50 mins to fix

          Method Workflow.unmarshal has 8 return statements (exceeds 4 allowed).
          Open

          func (o *Workflow) unmarshal(m map[string]interface{}) error {
              // split start out from the rest, and umarshal it
              if err := o.unmStart(m); err != nil {
                  return err
              }
          Severity: Major
          Found in pkg/model/workflow.go - About 50 mins to fix

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

                loggingCtx := tracing.AddInstanceMemoryAttr(ctx, tracing.InstanceAttributes{
                    Namespace:    im.Namespace().Name,
                    InstanceID:   im.GetInstanceID().String(),
                    Invoker:      im.instance.Instance.Invoker,
                    Callpath:     tracing.CreateCallpath(im.instance),
            Severity: Major
            Found in pkg/flow/engine.go and 8 other locations - About 50 mins to fix
            pkg/flow/engine.go on lines 384..392
            pkg/flow/engine.go on lines 540..547
            pkg/flow/engine.go on lines 951..958
            pkg/flow/engine.go on lines 968..975
            pkg/flow/instance_messages.go on lines 118..128
            pkg/flow/scheduling.go on lines 105..112
            pkg/flow/status.go on lines 48..55
            pkg/flow/temporary.go on lines 135..142

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

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

                instanceCtx := tracing.AddInstanceMemoryAttr(ctx,
                    tracing.InstanceAttributes{
                        Namespace:    im.Namespace().Name,
                        InstanceID:   im.GetInstanceID().String(),
                        Invoker:      im.instance.Instance.Invoker,
            Severity: Major
            Found in pkg/flow/instance_messages.go and 8 other locations - About 50 mins to fix
            pkg/flow/engine.go on lines 384..392
            pkg/flow/engine.go on lines 540..547
            pkg/flow/engine.go on lines 672..679
            pkg/flow/engine.go on lines 951..958
            pkg/flow/engine.go on lines 968..975
            pkg/flow/scheduling.go on lines 105..112
            pkg/flow/status.go on lines 48..55
            pkg/flow/temporary.go on lines 135..142

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

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

                ctx = tracing.AddInstanceMemoryAttr(ctx, tracing.InstanceAttributes{
                    Namespace:    im.Namespace().Name,
                    InstanceID:   im.GetInstanceID().String(),
                    Invoker:      im.instance.Instance.Invoker,
                    Callpath:     tracing.CreateCallpath(im.instance),
            Severity: Major
            Found in pkg/flow/scheduling.go and 8 other locations - About 50 mins to fix
            pkg/flow/engine.go on lines 384..392
            pkg/flow/engine.go on lines 540..547
            pkg/flow/engine.go on lines 672..679
            pkg/flow/engine.go on lines 951..958
            pkg/flow/engine.go on lines 968..975
            pkg/flow/instance_messages.go on lines 118..128
            pkg/flow/status.go on lines 48..55
            pkg/flow/temporary.go on lines 135..142

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

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

                ctx = tracing.AddInstanceMemoryAttr(ctx, tracing.InstanceAttributes{
                    Namespace:    im.Namespace().Name,
                    InstanceID:   im.GetInstanceID().String(),
                    Invoker:      im.instance.Instance.Invoker,
                    Callpath:     tracing.CreateCallpath(im.instance),
            Severity: Major
            Found in pkg/flow/engine.go and 8 other locations - About 50 mins to fix
            pkg/flow/engine.go on lines 384..392
            pkg/flow/engine.go on lines 672..679
            pkg/flow/engine.go on lines 951..958
            pkg/flow/engine.go on lines 968..975
            pkg/flow/instance_messages.go on lines 118..128
            pkg/flow/scheduling.go on lines 105..112
            pkg/flow/status.go on lines 48..55
            pkg/flow/temporary.go on lines 135..142

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

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

                loggingCtx := tracing.AddInstanceMemoryAttr(ctx, tracing.InstanceAttributes{
                    Namespace:    im.Namespace().Name,
                    InstanceID:   im.GetInstanceID().String(),
                    Invoker:      im.instance.Instance.Invoker,
                    Callpath:     tracing.CreateCallpath(im.instance),
            Severity: Major
            Found in pkg/flow/engine.go and 8 other locations - About 50 mins to fix
            pkg/flow/engine.go on lines 384..392
            pkg/flow/engine.go on lines 540..547
            pkg/flow/engine.go on lines 672..679
            pkg/flow/engine.go on lines 951..958
            pkg/flow/instance_messages.go on lines 118..128
            pkg/flow/scheduling.go on lines 105..112
            pkg/flow/status.go on lines 48..55
            pkg/flow/temporary.go on lines 135..142

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

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

                ctx = tracing.AddInstanceMemoryAttr(ctx, tracing.InstanceAttributes{
                    Namespace:    im.Namespace().Name,
                    InstanceID:   im.GetInstanceID().String(),
                    Invoker:      im.instance.Instance.Invoker,
                    Callpath:     tracing.CreateCallpath(im.instance),
            Severity: Major
            Found in pkg/flow/status.go and 8 other locations - About 50 mins to fix
            pkg/flow/engine.go on lines 384..392
            pkg/flow/engine.go on lines 540..547
            pkg/flow/engine.go on lines 672..679
            pkg/flow/engine.go on lines 951..958
            pkg/flow/engine.go on lines 968..975
            pkg/flow/instance_messages.go on lines 118..128
            pkg/flow/scheduling.go on lines 105..112
            pkg/flow/temporary.go on lines 135..142

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

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

                ctx = tracing.AddInstanceMemoryAttr(ctx,
                    tracing.InstanceAttributes{
                        Namespace:    im.Namespace().Name,
                        InstanceID:   im.GetInstanceID().String(),
                        Invoker:      im.instance.Instance.Invoker,
            Severity: Major
            Found in pkg/flow/engine.go and 8 other locations - About 50 mins to fix
            pkg/flow/engine.go on lines 540..547
            pkg/flow/engine.go on lines 672..679
            pkg/flow/engine.go on lines 951..958
            pkg/flow/engine.go on lines 968..975
            pkg/flow/instance_messages.go on lines 118..128
            pkg/flow/scheduling.go on lines 105..112
            pkg/flow/status.go on lines 48..55
            pkg/flow/temporary.go on lines 135..142

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

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

                ctx = tracing.AddInstanceMemoryAttr(ctx, tracing.InstanceAttributes{
                    Namespace:    im.Namespace().Name,
                    InstanceID:   im.GetInstanceID().String(),
                    Invoker:      im.instance.Instance.Invoker,
                    Callpath:     tracing.CreateCallpath(im.instance),
            Severity: Major
            Found in pkg/flow/temporary.go and 8 other locations - About 50 mins to fix
            pkg/flow/engine.go on lines 384..392
            pkg/flow/engine.go on lines 540..547
            pkg/flow/engine.go on lines 672..679
            pkg/flow/engine.go on lines 951..958
            pkg/flow/engine.go on lines 968..975
            pkg/flow/instance_messages.go on lines 118..128
            pkg/flow/scheduling.go on lines 105..112
            pkg/flow/status.go 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 120.

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

                loggingCtx := tracing.AddInstanceMemoryAttr(ctx, tracing.InstanceAttributes{
                    Namespace:    im.Namespace().Name,
                    InstanceID:   im.GetInstanceID().String(),
                    Invoker:      im.instance.Instance.Invoker,
                    Callpath:     tracing.CreateCallpath(im.instance),
            Severity: Major
            Found in pkg/flow/engine.go and 8 other locations - About 50 mins to fix
            pkg/flow/engine.go on lines 384..392
            pkg/flow/engine.go on lines 540..547
            pkg/flow/engine.go on lines 672..679
            pkg/flow/engine.go on lines 968..975
            pkg/flow/instance_messages.go on lines 118..128
            pkg/flow/scheduling.go on lines 105..112
            pkg/flow/status.go on lines 48..55
            pkg/flow/temporary.go on lines 135..142

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

            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 (o *GetterState) GetTransitions() []string {
                transitions := make([]string, 0)
                if o.Transition != "" {
                    transitions = append(transitions, o.Transition)
                }
            Severity: Major
            Found in pkg/model/state-getter.go and 2 other locations - About 50 mins to fix
            pkg/model/state-foreach.go on lines 39..52
            pkg/model/state-validate.go on lines 38..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 119.

            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 (o *ForEachState) GetTransitions() []string {
                transitions := make([]string, 0)
                if o.Transition != "" {
                    transitions = append(transitions, o.Transition)
                }
            Severity: Major
            Found in pkg/model/state-foreach.go and 2 other locations - About 50 mins to fix
            pkg/model/state-getter.go on lines 66..79
            pkg/model/state-validate.go on lines 38..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 119.

            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 (o *ValidateState) GetTransitions() []string {
                transitions := make([]string, 0)
                if o.Transition != "" {
                    transitions = append(transitions, o.Transition)
                }
            Severity: Major
            Found in pkg/model/state-validate.go and 2 other locations - About 50 mins to fix
            pkg/model/state-foreach.go on lines 39..52
            pkg/model/state-getter.go on lines 66..79

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

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

            const api404 = apiFactory({
              url: () => apiEndpoint404,
              method: "GET",
              schema: z.object({
                response: z.string(),
            Severity: Major
            Found in ui/src/api/__tests__/apiFactory.test.ts and 4 other locations - About 50 mins to fix
            ui/src/api/__tests__/apiFactory.test.ts on lines 103..109
            ui/src/api/__tests__/apiFactory.test.ts on lines 125..129
            ui/src/api/__tests__/apiFactory.test.ts on lines 139..145
            ui/src/api/__tests__/apiFactory.test.ts on lines 147..153

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

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

            const apiJSONError = apiFactory({
              url: () => apiEndpointJSONError,
              method: "GET",
              schema: z.object({
                response: z.string(),
            Severity: Major
            Found in ui/src/api/__tests__/apiFactory.test.ts and 4 other locations - About 50 mins to fix
            ui/src/api/__tests__/apiFactory.test.ts on lines 103..109
            ui/src/api/__tests__/apiFactory.test.ts on lines 125..129
            ui/src/api/__tests__/apiFactory.test.ts on lines 131..137
            ui/src/api/__tests__/apiFactory.test.ts on lines 147..153

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

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

            const getMyApi = apiFactory({
              url: () => apiEndpoint,
              method: "GET",
              schema: z.object({
                response: z.string(),
            Severity: Major
            Found in ui/src/api/__tests__/apiFactory.test.ts and 4 other locations - About 50 mins to fix
            ui/src/api/__tests__/apiFactory.test.ts on lines 125..129
            ui/src/api/__tests__/apiFactory.test.ts on lines 131..137
            ui/src/api/__tests__/apiFactory.test.ts on lines 139..145
            ui/src/api/__tests__/apiFactory.test.ts on lines 147..153

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

            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