[2.4.0 stack 9/18] Quality: zero duplicated code, zero unused exports, 100% mutation score - #517
[2.4.0 stack 9/18] Quality: zero duplicated code, zero unused exports, 100% mutation score#517hyanmandian wants to merge 1 commit into
Conversation
|
Important Review skippedToo many files! This PR contains 176 files, which is 26 over the limit of 150. To get a review, reduce the PR to 150 files or fewer by splitting it into smaller PRs or changing its base branch. Upgrade to a paid plan to raise the limit. This review couldn't start because sufficient usage credits or metered capacity aren't available. Add credits or update usage-based reviews in the billing tab, then retry. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (176)
You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## stack/07-docs #517 +/- ##
================================================
Coverage 100.00% 100.00%
================================================
Files 152 154 +2
Lines 2161 1981 -180
Branches 664 601 -63
================================================
- Hits 2161 1981 -180
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Tree-shaking reportFails when a pre-existing export grows more than 20% and more than 256 B, or when importing every export that already existed on the base grows more than 5%. New exports never count as a regression. Pre-existing exports: 628788 B to 625733 B (-0.5%, gzip 161766 B). Full import on head: 625733 B (gzip 161766 B).
|
108a8e9 to
3fddbfa
Compare
8e3eee3 to
4acb4cb
Compare
|
@coderabbitai full review |
|
… surviving mutant Prepares the code for three new gates that land in the next part (jscpd, knip and Stryker), so that each of them is green from its first run. Duplication: the per-state IE validators share two private helpers for the weighted sums and the modulo 11 digit; isValidCei and isValidCno delegate to _internals/is-valid-cei-cno-number (the CNO inherited the CEI numbering); the CBO and CFOP generators fetch and sort through _internals/fetch-sorted-record; repeated test setups became local helpers or table-driven cases with the same literal expectations. Unused code: MIN_PRECISION, MAX_PRECISION, PHONE_INTERNATIONAL_PREFIX, PIX_KEY_MAX_LENGTH, CEI_LENGTH and the Mod11Variant type are no longer exported; the two voter id federative union constants are one. Mutation testing: 641 surviving mutants across 115 files were closed, mostly with new tests carrying hand-written expectations, otherwise by removing guards that a later check already enforced. parseNfeKey now performs the validation and isValidNfeKey delegates to it, so the model narrowing has no unreachable branch. getCities keeps its cached combined list; the test that asserts its content is the first caller so the cached path is exercised. The few provably equivalent mutants are marked with `Stryker disable next-line` and a reason.
4acb4cb to
ccbf74c
Compare
|
@coderabbitai full review |
Rate Limit Exceeded
|
|
@coderabbitai full review |
|
What does this PR do?
Part 9 of 18 of the 2.4.0 release stack (main <- stack/01-tooling <- ... <- stack/11-testing). One refactor commit that brings the tree to the three new quality gates of part 9 before they are switched on: jscpd reports zero duplicated blocks (shared
fetchSortedRecordfor the dataset scripts, oneisValidCeiCnoNumberfor CEI and CNO, the Pix TLV helpers), knip reports zero unused files, exports and dependencies, and Stryker reports a 100% mutation score (every surviving mutant got a test with a literal expectation, a simplification of a dead guard, or, for the few provably equivalent mutants, aStryker disable next-linecomment stating why). No public signature or output changes; the build-to-build comparison over every export is identical.Commits in this part (1)
How to review and merge
isValidNfeKeygrows from 1.0 KB to 1.3 KB because it now delegates toparseNfeKeyinstead of carrying a second copy of the key checks (the duplication jscpd flagged). Accepted with thetree-shaking: acceptedlabel.mainand merge it with a merge commit: the reviewed commits land unchanged and GitHub marks the seventeen parts below as merged.CHANGELOG.md(part 7); the build of every later part is compared export by export against the part below it.Stack