Showing 407 of 1,235 total issues
Method parallelLogic.processActionResults
has 120 lines of code (exceeds 50 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
Method engine.NewInstance
has 119 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (engine *engine) NewInstance(ctx context.Context, args *newInstanceArgs) (*instanceMemory, error) {
ctx = tracing.AddInstanceAttr(ctx, tracing.InstanceAttributes{
Namespace: args.Namespace.Name,
InstanceID: args.ID.String(),
Invoker: args.Invoker,
File index.tsx
has 323 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { Plus, X } from "lucide-react";
import { Popover, PopoverContent, PopoverTrigger } from "~/design/Popover";
import Button from "~/design/Button";
import { ButtonBar } from "~/design/ButtonBar";
Function InstancesListPage
has 93 lines of code (exceeds 25 allowed). Consider refactoring. Open
const InstancesListPage = () => {
const [offset, setOffset] = useState(0);
const [filters, setFilters] = useState<FiltersObj>({});
const { t } = useTranslation();
const { data, isSuccess, isAllowed, noPermissionMessage } = useInstances({
Function Instances
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const Instances = () => {
const {
data: dataSuccessfulInstances,
isFetched: isFetchedSuccessfulInstances,
isAllowed: isAllowedSuccessfulInstances,
File logs.spec.ts
has 316 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { createNamespace, deleteNamespace } from "../../utils/namespace";
import { expect, test } from "@playwright/test";
import {
workflowWithFewLogs as fewLogsWorkflowContent,
workflowWithManyLogs as manyLogsWorkflowContent,
File index.spec.ts
has 316 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {
PatchOperationType,
PatchOperations,
PatchSchemaType,
} from "~/pages/namespace/Explorer/Service/ServiceEditor/schema";
Method setterLogic.Run
has a Cognitive Complexity of 40 (exceeds 20 allowed). Consider refactoring. Open
func (logic *setterLogic) Run(ctx context.Context, wakedata []byte) (*Transition, error) {
err := scheduleOnce(logic, wakedata)
if err != nil {
return nil, err
}
- 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 describePagination
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
const describePagination = ({
pages,
currentPage: current,
neighbours = 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 RunWorkflow
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
const RunWorkflow = ({ path }: { path: string }) => {
const pages = usePages();
const { toast } = useToast();
const { t } = useTranslation();
const theme = useTheme();
- 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 Header
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Header = () => {
const pages = usePages();
const instanceId = useInstanceId();
const { data: instance } = useInstanceDetails({ instanceId });
const { mutate: cancelInstance, isPending } = useCancelInstance();
Function TimePickerInput
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
(
{
className,
type = "tel",
value,
- 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.stories.tsx
has 308 lines of code (exceeds 250 allowed). Consider refactoring. Open
import Button from "../Button";
import { ButtonBar } from "../ButtonBar";
import { Card } from "../Card";
import { Orientation } from "./types";
import WorkflowDiagram from "./index";
Method engine.runState
has 109 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (engine *engine) runState(ctx context.Context, im *instanceMemory, wakedata []byte, err error) *states.Transition {
ctx = tracing.AddNamespace(ctx, im.Namespace().Name)
ctx = tracing.WithTrack(ctx, tracing.BuildInstanceTrack(im.instance))
ctx, cleanup, err3 := tracing.NewSpan(ctx, "preparing instance for state execution")
if err != nil {
File index.spec.ts
has 305 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,
Method forEachLogic.processActionResults
has a Cognitive Complexity of 38 (exceeds 20 allowed). Consider refactoring. 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
Function TokensPage
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
const TokensPage = () => {
const { t } = useTranslation();
const { data, isFetched, isAllowed, noPermissionMessage } = useTokens();
const noResults = isFetched && data?.tokens.length === 0;
const [dialogOpen, setDialogOpen] = useState(false);
Function ZoomPanDiagram
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function ZoomPanDiagram(props: ZoomPanDiagramProps) {
const { elements, disabled, orientation } = props;
const { fitView, zoomIn, zoomOut } = useReactFlow();
const [showMinimap, setShowMinimap] = useState(true);
const nodesInitialized = useNodesInitialized();
Method forEachLogic.processActionResults
has 105 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (logic *forEachLogic) processActionResults(ctx context.Context, children []*ChildInfo, results *actionResultPayload) (*Transition, error) {
var err error
var found bool
var idx int
File temporary.go
has 550 lines of code (exceeds 500 allowed). Consider refactoring. Open
package flow
import (
"context"
"encoding/json"