Showing 463 of 1,333 total issues
Function generateElements
has a Cognitive Complexity of 145 (exceeds 5 allowed). Consider refactoring. Open
export function generateElements(
getLayoutedElements: (
incomingEles: (Node | Edge)[],
orientation: Orientation
) => (Node | Edge)[],
- 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 flow.go
has 1224 lines of code (exceeds 500 allowed). Consider refactoring. Open
package api
import (
"bytes"
"context"
File languageSamples.ts
has 861 lines of code (exceeds 250 allowed). Consider refactoring. Open
export const HtmlSample = `
<!DOCTYPE HTML>
<!--Example of comments in HTML-->
<html>
<head>
Method node.findRoute
has a Cognitive Complexity of 103 (exceeds 20 allowed). Consider refactoring. Open
func (n *node) findRoute(rctx *Context, method methodTyp, path string) *node {
nn := n
search := path
for t, nds := range nn.children {
- 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 pages.tsx
has 677 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {
ActivitySquare,
BadgeCheck,
Boxes,
FolderTree,
File run.spec.ts
has 619 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { createNamespace, deleteNamespace } from "../../utils/namespace";
import { expect, test } from "@playwright/test";
import {
jsonSchemaFormWorkflow,
jsonSchemaWithRequiredEnum,
Method flowHandler.WaitWorkflow
has a Cognitive Complexity of 77 (exceeds 20 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"]
- 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 MoreDetailedShell
has 236 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const MoreDetailedShell = () => {
const [theme, setTheme] = useState<"light" | "dark" | undefined>();
useEffect(() => {
const html = document.documentElement;
File index.spec.ts
has 542 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {
checkIfNamespaceExists,
createNamespace,
createNamespaceName,
deleteNamespace,
File engine.go
has 788 lines of code (exceeds 500 allowed). Consider refactoring. Open
package flow
import (
"context"
"encoding/base64"
Function generateElements
has 184 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function generateElements(
getLayoutedElements: (
incomingEles: (Node | Edge)[],
orientation: Orientation
) => (Node | Edge)[],
Function SecretsList
has 183 lines of code (exceeds 25 allowed). Consider refactoring. Open
const SecretsList: FC = () => {
const { t } = useTranslation();
const [dialogOpen, setDialogOpen] = useState(false);
const [deleteSecret, setDeleteSecret] = useState<SecretSchemaType>();
const [editItem, setEditItem] = useState<SecretSchemaType>();
File index.stories.tsx
has 462 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {
Box,
Bug,
Calendar,
ChevronsUpDown,
Pubsub
has 50 methods (exceeds 20 allowed). Consider refactoring. Open
type Pubsub struct {
id uuid.UUID
notifier Notifier
handlers map[string]func(*PubsubUpdate)
Function VariablesList
has 165 lines of code (exceeds 25 allowed). Consider refactoring. Open
const VariablesList: FC = () => {
const { t } = useTranslation();
const [dialogOpen, setDialogOpen] = useState(false);
const [deleteItem, setDeleteItem] = useState<VarSchemaType>();
const [editItem, setEditItem] = useState<VarSchemaType>();
File index.tsx
has 435 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {
DialogClose,
DialogFooter,
DialogHeader,
DialogTitle,
Function JqPlaygroundPage
has 155 lines of code (exceeds 25 allowed). Consider refactoring. Open
const JqPlaygroundPage: FC = () => {
const { t } = useTranslation();
const theme = useTheme();
const {
setInput: storeInputInLocalstorage,
File apiFactory.test.ts
has 414 lines of code (exceeds 250 allowed). Consider refactoring. Open
import "cross-fetch/polyfill";
import { ResponseParser, apiFactory } from "../apiFactory";
import {
afterAll,
Function Header
has 148 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Header: FC = () => {
const { t } = useTranslation();
const {
path,
isWorkflowEditorPage,
Method engine.runState
has a Cognitive Complexity of 54 (exceeds 20 allowed). Consider refactoring. 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)...)
- 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"