[Bug] complex_conditional scores in Vue and Svelte files although it is advisory in TypeScript and JavaScript
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- javascript, python, typescript
- Domain
- analytics
Research direction
Start in packages/core/src/repowise/core/analysis/health/scoring.py: read _ADVISORY_BY_LANGUAGE (around lines 590-608), _SCORED_ONLY_IN, and _advisory_in, which matches the file's language tag exactly. The maintainers still need to choose between aliasing vue and svelte to the script language or adding measured cells, and linked PR #6325 is already open, so check it first. Done means the new cells or aliases are recorded in docs/architecture/code-health.md section 5.4 and tests/unit/health/test_advisory_by_language.py passes.
Written by the indexing model from the issue text.
Description
Summary
_ADVISORY_BY_LANGUAGE["complex_conditional"] lists 15 language tags but not vue or svelte, so the same TypeScript condition is advisory in a .ts file and scored as a defect in a .vue or .svelte file.
packages/core/src/repowise/core/analysis/health/scoring.py:590-608
_ADVISORY_BY_LANGUAGE: dict[str, frozenset[str]] = {
"complex_conditional": frozenset({"c", "cpp", ..., "javascript", ..., "typescript"}),
Mechanism
_advisory_in(scoring.py:641-646) matches the file's language tag exactly, andvueandsvelteare their own tags (ingestion/languages/specs/vue.py:23,specs/svelte.py:13).- The table needs measured numbers in
docs/architecture/code-health.mdsection 5.4; thecomplex_conditionalrow (:352) has javascript 2/5 and typescript 1/8 and no vue or svelte cell. - Vue and Svelte script blocks are parsed as JavaScript or TypeScript, so those cells describe the same code.
- The same gap exists for
primitive_obsessionandgod_class, and_SCORED_ONLY_IN(:635) makesdry_violationadvisory in.vuealthough it scores in.ts.
Repro
The same function with a (a > 1 && b < 2) || (c && d === "x") || (a === b && !c) condition in src/check.ts, in <script lang="ts"> of src/Check.vue, and in src/Check.svelte. After repowise init --mode fast --no-prose on main, health_findings:
('src/Check.svelte', 'complex_conditional', 'high', 1.442, 'defect')
('src/Check.vue', 'complex_conditional', 'high', 1.442, 'defect')
('src/check.ts', 'complex_conditional', 'high', 0.0, 'advisory')
Impact
Vue and Svelte files lose score and rank as refactoring targets for a marker that does not predict defects in the language their scripts are written in.
Done looks like
vueandsveltefollow the script language's cell forcomplex_conditional, either by an alias to that cell or by a measured cell of their own.- Apply the same decision to the other per-language tables, so a
.vuefile never scores differently from the.tsit contains. - Record the alias or the numbers in
docs/architecture/code-health.mdsection 5.4. complex_method,nested_complexityandlarge_methodkeep scoring in every language.- Help wanted: needs a call on alias versus measurement.
Tests
tests/unit/health/test_advisory_by_language.py: vue and svelte are advisory for complex_conditional and still scored for complex_method.
- Dominant language
- Python
- Stars
- 7.1k
- Forks
- 756
- Avg merge
- 21h 5m
- Merged PRs (30d)
- 797
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from repowise-dev/repowise
-
[Bug] Elixir `.formatter.exs`, `.credo.exs`, `config/*.exs` and `priv/**/*.exs` are reported as unreachable filesPossibly taken @ZYZ666-RGB claimed this 1 day ago. Openbug good first issue
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
repowise-dev/repowise#6296 · 1 comment ·
Maintainers usually reply within 1 day
-
[Bug] Coverage stack detection omits Swift, Dart, and Scala, falling through to UNKNOWN in evidence setupPossibly taken @RishabhIIITD claimed this 2 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
repowise-dev/repowise#5838 · 2 comments ·
Maintainers usually reply within 1 day
-
[Bug] PR-mined decisions store the decision sentence again as their rationalePossibly taken @suyashgitt claimed this 11 days ago. Openbug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
repowise-dev/repowise#5702 · 2 comments ·
Maintainers usually reply within 1 day
-
[Bug] CICS CSD `DEFINE _PGMLIST` startup programs (`_PGMPH`) are not rootsPossibly taken @dchaudhari7177 claimed this 34 days ago. Openbug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
repowise-dev/repowise#4477 ·
Maintainers usually reply within 1 day
-
[Bug] COBOL listing directives EJECT, SKIP1/SKIP2/SKIP3 and TITLE fail to parse and drop the rest of the filePossibly taken @dchaudhari7177 claimed this 34 days ago. Openbug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 91/100
repowise-dev/repowise#4474 ·
Maintainers usually reply within 1 day
All issues in repowise-dev/repowise
Similar issues
-
triage
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
kornia/kornia-rs#1416 · 1 comment ·
Maintainers usually reply within 2 days
-
ui
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
PolicyEngine/ai-inequality#64 ·
Maintainers usually reply within 1 day
-
LinearGaussianStateSpace.dist splits states and observations wrongly when the transition varies over timePossibly taken @PabloRoque claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
pymc-devs/pymc-extras#839 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day