Showing 407 of 1,235 total issues
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 Layout
has 131 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Layout = () => {
const pages = usePages();
const { t } = useTranslation();
const { usesAccounts } = useApiKeyHandling();
const {
Function Initialize
has 153 lines of code (exceeds 50 allowed). Consider refactoring. Open
func Initialize(app core.App, db *database.SQLStore, bus *pubsub2.Bus, instanceManager *instancestore.InstanceManager, wakeByEvents events.WakeEventsWaiter, startByEvents events.WorkflowStart, circuit *core.Circuit) error {
funcCtr := &serviceController{
manager: app.ServiceManager,
}
fsCtr := &fsController{
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 ExplorerPage
has 119 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ExplorerPage: FC = () => {
const pages = usePages();
const namespace = useNamespace();
const { path } = pages.explorer.useParams();
const { data, isSuccess, isFetched, isAllowed, noPermissionMessage } =
Function ChildInstances
has 117 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ChildInstances = () => {
const pages = usePages();
const instanceId = useInstanceId();
const namespace = useNamespace();
const [popoverOpen, setPopoverOpen] = useState(false);
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
File instances.go
has 601 lines of code (exceeds 500 allowed). Consider refactoring. Open
package api
import (
"bytes"
"context"
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:
File list.spec.ts
has 346 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { createFile, deleteFile } from "e2e/utils/files";
import {
createHttpServiceFile,
findServiceWithApiRequest,
serviceWithAnError,
Function NamespaceEdit
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
const NamespaceEdit = ({
mirror,
close,
}: {
mirror?: MirrorSchemaType;
- 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 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 MirrorDetail
has 103 lines of code (exceeds 25 allowed). Consider refactoring. Open
const MirrorDetail = () => {
const { data, isAllowed, noPermissionMessage, isFetched } = useListSyncs();
const namespace = useNamespace();
const namespaceDetail = useNamespaceDetail();
File index.spec.ts
has 337 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { createNamespace, deleteNamespace } from "e2e/utils/namespace";
import { expect, test } from "@playwright/test";
import {
expectedSnippetOutput,
getCommonElements,
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)
- 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 LogsPanel
has 102 lines of code (exceeds 25 allowed). Consider refactoring. Open
const LogsPanel = () => {
const { t } = useTranslation();
const { setVerboseLogs, setMaximizedPanel } = useLogsPreferencesActions();
const instanceId = useInstanceId();
File index.spec.ts
has 332 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,
Function checkInstanceRender
has 98 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 GroupsPage
has 96 lines of code (exceeds 25 allowed). Consider refactoring. Open
const GroupsPage = () => {
const { t } = useTranslation();
const { data, isFetched, isAllowed, noPermissionMessage } = useGroups();
const noResults = isFetched && data?.groups.length === 0;
const [dialogOpen, setDialogOpen] = useState(false);