JavaScript Logic Analysis
Static analysis for the logical quality of JavaScript code — not just coding style.
LogicScope JS reads your code through the Abstract Syntax Tree (AST), detects 31 logic-error and complexity patterns, and summarizes them into a single 0–100 quality score you can monitor as you type.
Every finding tells you not just what is wrong, but also why it's a problem and how to fix it.
No additional configuration is required.
Usage
1. Open a JavaScript file
File with .js or .jsx extension.
2. Click the JavaScript Logic Analysis icon in the Activity Bar
The magnifying glass icon on the left side of the screen.
3. Press the ANALYSIS CORRECTION button
The panel will display the quality score along with all findings.
4. Explore the findings
Click the Ln 12, Col 5 text on any finding to jump to its location in the editor.
5. Apply fixes
Check the fixes you want, then press REPAIR CODE. The score updates instantly.
After step three, analysis runs automatically every time you type. No need to press the button again.
Understanding the Analysis Panel
┌────────────────────────────────┐
│ example.js 10:42:31 │ ← file name & analysis time
│ │
│ 49 /100 · Poor │ ← logic quality score
│ ▓▓▓▓▓▓▓▓▓░░░░░░░░░░ │
│ │
│ 4 2 3 │
│ Error Warning Suggestion │ ← severity summary
│ │
│ FINDINGS (9) │
│ ┌────────────────────────────┐ │
│ │ ☑ Select all (6) │ │ ← bulk fix selection
│ │ [✔ Safe only] [Clear] │ │
│ └────────────────────────────┘ │
│ │
│ ☑ ❌ LS001 · constant-condition│
│ Condition is always true...│ ← ISSUE
│ Ln 8, Col 3 [Logic] │
│ The condition expression... │ ← CAUSE
│ 💡 Replace with a proper... │ ← SUGGESTION
│ ✔ Safe to apply automatically│
│ ┌──────────────────────┐ │
│ │ total = total + 1000;│ │ ← FIX PREVIEW
│ └──────────────────────┘ │
│ │
│ ───────────────────────────── │
│ 🔍 ANALYSIS CORRECTION │
│ 🔧 REPAIR CODE (3) │
│ ● LIVE 3 selected · safe │
└────────────────────────────────┘
Understanding the Quality Score
The score starts at 100 and is reduced based on the findings detected:
Penalty = (Error × 10) + (Warning × 4) + (Suggestion × 1)
Score = 100 − Penalty (minimum 0)
| Score |
Rating |
Meaning |
| 90–100 |
Excellent |
Almost no logic issues |
| 75–89 |
Good |
A few minor things to clean up |
| 60–74 |
Fair |
Some issues should be addressed |
| 40–59 |
Poor |
Several logic errors need fixing |
| 0–39 |
Needs Refactor |
Serious logic quality problems |
Weights reflect certainty, not impact size. Error findings are almost certainly bugs, while Suggestion findings are better practices.
Three Types of Fixes
This is LogicScope JS's key differentiator. Not all fixes are equally safe, so every proposed fix is given a risk classification:
| Display |
Classification |
Meaning |
| ☑ |
Safe |
Does not change program behavior. Checked automatically. |
| ☐ |
Suggested |
The fix is correct, but changes behavior or may mask the original bug. Requires your review. |
| (no checkbox) |
Manual |
The fix requires a design decision that cannot be inferred automatically. |
Example of a Suggested classification: changing == to === is technically correct, but may change comparison results if the old code relied on type coercion. It is therefore not applied without your approval.
Example of a Manual classification: in if (a.stock === a.stock), LogicScope JS knows this comparison always evaluates to true — but doesn't know which operand was meant to be different. Only you know that.
Real-Time Analysis
After the first analysis run, LogicScope JS automatically monitors code changes.
- A pulsing green indicator on the panel and status bar shows this mode is active
- Analysis runs 500 ms after you stop typing, not on every keystroke
- Click the status bar indicator to turn it on or off
If you're working on a very large file and performance feels sluggish, turn off this mode or increase the delay value in settings.
Commands
Accessible via the Command Palette (Ctrl+Shift+P):
| Command |
Function |
JavaScript Logic Analysis: Analyze Code |
Runs analysis on the active file |
JavaScript Logic Analysis: Repair Code (safe fixes) |
Applies all fixes classified as safe |
JavaScript Logic Analysis: Toggle Real-time Analysis |
Toggles automatic monitoring mode |
JavaScript Logic Analysis: Show Full Report |
Opens the full text report in the Output Channel |
Fixes are also available via Quick Fix — place your cursor on the problematic line and press Ctrl+.
Settings
| Setting |
Default |
Description |
logicscope-js.liveAnalysis |
true |
Automatic analysis when code changes |
logicscope-js.analysisDelay |
500 |
Delay before analysis runs (milliseconds, 100–5000) |
logicscope-js.analyzeOnOpen |
true |
Automatic analysis when a file is opened |
License
MIT — see the LICENSE file.