vorteil/direktiv

View on GitHub

Showing 1,235 of 1,235 total issues

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

        <Fieldset
          label={t(
            "pages.explorer.endpoint.editor.form.plugins.auth.keyAuth.addGroupsHeader"
          )}
          htmlFor="add-groups-header"
ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Auth/BasicAuthForm.tsx on lines 65..81
ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Auth/BasicAuthForm.tsx on lines 82..98
ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Auth/KeyAuthForm.tsx on lines 68..84
ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Auth/KeyAuthForm.tsx on lines 85..101
ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Inbound/EventFilterForm.tsx on lines 89..105
ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Inbound/RequestConvertForm.tsx on lines 66..82
ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Inbound/RequestConvertForm.tsx on lines 83..99
ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Inbound/RequestConvertForm.tsx on lines 100..116
ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Inbound/RequestConvertForm.tsx on lines 117..133
ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Target/TargetFlowForm.tsx on lines 112..128

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

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

        <Fieldset
          label={t(
            "pages.explorer.endpoint.editor.form.plugins.target.targetFlow.asynchronous"
          )}
          htmlFor="async"
ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Auth/BasicAuthForm.tsx on lines 65..81
ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Auth/BasicAuthForm.tsx on lines 82..98
ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Auth/KeyAuthForm.tsx on lines 68..84
ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Auth/KeyAuthForm.tsx on lines 85..101
ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Auth/KeyAuthForm.tsx on lines 102..118
ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Inbound/EventFilterForm.tsx on lines 89..105
ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Inbound/RequestConvertForm.tsx on lines 66..82
ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Inbound/RequestConvertForm.tsx on lines 83..99
ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Inbound/RequestConvertForm.tsx on lines 100..116
ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Inbound/RequestConvertForm.tsx on lines 117..133

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

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 jxController.handler has 92 lines of code (exceeds 50 allowed). Consider refactoring.
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 2 hrs to fix

    Function SendEvent has 67 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const SendEvent = () => {
      const [body, setBody] = useState<string | undefined>(exampleEvent);
      const [isOpen, setIsOpen] = useState(false);
      const theme = useTheme();
      const { t } = useTranslation();
    Severity: Major
    Found in ui/src/pages/namespace/Events/History/SendEvent.tsx - About 2 hrs to fix

      Function PermissionsPage has 66 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const PermissionsPage = () => {
        const pages = usePages();
        const permissions = pages.permissions;
      
        const namespace = useNamespace();
      Severity: Major
      Found in ui/src/pages/namespace/Permissions/index.tsx - About 2 hrs to fix

        File codeEditor.spec.ts has 276 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import { createNamespace, deleteNamespace } from "../../utils/namespace";
        import { expect, test } from "@playwright/test";
        
        import { createWorkflow } from "../../utils/workflow";
        import { faker } from "@faker-js/faker";
        Severity: Minor
        Found in ui/e2e/explorer/workflow/codeEditor.spec.ts - About 2 hrs to fix

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

          const fetchPods = async ({
            queryKey: [{ apiKey, namespace, service }],
          }: QueryFunctionContext<ReturnType<(typeof serviceKeys)["servicePods"]>>) =>
            getPods({
              apiKey,
          Severity: Major
          Found in ui/src/api/services/query/pods.ts and 8 other locations - About 2 hrs to fix
          ui/src/api/events/query/get.ts on lines 40..46
          ui/src/api/files/query/file.ts on lines 28..37
          ui/src/api/instances/query/details/index.ts on lines 22..30
          ui/src/api/instances/query/input.ts on lines 26..32
          ui/src/api/instances/query/output.ts on lines 26..32
          ui/src/api/metrics/query/metrics.ts on lines 19..28
          ui/src/api/variables/query/details.ts on lines 18..24
          ui/src/api/variables/query/get.ts on lines 28..34

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

          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

          const fetchInstanceInput = async ({
            queryKey: [{ apiKey, namespace, instanceId }],
          }: QueryFunctionContext<ReturnType<(typeof instanceKeys)["instanceInput"]>>) =>
            getInstanceInput({
              apiKey,
          Severity: Major
          Found in ui/src/api/instances/query/input.ts and 8 other locations - About 2 hrs to fix
          ui/src/api/events/query/get.ts on lines 40..46
          ui/src/api/files/query/file.ts on lines 28..37
          ui/src/api/instances/query/details/index.ts on lines 22..30
          ui/src/api/instances/query/output.ts on lines 26..32
          ui/src/api/metrics/query/metrics.ts on lines 19..28
          ui/src/api/services/query/pods.ts on lines 24..30
          ui/src/api/variables/query/details.ts on lines 18..24
          ui/src/api/variables/query/get.ts on lines 28..34

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

          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

          const fetchInstanceDetails = async ({
            queryKey: [{ apiKey, namespace, instanceId }],
          }: QueryFunctionContext<
            ReturnType<(typeof instanceKeys)["instanceDetails"]>
          >) =>
          Severity: Major
          Found in ui/src/api/instances/query/details/index.ts and 8 other locations - About 2 hrs to fix
          ui/src/api/events/query/get.ts on lines 40..46
          ui/src/api/files/query/file.ts on lines 28..37
          ui/src/api/instances/query/input.ts on lines 26..32
          ui/src/api/instances/query/output.ts on lines 26..32
          ui/src/api/metrics/query/metrics.ts on lines 19..28
          ui/src/api/services/query/pods.ts on lines 24..30
          ui/src/api/variables/query/details.ts on lines 18..24
          ui/src/api/variables/query/get.ts on lines 28..34

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

          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

          const fetchVars = async ({
            queryKey: [{ apiKey, namespace, workflowPath }],
          }: QueryFunctionContext<ReturnType<(typeof varKeys)["varList"]>>) =>
            getVars({
              apiKey,
          Severity: Major
          Found in ui/src/api/variables/query/get.ts and 8 other locations - About 2 hrs to fix
          ui/src/api/events/query/get.ts on lines 40..46
          ui/src/api/files/query/file.ts on lines 28..37
          ui/src/api/instances/query/details/index.ts on lines 22..30
          ui/src/api/instances/query/input.ts on lines 26..32
          ui/src/api/instances/query/output.ts on lines 26..32
          ui/src/api/metrics/query/metrics.ts on lines 19..28
          ui/src/api/services/query/pods.ts on lines 24..30
          ui/src/api/variables/query/details.ts on lines 18..24

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

          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

          const fetchMetrics = async ({
            queryKey: [{ apiKey, namespace, path }],
          }: QueryFunctionContext<ReturnType<(typeof metricsKeys)["metrics"]>>) =>
            getMetrics({
              apiKey,
          Severity: Major
          Found in ui/src/api/metrics/query/metrics.ts and 8 other locations - About 2 hrs to fix
          ui/src/api/events/query/get.ts on lines 40..46
          ui/src/api/files/query/file.ts on lines 28..37
          ui/src/api/instances/query/details/index.ts on lines 22..30
          ui/src/api/instances/query/input.ts on lines 26..32
          ui/src/api/instances/query/output.ts on lines 26..32
          ui/src/api/services/query/pods.ts on lines 24..30
          ui/src/api/variables/query/details.ts on lines 18..24
          ui/src/api/variables/query/get.ts on lines 28..34

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

          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

          const fetchVarDetails = async ({
            queryKey: [{ apiKey, namespace, id }],
          }: QueryFunctionContext<ReturnType<(typeof varKeys)["varDetails"]>>) =>
            getVariableDetails({
              apiKey,
          Severity: Major
          Found in ui/src/api/variables/query/details.ts and 8 other locations - About 2 hrs to fix
          ui/src/api/events/query/get.ts on lines 40..46
          ui/src/api/files/query/file.ts on lines 28..37
          ui/src/api/instances/query/details/index.ts on lines 22..30
          ui/src/api/instances/query/input.ts on lines 26..32
          ui/src/api/instances/query/output.ts on lines 26..32
          ui/src/api/metrics/query/metrics.ts on lines 19..28
          ui/src/api/services/query/pods.ts on lines 24..30
          ui/src/api/variables/query/get.ts on lines 28..34

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

          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

          const fetchInstanceOutput = async ({
            queryKey: [{ apiKey, namespace, instanceId }],
          }: QueryFunctionContext<ReturnType<(typeof instanceKeys)["instanceOutput"]>>) =>
            getInstanceOutput({
              apiKey,
          Severity: Major
          Found in ui/src/api/instances/query/output.ts and 8 other locations - About 2 hrs to fix
          ui/src/api/events/query/get.ts on lines 40..46
          ui/src/api/files/query/file.ts on lines 28..37
          ui/src/api/instances/query/details/index.ts on lines 22..30
          ui/src/api/instances/query/input.ts on lines 26..32
          ui/src/api/metrics/query/metrics.ts on lines 19..28
          ui/src/api/services/query/pods.ts on lines 24..30
          ui/src/api/variables/query/details.ts on lines 18..24
          ui/src/api/variables/query/get.ts on lines 28..34

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

          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

          const fetchEvents = async ({
            queryKey: [{ apiKey, namespace, filters }],
          }: QueryFunctionContext<ReturnType<(typeof eventKeys)["eventsList"]>>) =>
            getEvents({
              apiKey,
          Severity: Major
          Found in ui/src/api/events/query/get.ts and 8 other locations - About 2 hrs to fix
          ui/src/api/files/query/file.ts on lines 28..37
          ui/src/api/instances/query/details/index.ts on lines 22..30
          ui/src/api/instances/query/input.ts on lines 26..32
          ui/src/api/instances/query/output.ts on lines 26..32
          ui/src/api/metrics/query/metrics.ts on lines 19..28
          ui/src/api/services/query/pods.ts on lines 24..30
          ui/src/api/variables/query/details.ts on lines 18..24
          ui/src/api/variables/query/get.ts on lines 28..34

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

          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

          const fetchFile = async ({
            queryKey: [{ apiKey, namespace, path }],
          }: QueryFunctionContext<ReturnType<(typeof fileKeys)["file"]>>) =>
            getFile({
              apiKey,
          Severity: Major
          Found in ui/src/api/files/query/file.ts and 8 other locations - About 2 hrs to fix
          ui/src/api/events/query/get.ts on lines 40..46
          ui/src/api/instances/query/details/index.ts on lines 22..30
          ui/src/api/instances/query/input.ts on lines 26..32
          ui/src/api/instances/query/output.ts on lines 26..32
          ui/src/api/metrics/query/metrics.ts on lines 19..28
          ui/src/api/services/query/pods.ts on lines 24..30
          ui/src/api/variables/query/details.ts on lines 18..24
          ui/src/api/variables/query/get.ts on lines 28..34

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

          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 getterLogic.Run has a Cognitive Complexity of 34 (exceeds 20 allowed). Consider refactoring.
          Open

          func (logic *getterLogic) 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/getter.go - About 2 hrs to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Method instanceMemory.SetVariables has a Cognitive Complexity of 34 (exceeds 20 allowed). Consider refactoring.
          Open

          func (im *instanceMemory) SetVariables(ctx context.Context, vars []states.VariableSetter) error {
              tx, err := im.engine.flow.beginSQLTx(ctx)
              if err != nil {
                  return err
              }
          Severity: Minor
          Found in pkg/flow/temporary.go - About 2 hrs to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Function generateGetInstancesFilters has 89 lines of code (exceeds 50 allowed). Consider refactoring.
          Open

          func generateGetInstancesFilters(opts *instancestore.ListOpts) ([]string, []interface{}, error) {
              if opts == nil {
                  return []string{}, []interface{}{}, nil
              }
          
          
          Severity: Major
          Found in pkg/instancestore/instancestoresql/sql_builders.go - About 2 hrs to fix

            Method engine.doKnativeHTTPRequest has 88 lines of code (exceeds 50 allowed). Consider refactoring.
            Open

            func (engine *engine) doKnativeHTTPRequest(ctx context.Context,
                ar *functionRequest, arReq *enginerefactor.ActionRequest,
            ) {
                ctx, spanEnd, err := tracing.NewSpan(ctx, "executing knative request to action")
                if err != nil {
            Severity: Major
            Found in pkg/flow/temporary.go - About 2 hrs to fix

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

                  onSuccess(data, { description }) {
                    queryClient.invalidateQueries({
                      queryKey: groupKeys.groupList(namespace, {
                        apiKey: apiKey ?? undefined,
                      }),
              Severity: Major
              Found in ui/src/api/enterprise/groups/mutation/create.ts and 1 other location - About 2 hrs to fix
              ui/src/api/enterprise/groups/mutation/edit.ts on lines 57..71

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

              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