Showing 407 of 1,235 total issues
Function Header
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const Header = ({ serviceId }: { serviceId: string }) => {
const pages = usePages();
const { data: service, refetch, isFetching } = useService(serviceId);
const { t } = useTranslation();
- 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 ServicesTableRow
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
}> = ({ service, setRebuildService }) => {
const pages = usePages();
const namespace = useNamespace();
const navigate = useNavigate();
const { t } = useTranslation();
- 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 MirrorDetail
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const MirrorDetail = () => {
const { data, isAllowed, noPermissionMessage, isFetched } = useListSyncs();
const namespace = useNamespace();
const namespaceDetail = useNamespaceDetail();
- 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 EndpointPage
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const EndpointPage: FC = () => {
const pages = usePages();
const { path } = pages.explorer.useParams();
const namespace = useNamespace();
const { segments } = analyzePath(path);
- 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 JqPlaygroundPage
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const JqPlaygroundPage: FC = () => {
const { t } = useTranslation();
const theme = useTheme();
const {
setData: storePlaygroundDataInLocalstorage,
- 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 uploader.createFileItem
has 6 return statements (exceeds 4 allowed). Open
func (u *uploader) createFileItem(path, method string, obj fileObject) error {
parent := path
parent = strings.ReplaceAll(parent, "\\", "/")
if method == "POST" {
Function fetchSecret
has 6 return statements (exceeds 4 allowed). Open
func fetchSecret(db *database.SQLStore, namespace string, callExpression string) (string, error) {
callExpression = strings.TrimSpace(callExpression)
if !strings.HasPrefix(callExpression, "fetchSecret") {
return callExpression, nil
}
Method forEachLogic.scheduleRetryAction
has 6 return statements (exceeds 4 allowed). Open
func (logic *forEachLogic) scheduleRetryAction(ctx context.Context, retry *actionRetryInfo) error {
logic.Log(ctx, log.Info, "Retrying...")
x, err := jqOne(logic.GetInstanceData(), logic.Array) //nolint:contextcheck
if err != nil {
Method forEachLogic.scheduleFirstActions
has 6 return statements (exceeds 4 allowed). Open
func (logic *forEachLogic) scheduleFirstActions(ctx context.Context) (*Transition, error) {
x, err := jqOne(logic.GetInstanceData(), logic.Array) //nolint:contextcheck
if err != nil {
return nil, err
}
Method forEachLogic.scheduleAction
has 6 return statements (exceeds 4 allowed). Open
func (logic *forEachLogic) scheduleAction(ctx context.Context, inputSource interface{}, attempt, iterator int) (*ChildInfo, error) {
action := logic.Action
input, files, err := generateActionInput(ctx, &generateActionInputArgs{
Instance: logic.Instance,
Method parallelLogic.scheduleAction
has 6 return statements (exceeds 4 allowed). Open
func (logic *parallelLogic) scheduleAction(ctx context.Context, action *model.ActionDefinition, attempt int) (*ChildInfo, error) {
input, files, err := generateActionInput(ctx, &generateActionInputArgs{
Instance: logic.Instance,
Source: logic.GetInstanceData(),
Action: action,
Method DirektivApplyer.copyFilesIntoRoot
has 6 return statements (exceeds 4 allowed). Open
func (o *DirektivApplyer) copyFilesIntoRoot(ctx context.Context) error {
paths, err := o.parser.ListFiles()
if err != nil {
return err
}
Method instanceMemory.flushUpdates
has 6 return statements (exceeds 4 allowed). Open
func (im *instanceMemory) flushUpdates(ctx context.Context) error {
data, err := json.Marshal(im.updateArgs)
if err != nil {
panic(err)
}
Method engine.EventsInvoke
has 6 return statements (exceeds 4 allowed). Open
func (engine *engine) EventsInvoke(tctx context.Context, workflowID uuid.UUID, events ...*cloudevents.Event) {
ctx := context.Background()
tx, err := engine.flow.beginSQLTx(ctx)
if err != nil {
Method ACLPlugin.Execute
has 6 return statements (exceeds 4 allowed). Open
func (acl *ACLPlugin) Execute(w http.ResponseWriter, r *http.Request) *http.Request {
c := gateway.ExtractContextActiveConsumer(r)
if c == nil {
gateway.WriteInternalError(r, w, nil, "missing consumer")
return nil
Function getVariableMetaFromFlow
has 6 return statements (exceeds 4 allowed). Open
func getVariableMetaFromFlow(ctx context.Context, flowToken string, flowAddr string, ir *functionRequest, scope, key string) (variable, int, error) {
var varResp *variablesResponse
var err error
var typ string
statusCode := http.StatusOK
Method JSInboundPlugin.Execute
has 6 return statements (exceeds 4 allowed). Open
func (js *JSInboundPlugin) Execute(w http.ResponseWriter, r *http.Request) *http.Request {
var (
err error
b []byte
)
Method instanceDataQuery.PopMessage
has 6 return statements (exceeds 4 allowed). Open
func (q *instanceDataQuery) PopMessage(ctx context.Context) (*instancestore.InstanceMessageData, error) {
columns := []string{fieldInstanceMessageID, fieldInstanceMessageInstanceID, fieldInstanceMessageCreatedAt, fieldInstanceMessagePayload}
query := fmt.Sprintf(`SELECT %s FROM %s WHERE %s = ? ORDER BY %s ASC LIMIT 1`, strings.Join(columns, ", "), messagesTable, fieldInstanceMessageInstanceID, fieldInstanceMessageCreatedAt)
msg := &instancestore.InstanceMessageData{}
Method actionLogic.processActionResults
has 6 return statements (exceeds 4 allowed). Open
func (logic *actionLogic) processActionResults(ctx context.Context, children []*ChildInfo, results *actionResultPayload) (*Transition, error) {
var err error
sd := children[0]
Method GenerateEventState.Validate
has 6 return statements (exceeds 4 allowed). Open
func (o *GenerateEventState) Validate() error {
if err := o.commonValidate(); err != nil {
return err
}