Split ValueConverter::Filter into one member per mode (0061) - #380
Merged
Merged
Conversation
The int/float/abs/round/filesizeformat/items filters shared one function with cognitive complexity 89. Each mode now has its own private member; Filter dispatches. Behaviour is unchanged. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LJv5o6nbcd16qaXtwhoNVG
# Conflicts: # src/filters.cpp
rmorozov
marked this pull request as ready for review
October 4, 2026 02:33
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.
Requested by Ruslan · project thread
Before: one function,
ValueConverter::Filterinsrc/filters.cpp, implemented theint,float,abs,round,filesizeformat,itemsandlistfilters. Its cognitive complexity was 89, and it was kept behind aNOLINTmarker.After: each of those modes has its own private member, declared in
src/filters.h:FileSizeFormat,Items,ToInt,ToFloat,AbsandRound. Two free helpers move into the file's anonymous namespace:PythonIntOf(bool counts as int) andFloatToInt.Filternow only switches on the mode. Output, error codes and the order in which errors are raised are all unchanged, and 29 complexity markers remain. Part of docs/tasks/0061.Roles and rounds: main session plus one verifier round, which found nothing blocking.
filters.hanalysed alone. clang-format was clean.abs(INT64_MIN)returnsINT64_MIN.Red pushes: 0 so far.
🤖 Generated with Claude Code
https://claude.ai/code/session_01LJv5o6nbcd16qaXtwhoNVG
Generated by Claude Code