refactor(advanced-settings-dialog): extract __init__ into smaller methods to fix R0914#1538
Merged
raivisdejus merged 7 commits intoJul 1, 2026
Conversation
…hods to fix R0915
…ethods to fix R0915
…thods to fix R0915
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1538 +/- ##
==========================================
+ Coverage 82.83% 82.86% +0.03%
==========================================
Files 108 108
Lines 11620 11627 +7
==========================================
+ Hits 9625 9635 +10
+ Misses 1995 1992 -3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…ve-code-smell-advanced-settings-init-R0914 # Conflicts: # buzz/widgets/transcription_viewer/speaker_identification_widget.py
raivisdejus
enabled auto-merge (squash)
July 1, 2026 12:07
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.
Why this change is necessary
The
__init__method ofAdvancedSettingsDialoghad 144 statements, far exceeding Pylint's default limit of 50 (R0914 – too-many-statements). This made the method hard to read, test, and maintain. All UI construction logic was concentrated in a single method.How it was tested
pytest -k advanced_settings— 19/19 tests passed (the only failure in the suite is a pre-existing locale issue inTestLanguagesComboBox, unrelated to this change)--enable=R0914now passes with a score of 10.00/10ast.parseNotes for the reviewer
The refactoring is purely structural — no behavior or logic was changed. The original
__init__body was split into four private methods:_setup_transcription_section_setup_translation_section_setup_recording_section_setup_button_boxAll references to the local parameter
transcription_optionsinside the extracted methods were changed toself.transcription_options(the instance attribute already set in__init__).