Showing 467 of 1,322 total issues
Function PermissionsPage
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
const PermissionsPage = () => {
const permissions = pages.permissions;
const namespace = useNamespace();
const { t } = useTranslation();
Method instanceMemory.SetVariables
has a Cognitive Complexity of 34 (exceeds 20 allowed). Consider refactoring. Open
func (im *instanceMemory) SetVariables(ctx context.Context, vars []states.VariableSetter) error {
tx, err := im.engine.flow.beginSQLTx(ctx)
if err != nil {
return 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 GetLogs
has a Cognitive Complexity of 34 (exceeds 20 allowed). Consider refactoring. Open
func GetLogs(cmd *cobra.Command, instance string, query string) (urlOutput string) {
instanceStatus := "pending"
urlLogs := fmt.Sprintf("%s/logs?instance=%s&%s", UrlPrefixV2, instance, query)
clientLogs := sse.NewClient(urlLogs)
- 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 getterLogic.Run
has a Cognitive Complexity of 34 (exceeds 20 allowed). Consider refactoring. Open
func (logic *getterLogic) 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 generateGetInstancesFilters
has 89 lines of code (exceeds 50 allowed). Consider refactoring. Open
func generateGetInstancesFilters(opts *instancestore.ListOpts) ([]string, []interface{}, error) {
if opts == nil {
return []string{}, []interface{}{}, nil
}
Function Layout
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Layout = () => {
const { data: version } = useVersion();
const namespace = useNamespace();
const { setNamespace } = useNamespaceActions();
const { namespace: namespaceFromUrl } = useParams();
File temporary.go
has 516 lines of code (exceeds 500 allowed). Consider refactoring. Open
package flow
import (
"context"
"encoding/json"
instanceMemory
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
type instanceMemory struct {
engine *engine
data interface{}
memory interface{}
engine
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
type engine struct {
*server
scheduled sync.Map
}
File logs.ts
has 263 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { createNamespace, deleteNamespace } from "../../utils/namespace";
import {
workflowWithDelay as delayedWorkflowContent,
workflowWithFewLogs as fewLogsWorkflowContent,
workflowWithManyLogs as manyLogsWorkflowContent,
File index.spec.ts
has 263 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { createNamespace, deleteNamespace } from "../utils/namespace";
import { expect, test } from "@playwright/test";
import { createRegistries } from "../utils/registries";
import { createSecrets } from "../utils/secrets";
Function executeEvent
has a Cognitive Complexity of 32 (exceeds 20 allowed). Consider refactoring. Open
func executeEvent(cmd *cobra.Command, url string, args []string) (string, error) {
event := cloudevents.NewEvent()
// read event file in if provided
if len(args) > 0 {
- 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 JqState
has a Cognitive Complexity of 32 (exceeds 20 allowed). Consider refactoring. Open
func JqState(l *lexer.L) lexer.StateFunc {
src := make([]string, 3)
var jdxJ int
mover := func(rewind int, forward bool) {
- 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 getterLogic.Run
has 81 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (logic *getterLogic) Run(ctx context.Context, wakedata []byte) (*Transition, error) {
err := scheduleOnce(logic, wakedata)
if err != nil {
return nil, err
}
Function ConsumerTable
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ConsumerTable = () => {
const { t } = useTranslation();
const {
data: consumerList,
isSuccess,
Method instController.getPagination
has 81 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (e *instController) getPagination(r *http.Request) (*paginationOptions, error) {
opts := new(paginationOptions)
x := r.URL.Query().Get("limit")
if x != "" {
Function EndpointPage
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
const EndpointPage: FC = () => {
const { path } = pages.explorer.useParams();
const namespace = useNamespace();
const { segments } = analyzePath(path);
const filename = segments[segments.length - 1];
Function ServicesListPage
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ServicesListPage = () => {
const { t } = useTranslation();
const {
data: serviceList,
isFetching,
Function generateActionInput
has 80 lines of code (exceeds 50 allowed). Consider refactoring. Open
func generateActionInput(ctx context.Context, args *generateActionInputArgs) ([]byte, []model.FunctionFileDefinition, error) {
var err error
var input interface{}
input, err = jqObject(args.Source, "jq(.)") //nolint:contextcheck
File local-server.go
has 507 lines of code (exceeds 500 allowed). Consider refactoring. Open
package sidecar
import (
"bytes"
"context"