Skip to content

v1.0.3: Core Refactoring & Maintainability Improvements

Latest

Choose a tag to compare

@shamspias shamspias released this 10 Mar 06:31
98234f2

This release focuses entirely on under-the-hood improvements, drastically reducing cyclomatic complexity across the codebase to ensure Fennec remains highly maintainable, readable, and easy to test.

There are no breaking API changes in this release. All existing integrations and CLI commands will continue to work exactly as before.

🛠 Refactoring & Improvements

  • Target Size Engine: Completely modularized the hitTargetSize search engine. Binary scaling, fixed scaling, and fallback encodings are now isolated into focused, highly testable functions.
  • EXIF Parser: Refactored the minimal, zero-dependency EXIF parser. TIFF orientation parsing and IFD entry scanning are now broken into discrete helper functions.
  • SSIM Downsampling: Abstracted the innermost loops of the box filter into a dedicated averageBoxPixel helper, improving the readability of the fast-path SSIM calculations.
  • Core Compression Pipeline: Decoupled compressImageInternal into distinct handleTargetSizeMode and handleStandardMode execution paths.
  • CLI: Refactored the monolithic main function in cmd/fennec into focused handlers for flag parsing, analysis, and compression.
  • Tests: Moved inline anonymous test fixture generators into standalone, top-level functions in testdata_generate_test.go.

🧹 Code Quality

  • Resolved all gocyclo complexity warnings (functions exceeding a complexity score of 15).
  • Maintained 100% passing test suite and data-race-free execution.
  • Verified go vet and staticcheck compliance.

Full Changelog: v1.0.2...v1.0.3