COBOL: a program's entry paragraph (reached by fall-through) is flagged unreferenced and drives the tech-debt score; the #3198 entry row was never fixed
I maintainer di solito rispondono entro 1 giorno
Una pull request collegata è già stata integrata.
- #7241 di @squid-protocol — integrata
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 30/100
Direzione di ricerca
Start in detector.py at _is_orphan and the orphan/duplicate guard that exempts main_line since #7170; extend the same exemption to the first paragraph/section after PROCEDURE DIVISION. Check _calc_tech_debt in metrics/signal_processor.py and the ground-truth ledger dead cells. Done means entry paragraphs are not orphaned, tech-debt scores drop on the listed COBOL files, and golden masters update.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What happens. A COBOL program starts by falling into the first paragraph (or section) after its PROCEDURE DIVISION header, and nothing calls that unit by name. _is_orphan (detector.py) gives it usage_status = 1, and two scores read that verdict as a defect:
- Tech debt:
_calc_tech_debt(metrics/signal_processor.py) countsunreferenced_by_nameas orphans and weights each ×2. In a typical COBOL file, the entry paragraph is the whole score. - The debt and dead-code signal families include
unreferenced_by_name.
#3198 reported this as the first of three defects (its micro-repro's MAIN-PARA, "live: the entry, reached by fall-through, never PERFORMed"; zopeneditor's 000-MAIN ×4; CBSA's PREMIERE SECTION in 17 programs and A010 in 7). Its fix landed the other two (case-insensitive names, - as a name character; cobol.py identifier_case / identifier_extra_chars). The entry row is still open on main.
Since #7170 it is also asymmetric. A main line (statements before the first paragraph) is now a def_shape = "main_line" unit, exempt from the orphan verdict. So the same program scores 0 when written with a main line and a non-zero tech debt when written with an entry paragraph.
Evidence. The ten agentic-COBOL systems (acherm/agentic-*-cobol-*, MIT), engine with #7170:
- Every flagged unit is an entry unit. Every
usage_status = 1COBOL paragraph in all ten systems, 10 of 10, is the first paragraph after aPROCEDURE DIVISIONheader. - That one paragraph is every non-zero tech-debt score. Every COBOL file with a non-zero
risk_tech_debthas exactly one such paragraph and no TODO or duplicate markers. One file has one HACK marker.
| file | tech debt | from |
|---|---|---|
agentic-cobol-doom-cc walker.cob |
37.8 | the entry paragraph alone |
agentic-cobol-pygame-cc imgtest.cob |
47.6 | entry paragraph + 1 HACK-style marker |
agentic-cobol-sat-cc src/cobsat.cob |
24.4 | the entry paragraph alone |
agentic-cobol-compress-cc src/crc32.cob |
22.5 | the entry paragraph alone |
agentic-cobol-pygame-cc bounce.cob / demo.cob / flappy.cob |
16.8 / 16.5 / 10.2 | the entry paragraph alone |
agentic-cobol-sat-codex src/cobsat.cob |
10.7 | the entry paragraph alone |
| Codex systems that open with a main line | 0 | no entry paragraph |
Reproduce: agentic-cobol-pairs/scoring_checks.py in squid-protocol/gitgalaxy-population-analyses (PR #23) lists every unreferenced paragraph and whether it is an entry.
Expected. The unit a PROCEDURE DIVISION falls into is never an orphan or a duplicate:
- the first paragraph after the header, when there is no main line;
- or the first section and its first paragraph.
This is the same rule #7170 gives the main line (def_shape != COBOL_MAIN_LINE_SHAPE in the orphan/duplicate guard). Per program: nested and sibling programs each have their own entry. A paragraph that only falls through from its predecessor is out of scope here (#3198 noted that fall-through sections read 0 only via is_public). The entry is the one case that is always reached.
To check in the fix
- Ground-truth ledger
deadcells: the key's truth is reachability. Entry paragraphs counted dead should become matches; theengine_dead_is_unreferenced_by_namecause (#2806) stays for the rest. - The refraction pipeline's dead-code use (#3120/#3122).
- Golden masters: tech-debt and dead-code exposure move on COBOL files.
Found by the agentic-COBOL structural comparison (DOOM study follow-up).
- Lingua principale
- Python
- Stelle
- 57
- Fork
- 11
- Merge medio
- 1h 30m
- PR unite (30g)
- 973
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di squid-protocol/gitgalaxy
-
ci-red-main claim:melek
Difficoltà 3/5 1-2 giorni Idoneità per principianti 42/100
squid-protocol/gitgalaxy#7619 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
main is red: OS Smoke GridApertaci-red-main claim:melek
Difficoltà 2/5 1-3 ore Idoneità per principianti 48/100
squid-protocol/gitgalaxy#7618 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
claim:melek scope:core
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
squid-protocol/gitgalaxy#7607 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
claim:melek scope:core
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
squid-protocol/gitgalaxy#7589 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
squid-protocol/gitgalaxy#7536 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di squid-protocol/gitgalaxy
Issue simili
-
Server mode OAuth2: 'NoneType' object is not subscriptable on every request after re-submitting the OAuth2 login while already logged inForse già presa @Rarasinhoo l’ha presa oggi. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
pgadmin-org/pgadmin4#10733 ·
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
aws-samples/sample-per-model-bedrock#752 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
int-brain-lab/mpci#32 ·
-
area:docs priority:p2 type:docs
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
jejjohnson/geostack#120 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
sublimelsp/LSP-vue#203 · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno