Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HeaderSyncService#Start Overly Complex #1485

Open
oxnr opened this issue Jan 17, 2024 · 0 comments
Open

HeaderSyncService#Start Overly Complex #1485

oxnr opened this issue Jan 17, 2024 · 0 comments
Labels
bb-audit-issue T:code-hygiene General cleanup and restructuring of code to provide clarity, flexibility, and modularity. T:testing Related to testing

Comments

@oxnr
Copy link

oxnr commented Jan 17, 2024

Finding 005 - HeaderSyncService#Start Overly Complex

ID 005
Finding HeaderSyncService#Start Overly Complex
Severity 2 - Informational
Description The HeaderSyncService#Start method is rather complex and large. It is responsible for many tasks such as starting and subscribing to a subscriber, starting the header store, P2P logic, creating a syncer and evaluating P2P responses. In addition, the method is not very well documented.In the case this method is bug-prone or problematic or even needs to be updated in the future, it might be difficult for developers to truly understand and debug root causes.
Recommendation We recommend splitting up the method into simpler, more testable methods, each that are clearly documented and well tested.In addition, Start should take a Context in order for the caller to manage the lifecycle of the call in a predictable manner.
Code References
func (hSyncService *HeaderSyncService) Start() error {
@Manav-Aggarwal Manav-Aggarwal added T:code-hygiene General cleanup and restructuring of code to provide clarity, flexibility, and modularity. bb-audit-issue T:testing Related to testing and removed needs-triage labels Jan 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bb-audit-issue T:code-hygiene General cleanup and restructuring of code to provide clarity, flexibility, and modularity. T:testing Related to testing
Projects
Status: No status
Development

No branches or pull requests

2 participants