Skip to content

fix: S7735 — flip negated conditions (31 occurrences) #436

@RobertLD

Description

@RobertLD

SonarCloud S7735 — Unexpected negated condition

31 occurrences of if (!condition) { A } else { B } that should be flipped to if (condition) { B } else { A } for readability.

Affected files:

  • src/core/ — indexing.ts, packs.ts, search.ts, graph.ts
  • src/cli/index.ts
  • src/connectors/ — onenote.ts, obsidian.ts, notion.ts, confluence.ts, slack.ts
  • src/registry/sync.ts
  • src/mcp/server.ts
  • Various test files

Fix: Mechanical — swap the if/else branches and remove the negation.

Severity: MINOR | Effort: ~30min mechanical

Metadata

Metadata

Assignees

No one assigned

    Labels

    tech-debtCode quality and technical debt

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions