musescore / musescore/MuseScore

`cmdNextPrev...` methods require some refactoring

Open
#17,082 18 comments 0 reactions 1 assignee View on GitHub

@mathesoncalum is already working on this.

Since Jan 21, 2025.

community P3 tech debt
Dominant language
C++
Stars
15.1k
Forks
3.3k
Avg merge
2d 2h
Merged PRs (30d)
91

Description

Issue type

Other type of issue

Bug description

The focus of this issue changed slightly as of 2024/01/21 (see edit history for details). This issue was originally concerned with the coding bugs identified by this video, but these have mostly been resolved now (in PRs such as #25537).

While working on these bugs, it became evident that a significant refactor is in order for some of our cmdNextPrev... methods. These contain some pretty extreme nesting, an overuse of auto, and conditionals that are difficult to follow.

We should try to improve these methods by making use of early returns, being more explicit with our types, extracting some conditionals into well-labelled bools, and potentially encapsulating some code into helper methods.

Steps to reproduce

No response

Screenshots/Screen recordings

No response

MuseScore Version

Latest code on master

Regression

No.

Operating system

All

Additional context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.