Skip to content

Commit 253c381

Browse files
sbfnksbfnk-bot
andauthored
Reduce cyclomatic complexity of try_merge_additional_files() (#292)
* Reduce cyclomatic complexity of try_merge_additional_files() Co-authored-by: sbfnk <sebastian.funk@lshtm.ac.uk> * Add NEWS entry for extracted helpers Co-authored-by: sbfnk <sebastian.funk@lshtm.ac.uk> * Fix formatting and unmatched-merge count in try_merge_one_file Co-authored-by: sbfnk <sebastian.funk@lshtm.ac.uk> * Simplify helpers and reduce try_merge_additional_files to complexity 12 Co-authored-by: sbfnk <sebastian.funk@lshtm.ac.uk> * Address review: fix formatting, warn on ignored participant_key Co-authored-by: sbfnk <sebastian.funk@lshtm.ac.uk> * Distinguish warning messages for invalid participant_key, consistent := style Co-authored-by: sbfnk <sebastian.funk@lshtm.ac.uk> * Thread call param through resolve_longitudinal_key, use basename consistently Co-authored-by: sbfnk <sebastian.funk@lshtm.ac.uk> --------- Co-authored-by: sbfnk-bot <242615673+sbfnk-bot@users.noreply.github.com>
1 parent 112c3e7 commit 253c381

File tree

3 files changed

+262
-160
lines changed

3 files changed

+262
-160
lines changed

NEWS.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,13 @@
5151
data. The `wpp2017` package is now a suggested dependency rather than a
5252
required import (#258).
5353

54+
* Reduced cyclomatic complexity of `try_merge_additional_files()` by extracting
55+
helper functions (#289).
56+
57+
* Fixed unmatched-merge warning count when merging files with duplicate keys;
58+
previously, the count could be wrong (or negative) due to counting join pairs
59+
rather than distinct matched rows (#289).
60+
5461
* `get_survey()`, `download_survey()`, `list_surveys()`, `get_citation()`, and
5562
`survey_countries()` now warn unconditionally when called. These functions
5663
were soft-deprecated in 0.5.0 and users should switch to the

R/globals.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ utils::globalVariables(c(
8888
"title", # <.list_surveys>
8989
"creator", # <.list_surveys>
9090
"identifier.2", # <.list_surveys>
91-
"..merge_id", # <try_merge_additional_files>
91+
"..merge_id", # <try_merge_one_file>
9292
"..main_id", # <try_merge_additional_files>
9393
"..original.lower.age.limit", # <pop_age>
9494
"..segment", # <pop_age>

0 commit comments

Comments
 (0)