Repository navigation
chore: jscpd が見つける重複をまとめる - #186
Merged
Merged
Conversation
src: LARGE/SMALL-style and RANK-style handlers come from one factory each, and nameBinding's two quote-skipping scans share findOutsideQuotes. tests: the small sheets, closeness checks, fixture reading, LCG stream, script runner and PV sheet each live in one file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
|
CODEX VERDICT: LGTM Read commit
Verification: FINDINGS COMPLETE: I read every hunk of the diff and this is every finding I have. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Folds every repeated block that jscpd finds (with scoria's settings) into a shared function. After this, jscpd finds no repeated code.
src (behaviour unchanged):
statistical-analysis.ts:rankedHandler(range, k) is exported, anddescriptive.tsuses it instead of its own copy,rangeAndNumber.rankingHandler(rule): a factory for the (number, ref, [order]) argument pattern. RANK uses it, and so doesdescriptive.ts's RANK.AVG.nameBinding.ts:endOfBracketandnextLambdaboth had their own loop that scans text while skipping quoted strings. Both now call one sharedfindOutsideQuotes.tests (new files under
tests/engine/):formulaAnswers.ts, with four helpers:formulaValue: what a formula answers alone in A1;valueBelow: what a formula answers placed under the data;spilledBeside: what a formula placed beside the data spills;rowMajorCells: the coordinates of a block, one row after another.formulaColumns.ts: newvaluesBesideCells, for data cells down column A with formulas down column B.closeness.ts(relative and absolute closeness checks) andreferenceFixture.ts(reading{ cases }from a fixture).seededRandom.ts: newlcgRandom, the old LCG stream, so the same seed produces the same sequence.scriptRunner.ts: the tsx scripts'test/ summary /expect. The PV sheet's data moves intotest-utils.ts.test_customFunctions, which checks a function body that does not compile, andtest_crossSheetReference, which checks reference cycles across sheets.Items to Confirm
origin/mainand this branch were run side by side and compared:corpusdiff.mts): identical;referenceCasesnow also fails when a fixture has no cases (onlytest_regressionchecked that before).yarn lint,yarn typecheck,yarn build,yarn test,yarn test:engine,run-all-fixtures.ts,test:calculator,test:evaluator,test:functionsandtest:scriptsall pass. oxlint run with scoria's settings reports nothing.User Prompt
🤖 Generated with Claude Code
work in GUIChatPluginSpreadsheet