Showing 467 of 1,322 total issues
Method nsController.update
has 105 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (e *nsController) update(w http.ResponseWriter, r *http.Request) {
name := chi.URLParam(r, "name")
db, err := e.db.BeginTx(r.Context())
if err != nil {
Method instController.list
has 105 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (e *instController) list(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
ns := extractContextNamespace(r)
pagination, err := e.getPagination(r)
Method LocalServer.setVar
has 103 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (srv *LocalServer) setVar(ctx context.Context, ir *functionRequest, totalSize int64, r io.Reader, scope, key, vMimeType string) error {
var err error
var client varSetClient
var send func(*varSetClientMsg) error
Function Header
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const Header = () => {
const namespace = useNamespace();
const { routePath } = pages.gateway.useParams();
const { data: route } = useRoute({
routePath: routePath ?? "",
Method forEachLogic.processActionResults
has a Cognitive Complexity of 37 (exceeds 20 allowed). Consider refactoring. Open
Open
func (logic *forEachLogic) processActionResults(ctx context.Context, children []*ChildInfo, results *actionResultPayload) (*Transition, error) {
var err error
var found bool
var idx int
- Read upRead up
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
File index.spec.ts
has 293 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { createNamespace, deleteNamespace } from "e2e/utils/namespace";
import { createRouteYaml, removeLines } from "./utils";
import { expect, test } from "@playwright/test";
import { createFile } from "e2e/utils/files";
Method forEachLogic.processActionResults
has 99 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (logic *forEachLogic) processActionResults(ctx context.Context, children []*ChildInfo, results *actionResultPayload) (*Transition, error) {
var err error
var found bool
var idx int
File tree.go
has 539 lines of code (exceeds 500 allowed). Consider refactoring. Open
Open
// nolint
package endpoints
// This file has been copied and modified from https://github.com/go-chi/chi
// Radix tree implementation below is a based on the original work by
File index.spec.ts
has 288 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { createNamespace, deleteNamespace } from "../../utils/namespace";
import { expect, test } from "@playwright/test";
import {
parentWorkflow as parentWorkflowContent,
simpleWorkflow as simpleWorkflowContent,
Function ToGRPCCloudEvents
has 97 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func ToGRPCCloudEvents(r *http.Request) ([]cloudevents.Event, error) {
var events []cloudevents.Event
ct := r.Header.Get("Content-type")
oct := ct
Method engine.runState
has 95 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (engine *engine) runState(ctx context.Context, im *instanceMemory, wakedata []byte, err error) *states.Transition {
loggingCtx := im.Namespace().WithTags(ctx)
instanceTrackCtx := enginerefactor.WithTrack(loggingCtx, enginerefactor.BuildInstanceTrack(im.instance))
slog.Debug("Starting state execution.", enginerefactor.GetSlogAttributesWithStatus(ctx, core.LogRunningStatus)...)
Function recurseIntoString
has 95 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func recurseIntoString(data interface{}, s string) ([]interface{}, error) {
out := make([]interface{}, 0)
if TrimWhitespaceOnQueryStrings {
s = strings.TrimSpace(s)
Function Default
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const Default = () => {
const [pageSize, setPageSize] = useState(3);
return (
<div
className="flex flex-col items-center space-y-5 p-5
Method instanceMemory.GetVariables
has a Cognitive Complexity of 35 (exceeds 20 allowed). Consider refactoring. Open
Open
func (im *instanceMemory) GetVariables(ctx context.Context, vars []states.VariableSelector) ([]states.Variable, error) {
x := make([]states.Variable, 0)
tx, err := im.engine.flow.beginSQLTx(ctx)
if err != nil {
- Read upRead up
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 jxController.handler
has 92 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (c *jxController) handler(w http.ResponseWriter, r *http.Request) {
data, err := io.ReadAll(r.Body)
if err != nil {
return
}
Method dockerClient.createService
has 92 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (c *dockerClient) createService(sv *core.ServiceFileData) error {
// don't pull any image that has 'local' prefix.
if !strings.HasPrefix(sv.Image, "local") {
out, err := c.cli.ImagePull(context.Background(), sv.Image, types.ImagePullOptions{})
if err != nil {
Method fsController.updateFile
has 92 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (e *fsController) updateFile(w http.ResponseWriter, r *http.Request) {
ns := extractContextNamespace(r)
db, err := e.db.BeginTx(r.Context())
if err != nil {
Function SendEvent
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const SendEvent = () => {
const [body, setBody] = useState<string | undefined>(exampleEvent);
const [isOpen, setIsOpen] = useState(false);
const theme = useTheme();
const { t } = useTranslation();
Pubsub
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
Open
type Pubsub struct {
id uuid.UUID
notifier Notifier
handlers map[string]func(*PubsubUpdate)
File events.go
has 525 lines of code (exceeds 500 allowed). Consider refactoring. Open
Open
package flow
import (
"context"
"encoding/gob"