Showing 407 of 1,235 total issues
Method instController.list
has 105 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (e *instController) list(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
ns := extractContextNamespace(r)
pagination, err := e.getPagination(r)
Method nsController.update
has 105 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (e *nsController) update(w http.ResponseWriter, r *http.Request) {
name := chi.URLParam(r, "name")
db, err := e.db.BeginTx(r.Context())
if err != nil {
Function Header
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Header = () => {
const pages = usePages();
const namespace = useNamespace();
const { routePath } = pages.gateway.useParams();
const { data: route } = useRoute({
Function buildRouter
has 101 lines of code (exceeds 50 allowed). Consider refactoring. Open
func buildRouter(endpoints []core.Endpoint, consumers []core.Consumer) *router {
serveMux := http.NewServeMux()
checkUniqueGatewayPaths := map[string]string{}
Method fsController.updateFile
has 100 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (e *fsController) updateFile(w http.ResponseWriter, r *http.Request) {
ns := extractContextNamespace(r)
db, err := e.db.BeginTx(r.Context())
if err != nil {
Function initLegacyServer
has 99 lines of code (exceeds 50 allowed). Consider refactoring. Open
func initLegacyServer(circuit *core.Circuit, config *core.Config, db *gorm.DB, dbManager *database.SQLStore) (*server, error) {
srv := new(server)
srv.ID = uuid.New()
srv.initJQ()
srv.config = config
Function recurseIntoString
has 95 lines of code (exceeds 50 allowed). Consider refactoring. Open
func recurseIntoString(data interface{}, s string) ([]interface{}, error) {
out := make([]interface{}, 0)
if TrimWhitespaceOnQueryStrings {
s = strings.TrimSpace(s)
Function Default
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const Default = () => {
const [pageSize, setPageSize] = useState(3);
return (
<div
className="flex flex-col items-center space-y-5 p-5
Method instanceMemory.GetVariables
has a Cognitive Complexity of 35 (exceeds 20 allowed). Consider refactoring. Open
func (im *instanceMemory) GetVariables(ctx context.Context, vars []states.VariableSelector) ([]states.Variable, error) {
x := make([]states.Variable, 0)
tx, err := im.engine.flow.beginSQLTx(ctx)
if err != 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
Method jxController.handler
has 92 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (c *jxController) handler(w http.ResponseWriter, r *http.Request) {
data, err := io.ReadAll(r.Body)
if err != nil {
return
}
Function SendEvent
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
const SendEvent = () => {
const [body, setBody] = useState<string | undefined>(exampleEvent);
const [isOpen, setIsOpen] = useState(false);
const theme = useTheme();
const { t } = useTranslation();
Function PermissionsPage
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
const PermissionsPage = () => {
const pages = usePages();
const permissions = pages.permissions;
const namespace = useNamespace();
File codeEditor.spec.ts
has 276 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { createNamespace, deleteNamespace } from "../../utils/namespace";
import { expect, test } from "@playwright/test";
import { createWorkflow } from "../../utils/workflow";
import { faker } from "@faker-js/faker";
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
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 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
}
Method engine.doKnativeHTTPRequest
has 88 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (engine *engine) doKnativeHTTPRequest(ctx context.Context,
ar *functionRequest, arReq *enginerefactor.ActionRequest,
) {
ctx, spanEnd, err := tracing.NewSpan(ctx, "executing knative request to action")
if err != 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 index.tsx
has 268 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";
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";