Showing 463 of 1,333 total issues
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);
Function LogsPanel
has 96 lines of code (exceeds 25 allowed). Consider refactoring. Open
const LogsPanel = () => {
const { t } = useTranslation();
const { setVerboseLogs, setMaximizedPanel } = useLogsPreferencesActions();
const instanceId = useInstanceId();
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
Function NamespaceSelector
has 94 lines of code (exceeds 25 allowed). Consider refactoring. Open
const NamespaceSelector = () => {
const { t } = useTranslation();
const namespace = useNamespace();
const {
data: availableNamespaces,
Function ToGRPCCloudEvents
has a Cognitive Complexity of 41 (exceeds 20 allowed). Consider refactoring. Open
func ToGRPCCloudEvents(r *http.Request) ([]cloudevents.Event, error) {
var events []cloudevents.Event
ct := r.Header.Get("Content-type")
oct := ct
- 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 engine.NewInstance
has 118 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (engine *engine) NewInstance(ctx context.Context, args *newInstanceArgs) (*instanceMemory, error) {
slog.Debug("Initializing new instance creation.", "namespace", args.Namespace.Name, "workflow", args.CalledAs, "invoker", args.Invoker)
file, data, err := engine.mux(ctx, args.Namespace, args.CalledAs)
loggingCtx := args.Namespace.WithTags(ctx)
loggingCtx = enginerefactor.AddTag(loggingCtx, "calledAs", args.CalledAs)
Function InstancesListPage
has 91 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, isFetched, isAllowed, noPermissionMessage } = useInstances({
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 { toast } = useToast();
const { t } = useTranslation();
const theme = useTheme();
const navigate = useNavigate();
- 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 314 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {
PatchOperationType,
PatchOperations,
PatchSchemaType,
} from "~/pages/namespace/Explorer/Service/ServiceEditor/schema";
File grpc-instances.go
has 561 lines of code (exceeds 500 allowed). Consider refactoring. Open
package flow
import (
"context"
"log/slog"
Method gatewayManager.ServeHTTP
has 111 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (ep *gatewayManager) ServeHTTP(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
span := trace.SpanFromContext(ctx)
defer span.End()
spanContext := span.SpanContext()
File index.tsx
has 310 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 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
Function Header
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Header = () => {
const instanceId = useInstanceId();
const { data } = useInstanceDetails({ instanceId });
const { mutate: cancelInstance } = useCancelInstance();
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";
File list.spec.ts
has 308 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {
createHttpServiceFile,
findServiceWithApiRequest,
serviceWithAnError,
} from "./utils";
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();
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);