Skip to content

Feature/set version refactor - #43

Open
mgershe wants to merge 2 commits into
CMU-313:mainfrom
mgershe:feature/setVersion-refactor
Open

Feature/set version refactor#43
mgershe wants to merge 2 commits into
CMU-313:mainfrom
mgershe:feature/setVersion-refactor

Conversation

@mgershe

@mgershe mgershe commented Sep 3, 2026

Copy link
Copy Markdown

P1B: Starter Task: Refactoring PR

Use this pull request template to briefly answer the questions below in one to two sentences each.
Feel free to delete this text at the top after filling out the template.

1. Issue

Link to the associated GitHub issue:#34

Full path to the refactored file: script/upgrade-opentui.ts:45

What do you think this file does?
It is a maintenance script that automatically updates and standardizes OpenTUI dependency versions across the monorepo while preserving correct version prefixes and ranges.

What is the scope of your refactoring within that file?
setVersion function

Which Qlty‑reported issue did you address?

  • Function with many returns (count = 7): setVersion*

2. Refactoring

How did the specific issue you chose impact the codebase’s maintainability?
High cognitive load and any different return branches makes the code harder to read and harder to extend
What changes did you make to resolve the issue?
changed the return branches to a single if/else if branch and a single return variable
How do your changes improve maintainability? Did you consider alternatives?
The function is now more clear and easy to read showing a linear logic and adding support for if there's a need for a new prefix

3. Validation

How did you validate that the change is correct?
Could not debug testing errors
Attach a screenshot of the test coverage showing the lines were executed by the tests.
N/A
Attach a screenshot showing the tests that cover the change passing during CI
N/A
Attach a screenshot of qlty smells --no-snippets <full/path/to/file.ts> showing fewer reported issues after the changes.
Screenshot 2026-09-03 at 6 02 01 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant