Showing 463 of 1,333 total issues
flowHandler
has 40 methods (exceeds 20 allowed). Consider refactoring. Open
type flowHandler struct {
client grpc.FlowClient
prometheus prometheus.Client
apiV2Address string
Method parallelLogic.processActionResults
has a Cognitive Complexity of 50 (exceeds 20 allowed). Consider refactoring. Open
func (logic *parallelLogic) 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
Function RegistriesList
has 128 lines of code (exceeds 25 allowed). Consider refactoring. Open
const RegistriesList: FC = () => {
const { t } = useTranslation();
const [dialogOpen, setDialogOpen] = useState(false);
const [deleteRegistry, setDeleteRegistry] = useState<RegistrySchemaType>();
Function Layout
has 122 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Layout = () => {
const { t } = useTranslation();
const {
data: availableNamespaces,
isFetched,
Function Instances
has 116 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const Instances = () => {
const {
data: sucessfullInstances,
isFetched: isFetchedSucessfullInstances,
isFetching: isFetchingSucessfullinstances,
Function ChildInstances
has 115 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ChildInstances = () => {
const instanceId = useInstanceId();
const namespace = useNamespace();
const [popoverOpen, setPopoverOpen] = useState(false);
const { data, refetch, isFetching } = useInstances({
Function recurseIntoString
has a Cognitive Complexity of 46 (exceeds 20 allowed). Consider refactoring. Open
func recurseIntoString(data interface{}, s string) ([]interface{}, error) {
out := make([]interface{}, 0)
if TrimWhitespaceOnQueryStrings {
s = strings.TrimSpace(s)
- 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
Function generateGetInstancesFilters
has a Cognitive Complexity of 46 (exceeds 20 allowed). Consider refactoring. Open
func generateGetInstancesFilters(opts *instancestore.ListOpts) ([]string, []interface{}, error) {
if opts == nil {
return []string{}, []interface{}{}, 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
Function initLegacyServer
has 136 lines of code (exceeds 50 allowed). Consider refactoring. Open
func initLegacyServer(circuit *core.Circuit, config *core.Config, db *gorm.DB, dbManager *database.SQLStore) (*server, error) {
srv := new(server)
srv.ID = uuid.New()
srv.initJQ()
srv.config = config
File templates.tsx
has 350 lines of code (exceeds 250 allowed). Consider refactoring. Open
export const noop = {
name: "noop",
data: `direktiv_api: workflow/v1
description: A simple 'no-op' state that returns 'Hello world!'
states:
Function checkInstanceRender
has 107 lines of code (exceeds 25 allowed). Consider refactoring. Open
const checkInstanceRender = async (instance: Instance) => {
const instancesList = await getInstances({
urlParams: {
baseUrl: process.env.PLAYWRIGHT_UI_BASE_URL,
namespace,
Function Initialize
has 131 lines of code (exceeds 50 allowed). Consider refactoring. Open
func Initialize(app core.App, db *database.SQLStore, bus *pubsub2.Bus, instanceManager *instancestore.InstanceManager, addr string, circuit *core.Circuit) error {
funcCtr := &serviceController{
manager: app.ServiceManager,
}
fsCtr := &fsController{
Method flowHandler.WaitWorkflow
has 130 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (h *flowHandler) WaitWorkflow(w http.ResponseWriter, r *http.Request) {
slog.Debug("Handling request", "this", this())
ctx := r.Context()
namespace := mux.Vars(r)["ns"]
Function Activities
has 105 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Activities = () => {
const { data, isAllowed, noPermissionMessage, isFetched } = useMirrorInfo();
const { t } = useTranslation();
const queryClient = useQueryClient();
const apiKey = useApiKey();
Function InitTelemetry
has 128 lines of code (exceeds 50 allowed). Consider refactoring. Open
func InitTelemetry(addr string, svcName, imName string) (func(), error) {
instrumentationName = imName
var prop propagation.TextMapPropagator
prop = propagation.TraceContext{}
Function Authdialog
has 103 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const Authdialog = () => {
const { t } = useTranslation();
const [showKey, setShowKey] = useState(false);
const { setApiKey: storeApiKey } = useApiActions();
const apiKeyFromLocalStorage = useApiKey();
Function InitPubSub
has a Cognitive Complexity of 43 (exceeds 20 allowed). Consider refactoring. Open
func InitPubSub(notifier Notifier, database string) (*Pubsub, error) {
reportProblem := func(ev pq.ListenerEventType, err error) {
if err != nil {
slog.Error("PubSub listener encountered an error.", "error", err, "event_type", ev)
os.Exit(1)
- 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
Function NamespaceEdit
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
const NamespaceEdit = ({
mirror,
close,
}: {
mirror?: MirrorInfoSchemaType;
- 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
Function ExplorerPage
has 102 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ExplorerPage: FC = () => {
const namespace = useNamespace();
const { path } = pages.explorer.useParams();
const { data, isSuccess, isFetched, isAllowed, noPermissionMessage } =
useFile({
File index.spec.ts
has 333 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { createNamespace, deleteNamespace } from "../../utils/namespace";
import { expect, test } from "@playwright/test";
import {
parentWorkflow as parentWorkflowContent,
simpleWorkflow as simpleWorkflowContent,