check-code-quality
You are performing static code quality analysis on the Scopy package: `$ARGUMENTS`
You are validating the JavaScript unit test scripts for the Scopy plugin: `$ARGUMENTS`
> /plugin marketplace add analogdevicesinc/scopy > /plugin install scopy_dev_plugin@scopy-plugins
How it fires
How this command gets triggered: by you, by Claude, or both.
/validate-unit-testsContext preview
What this command does when you run it.
You are validating the JavaScript unit test scripts for the Scopy plugin: `$ARGUMENTS`
You are validating the JavaScript unit test scripts for the Scopy plugin: `$ARGUMENTS`
The `unit-test-quality-checks` skill rules (checks U1–U7) govern this analysis.
Use the Glob tool to locate:
If no JS unit test files are found, report "No unit test files found for `$ARGUMENTS`" and stop.
Read **all** discovered files before starting analysis.
From the source files, build the complete set of testable widgets and API methods:
1. **From widget factory sources**: Extract all IIOWidgetBuilder calls to get widget keys and their types (EditableUi → range, ComboUi → combo, CheckBoxUi → checkbox, read-only patterns) 2. **From API header**: Extract all `Q_INVOKABLE` getter/setter pairs and standalone getters 3. **From EMU XML**: Extract device name prefix, channel structure, attribute names
This is the "expected" set — every item should have at least one test.
From the JS unit test files, extract:
1. **Widget keys tested**: All keys passed to `readWidget()`, `writeWidget()`, `testRange()`, `testCombo()`, `testCheckbox()`, `testReadOnly()`, `testConversion()`, `testBadValueRange()`, `testBadValueCombo()`, and `runDataDrivenTests()` calls 2. **API methods exercised**: All `<apiObject>.<method>()` calls 3. **Test UIDs**: All `TestFramework.runTest("<UID>", ...)` UIDs
**[U1] Widget Coverage**
**[U2] Helper Function Usage**
**[U3] Sleep After Setters**
**[U4] State Restoration**
**[U5] Bad Value Tests**
**[U6] Complex Test Isolation**
**[U7] File Structure**
## Unit Test Validation Report: $ARGUMENTS ### Summary | Check | Severity | Result | |-------|----------|--------| | [U1] Widget Coverage | CRITICAL | PASS/FAIL | | [U2] Helper Function Usage | CRITICAL | PASS/FAIL | | [U3] Sleep After Setters | CRITICAL | PASS/FAIL | | [U4] State Restoration | CRITICAL | PASS/FAIL | | [U5] Bad Value Tests | WARNING | PASS/WARN | | [U6] Complex Test Isolation | WARNING | PASS/WARN | | [U7] File Structure | INFO | PASS/INFO | ### Critical Issues **[U1] Missing widget coverage** `voltage0_in/rf_bandwidth` — no test found in any unit test file. > **Fix:** Add a testReadOnly() call for this widget. **[U3] Missing sleep after setter** `ad9371_Basic_Unit_test.js:142` — `writeWidget()` not followed by `msleep(500)`. > **Fix:** Add `msleep(500);` on the next line. ### Warnings **[U5] Bad value test coverage** - Range widgets: 12/15 have testBadValueRange() (80%) - Combo widgets: 3/5 have testBadValueCombo() (60%) — below 80% threshold ### Info **[U7] File structure** - Files found: <plugin>_Basic_Unit_test.js, <plugin>_Advanced_Unit_test.js, <plugin>_Unit_test.js - License headers: OK - Termination sequence: OK ### Widget Coverage Detail | Widget Key | Type | Has Test | Has Bad Value Test | |-----------|------|----------|-------------------| | voltage0_in/hardwaregain | range | YES | YES | | voltage0_in/rf_bandwidth | readonly | NO | N/A | | ensm_mode | combo | YES | YES | | ... | ... | ... | ... | Coverage: X/Y widgets tested (Z%) ### API Method Coverage | Method | Has Test | |--------|-
You are performing static code quality analysis on the Scopy package: `$ARGUMENTS`
**Recommended model:** Opus — this command performs deep codebase exploration and multi-step reasoning to produce high-quality…
You are creating a JavaScript API class for a Scopy plugin so it can be controlled from test automation scripts.
You are creating JavaScript automated test scripts for a Scopy plugin, mapping RST manual test cases to API calls.
You are creating Sphinx RST documentation for a Scopy plugin user guide.
You are creating Sphinx RST test case documentation for a Scopy plugin, following the established test documentation format.