Skip to content

Reduce cyclomatic complexity in GPS parser functions#817

Merged
caglarpir merged 1 commit intoimprove-test-coveragefrom
reduce-ccn
Mar 4, 2026
Merged

Reduce cyclomatic complexity in GPS parser functions#817
caglarpir merged 1 commit intoimprove-test-coveragefrom
reduce-ccn

Conversation

@caglarpir
Copy link
Contributor

Summary

  • Extract _accumulate_xyz_telemetry() in gpmf_parser.py to deduplicate identical ACCL/GYRO/MAGN processing blocks in _load_telemetry_from_samples
  • Extract _detect_timezone_offset() in blackvue_parser.py and merge GGA/RMC/GLL branches to simplify _parse_gps_box
  • Promote _aggregate_float_values_same_length() to module level and extract _aggregate_epoch_times() in exiftool_read_video.py to simplify _aggregate_gps_track

Motivation

Three functions exceeded the cyclomatic complexity threshold of 20 (CCN 21, 23, and 32 respectively). Each contained duplicated logic or overly long inline blocks that could be cleanly extracted into helpers
without changing behavior.

@meta-cla meta-cla bot added the cla signed label Mar 3, 2026
@caglarpir caglarpir changed the base branch from main to improve-test-coverage March 3, 2026 15:25
  in GPS parser functions
@caglarpir caglarpir merged commit 9defa56 into improve-test-coverage Mar 4, 2026
1 check passed
@caglarpir caglarpir deleted the reduce-ccn branch March 4, 2026 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant