vorteil/direktiv

View on GitHub

Showing 467 of 1,322 total issues

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

const PermissionsPage = () => {
  const permissions = pages.permissions;

  const namespace = useNamespace();
  const { t } = useTranslation();
Severity: Major
Found in ui/src/pages/namespace/Permissions/index.tsx - About 2 hrs to fix

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

    func GetLogs(cmd *cobra.Command, instance string, query string) (urlOutput string) {
        instanceStatus := "pending"
    
        urlLogs := fmt.Sprintf("%s/logs?instance=%s&%s", UrlPrefixV2, instance, query)
        clientLogs := sse.NewClient(urlLogs)
    Severity: Minor
    Found in cmd/exec/cmd/instance.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 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

    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/refactor/instancestore/instancestoresql/sql_builders.go - About 2 hrs to fix

      Function Layout has 61 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const Layout = () => {
        const { data: version } = useVersion();
        const namespace = useNamespace();
        const { setNamespace } = useNamespaceActions();
        const { namespace: namespaceFromUrl } = useParams();
      Severity: Major
      Found in ui/src/pages/namespace/Layout.tsx - About 2 hrs to fix

        File temporary.go has 516 lines of code (exceeds 500 allowed). Consider refactoring.
        Open

        package flow
        
        import (
            "context"
            "encoding/json"
        Severity: Minor
        Found in pkg/flow/temporary.go - About 2 hrs to fix

          instanceMemory has 22 methods (exceeds 20 allowed). Consider refactoring.
          Open

          type instanceMemory struct {
              engine *engine
          
              data   interface{}
              memory interface{}
          Severity: Minor
          Found in pkg/flow/memory.go - About 2 hrs to fix

            engine has 22 methods (exceeds 20 allowed). Consider refactoring.
            Open

            type engine struct {
                *server
            
                scheduled sync.Map
            }
            Severity: Minor
            Found in pkg/flow/engine.go - About 2 hrs to fix

              File logs.ts has 263 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import { createNamespace, deleteNamespace } from "../../utils/namespace";
              import {
                workflowWithDelay as delayedWorkflowContent,
                workflowWithFewLogs as fewLogsWorkflowContent,
                workflowWithManyLogs as manyLogsWorkflowContent,
              Severity: Minor
              Found in ui/e2e/instances/details/logs.ts - About 2 hrs to fix

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

                import { createNamespace, deleteNamespace } from "../utils/namespace";
                import { expect, test } from "@playwright/test";
                
                import { createRegistries } from "../utils/registries";
                import { createSecrets } from "../utils/secrets";
                Severity: Minor
                Found in ui/e2e/settings/index.spec.ts - About 2 hrs to fix

                  Function executeEvent has a Cognitive Complexity of 32 (exceeds 20 allowed). Consider refactoring.
                  Open

                  func executeEvent(cmd *cobra.Command, url string, args []string) (string, error) {
                      event := cloudevents.NewEvent()
                  
                      // read event file in if provided
                      if len(args) > 0 {
                  Severity: Minor
                  Found in cmd/exec/cmd/events/events.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 JqState has a Cognitive Complexity of 32 (exceeds 20 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 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 getterLogic.Run has 81 lines of code (exceeds 50 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: Major
                  Found in pkg/flow/states/getter.go - About 2 hrs to fix

                    Function ConsumerTable has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    const ConsumerTable = () => {
                      const { t } = useTranslation();
                      const {
                        data: consumerList,
                        isSuccess,
                    Severity: Major
                    Found in ui/src/pages/namespace/Gateway/Consumers/Table/index.tsx - About 2 hrs to fix

                      Method instController.getPagination has 81 lines of code (exceeds 50 allowed). Consider refactoring.
                      Open

                      func (e *instController) getPagination(r *http.Request) (*paginationOptions, error) {
                          opts := new(paginationOptions)
                      
                          x := r.URL.Query().Get("limit")
                          if x != "" {
                      Severity: Major
                      Found in pkg/refactor/api/instances.go - About 2 hrs to fix

                        Function EndpointPage has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        const EndpointPage: FC = () => {
                          const { path } = pages.explorer.useParams();
                          const namespace = useNamespace();
                          const { segments } = analyzePath(path);
                          const filename = segments[segments.length - 1];
                        Severity: Major
                        Found in ui/src/pages/namespace/Explorer/Endpoint/index.tsx - About 2 hrs to fix

                          Function ServicesListPage has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          const ServicesListPage = () => {
                            const { t } = useTranslation();
                            const {
                              data: serviceList,
                              isFetching,
                          Severity: Major
                          Found in ui/src/pages/namespace/Services/List/index.tsx - About 2 hrs to fix

                            Function generateActionInput has 80 lines of code (exceeds 50 allowed). Consider refactoring.
                            Open

                            func generateActionInput(ctx context.Context, args *generateActionInputArgs) ([]byte, []model.FunctionFileDefinition, error) {
                                var err error
                                var input interface{}
                            
                                input, err = jqObject(args.Source, "jq(.)") //nolint:contextcheck
                            Severity: Major
                            Found in pkg/flow/states/action-helpers.go - About 2 hrs to fix

                              File local-server.go has 507 lines of code (exceeds 500 allowed). Consider refactoring.
                              Open

                              package sidecar
                              
                              import (
                                  "bytes"
                                  "context"
                              Severity: Minor
                              Found in cmd/sidecar/local-server.go - About 2 hrs to fix
                                Severity
                                Category
                                Status
                                Source
                                Language