vorteil/direktiv

View on GitHub

Showing 407 of 1,235 total issues

Function Header has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

const Header = ({ serviceId }: { serviceId: string }) => {
  const pages = usePages();
  const { data: service, refetch, isFetching } = useService(serviceId);

  const { t } = useTranslation();
Severity: Minor
Found in ui/src/pages/namespace/Services/Detail/Header.tsx - About 45 mins 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 ServicesTableRow has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

}> = ({ service, setRebuildService }) => {
  const pages = usePages();
  const namespace = useNamespace();
  const navigate = useNavigate();
  const { t } = useTranslation();
Severity: Minor
Found in ui/src/pages/namespace/Services/List/Row/index.tsx - About 45 mins 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 MirrorDetail has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

const MirrorDetail = () => {
  const { data, isAllowed, noPermissionMessage, isFetched } = useListSyncs();
  const namespace = useNamespace();
  const namespaceDetail = useNamespaceDetail();

Severity: Minor
Found in ui/src/pages/namespace/Mirror/Detail/index.tsx - About 45 mins 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 EndpointPage has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

const EndpointPage: FC = () => {
  const pages = usePages();
  const { path } = pages.explorer.useParams();
  const namespace = useNamespace();
  const { segments } = analyzePath(path);
Severity: Minor
Found in ui/src/pages/namespace/Explorer/Endpoint/index.tsx - About 45 mins 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 JqPlaygroundPage has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

const JqPlaygroundPage: FC = () => {
  const { t } = useTranslation();
  const theme = useTheme();
  const {
    setData: storePlaygroundDataInLocalstorage,
Severity: Minor
Found in ui/src/pages/namespace/JqPlayground/index.tsx - About 45 mins 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 uploader.createFileItem has 6 return statements (exceeds 4 allowed).
Open

func (u *uploader) createFileItem(path, method string, obj fileObject) error {
    parent := path
    parent = strings.ReplaceAll(parent, "\\", "/")

    if method == "POST" {
Severity: Major
Found in cmd/exec/cli/uploader.go - About 40 mins to fix

    Function fetchSecret has 6 return statements (exceeds 4 allowed).
    Open

    func fetchSecret(db *database.SQLStore, namespace string, callExpression string) (string, error) {
        callExpression = strings.TrimSpace(callExpression)
        if !strings.HasPrefix(callExpression, "fetchSecret") {
            return callExpression, nil
        }
    Severity: Major
    Found in pkg/gateway/fetch_secret.go - About 40 mins to fix

      Method forEachLogic.scheduleRetryAction has 6 return statements (exceeds 4 allowed).
      Open

      func (logic *forEachLogic) scheduleRetryAction(ctx context.Context, retry *actionRetryInfo) error {
          logic.Log(ctx, log.Info, "Retrying...")
      
          x, err := jqOne(logic.GetInstanceData(), logic.Array) //nolint:contextcheck
          if err != nil {
      Severity: Major
      Found in pkg/flow/states/foreach.go - About 40 mins to fix

        Method forEachLogic.scheduleFirstActions has 6 return statements (exceeds 4 allowed).
        Open

        func (logic *forEachLogic) scheduleFirstActions(ctx context.Context) (*Transition, error) {
            x, err := jqOne(logic.GetInstanceData(), logic.Array) //nolint:contextcheck
            if err != nil {
                return nil, err
            }
        Severity: Major
        Found in pkg/flow/states/foreach.go - About 40 mins to fix

          Method forEachLogic.scheduleAction has 6 return statements (exceeds 4 allowed).
          Open

          func (logic *forEachLogic) scheduleAction(ctx context.Context, inputSource interface{}, attempt, iterator int) (*ChildInfo, error) {
              action := logic.Action
          
              input, files, err := generateActionInput(ctx, &generateActionInputArgs{
                  Instance: logic.Instance,
          Severity: Major
          Found in pkg/flow/states/foreach.go - About 40 mins to fix

            Method parallelLogic.scheduleAction has 6 return statements (exceeds 4 allowed).
            Open

            func (logic *parallelLogic) scheduleAction(ctx context.Context, action *model.ActionDefinition, attempt int) (*ChildInfo, error) {
                input, files, err := generateActionInput(ctx, &generateActionInputArgs{
                    Instance: logic.Instance,
                    Source:   logic.GetInstanceData(),
                    Action:   action,
            Severity: Major
            Found in pkg/flow/states/parallel.go - About 40 mins to fix

              Method DirektivApplyer.copyFilesIntoRoot has 6 return statements (exceeds 4 allowed).
              Open

              func (o *DirektivApplyer) copyFilesIntoRoot(ctx context.Context) error {
                  paths, err := o.parser.ListFiles()
                  if err != nil {
                      return err
                  }
              Severity: Major
              Found in pkg/mirror/apply.go - About 40 mins to fix

                Method instanceMemory.flushUpdates has 6 return statements (exceeds 4 allowed).
                Open

                func (im *instanceMemory) flushUpdates(ctx context.Context) error {
                    data, err := json.Marshal(im.updateArgs)
                    if err != nil {
                        panic(err)
                    }
                Severity: Major
                Found in pkg/flow/memory.go - About 40 mins to fix

                  Method engine.EventsInvoke has 6 return statements (exceeds 4 allowed).
                  Open

                  func (engine *engine) EventsInvoke(tctx context.Context, workflowID uuid.UUID, events ...*cloudevents.Event) {
                      ctx := context.Background()
                  
                      tx, err := engine.flow.beginSQLTx(ctx)
                      if err != nil {
                  Severity: Major
                  Found in pkg/flow/engine.go - About 40 mins to fix

                    Method ACLPlugin.Execute has 6 return statements (exceeds 4 allowed).
                    Open

                    func (acl *ACLPlugin) Execute(w http.ResponseWriter, r *http.Request) *http.Request {
                        c := gateway.ExtractContextActiveConsumer(r)
                        if c == nil {
                            gateway.WriteInternalError(r, w, nil, "missing consumer")
                            return nil
                    Severity: Major
                    Found in pkg/gateway/plugins/inbound/acl-plugin.go - About 40 mins to fix

                      Function getVariableMetaFromFlow has 6 return statements (exceeds 4 allowed).
                      Open

                      func getVariableMetaFromFlow(ctx context.Context, flowToken string, flowAddr string, ir *functionRequest, scope, key string) (variable, int, error) {
                          var varResp *variablesResponse
                          var err error
                          var typ string
                          statusCode := http.StatusOK
                      Severity: Major
                      Found in cmd/sidecar/api_v2_clients.go - About 40 mins to fix

                        Method JSInboundPlugin.Execute has 6 return statements (exceeds 4 allowed).
                        Open

                        func (js *JSInboundPlugin) Execute(w http.ResponseWriter, r *http.Request) *http.Request {
                            var (
                                err error
                                b   []byte
                            )
                        Severity: Major
                        Found in pkg/gateway/plugins/inbound/js-inbound.go - About 40 mins to fix

                          Method instanceDataQuery.PopMessage has 6 return statements (exceeds 4 allowed).
                          Open

                          func (q *instanceDataQuery) PopMessage(ctx context.Context) (*instancestore.InstanceMessageData, error) {
                              columns := []string{fieldInstanceMessageID, fieldInstanceMessageInstanceID, fieldInstanceMessageCreatedAt, fieldInstanceMessagePayload}
                              query := fmt.Sprintf(`SELECT %s FROM %s WHERE %s = ? ORDER BY %s ASC LIMIT 1`, strings.Join(columns, ", "), messagesTable, fieldInstanceMessageInstanceID, fieldInstanceMessageCreatedAt)
                          
                              msg := &instancestore.InstanceMessageData{}
                          Severity: Major
                          Found in pkg/instancestore/instancestoresql/instance_data_query.go - About 40 mins to fix

                            Method actionLogic.processActionResults has 6 return statements (exceeds 4 allowed).
                            Open

                            func (logic *actionLogic) processActionResults(ctx context.Context, children []*ChildInfo, results *actionResultPayload) (*Transition, error) {
                                var err error
                            
                                sd := children[0]
                            
                            
                            Severity: Major
                            Found in pkg/flow/states/action.go - About 40 mins to fix

                              Method GenerateEventState.Validate has 6 return statements (exceeds 4 allowed).
                              Open

                              func (o *GenerateEventState) Validate() error {
                                  if err := o.commonValidate(); err != nil {
                                      return err
                                  }
                              
                              
                              Severity: Major
                              Found in pkg/model/state-generate-event.go - About 40 mins to fix
                                Severity
                                Category
                                Status
                                Source
                                Language