VS Code extension that finds contradictory conditions across your codebase
Ever spent 3 hours debugging only to realize your auth check was backwards in one file? Yeah, me too.
This VS Code extension hunts down those sneaky logic contradictions that hide across your codebase. The bugs that compile fine, pass tests, and then blow up in production because isAdmin and !isAdmin both call deleteUser() in different files.
You write this in auth.js:
if (user.role === "admin") {
allowDelete();
}Three months later, someone copies it to legacy.js and flips the condition:
if (user.role !== "admin") {
allowDelete(); // wait what
}Both conditions lead to the same outcome. That's not just wrong - it's dangerous because it looks intentional. This extension flags it in your problems panel before you ship it.
Another classic:
// utils.js
if (isLoggedIn) return showDashboard();
// somewhere-else.js
if (!isLoggedIn) return showDashboard(); // how does this even work- Scans your whole workspace for
ifstatements, ternaries, switches - Finds conditions that contradict each other across files
- Drops warnings right in the VS Code problems panel
- Click through to see where the conflict lives
- Incremental scans on save (fast, doesn't hog CPU)
- Caches results so re-scans are instant
Install it:
# Clone it
git clone https://github.com/AryzXploit/Logic-Collision-Detector
cd Logic-Collision-Detector
# Install & build
npm install
npm run compile
# Package for VS Code
npm run packageThen in VS Code: Extensions → "..." → Install from VSIX → pick the .vsix file.
Or just run it: Open this folder in VS Code, hit F5, and a new window opens with the extension loaded. Open any JS/TS project and run "Scan Workspace for Logic Collisions" from the command palette.
Command Palette (Ctrl+Shift+P):
Logic Collision Detector: Scan Workspace- full scanLogic Collision Detector: Clear All Diagnostics- wipe the warnings
Settings (.vscode/settings.json):
{
"logicCollision.include": ["**/*.ts", "**/*.js"],
"logicCollision.exclude": ["**/node_modules/**", "**/dist/**"],
"logicCollision.enableOnChange": true
}| Setting | What it does |
|---|---|
include |
Which files to scan (default: js,ts,jsx,tsx) |
exclude |
What to skip (node_modules, build dirs, etc) |
enableOnChange |
Auto-scan when you save a file |
maxFileSize |
Skip files bigger than this (default 1MB) |
- Parses your code with the TypeScript compiler API
- Normalizes conditions - so
a === bandb === aare seen as the same thing - Indexes by condition, negated condition, and what the code actually does
- Detects two patterns:
- Opposite conditions → same outcome (bug alert)
- Same condition → opposite outcomes (inconsistency warning)
It handles double negations, flipped comparisons, and all the ways developers write the same logic differently.
This won't catch everything. Nested ternaries that make you cry? Probably not. Logic built with eval()? Nope. Files over 1MB get skipped because life is too short.
But for the 90% case - finding that one backwards if statement that somehow made it through code review - this thing pays for itself in one bug caught.
- VS Code 1.74+
- Node 16+ (if you're hacking on it)
MIT - do whatever, just don't blame me when you find out your entire auth system is backwards.