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

Refactor Long Functions to Increase Readability #110

Open
9 tasks
renaz6 opened this issue Oct 11, 2022 · 0 comments
Open
9 tasks

Refactor Long Functions to Increase Readability #110

renaz6 opened this issue Oct 11, 2022 · 0 comments
Assignees

Comments

@renaz6
Copy link
Member

renaz6 commented Oct 11, 2022

Refactor long functions

There are a few long functions that should be refactored and broken up into more readable sections.
By default, the funlen linter has a limit of 60 lines or 40 statements per function. It is the goal to adhere to these standards.
Currently, the funlen linter in this repo is disabled, this should be enabled as part of this issue. It can be enabled by adding it to the enable section of the .golanci.yaml config file.

To Do

  • Enable funlen linter in the .golanci.yaml config file
  • Run the linter golangci-lint run
  • Refactor and break up the functions the linter complains about

Update deprecated libraries

The staticcheck linter checks for deprecated imports. This has been disabled for imports of webpa-common/v2/logging and other libraries, but should be enabled as part of this ticket. A new logger will need to be added.

To Do

  • Search for nolint:staticcheck in the repo and remove the comments
  • Run the linter golangci-lint run
  • Reconfigure logging in those files, most likely using uber/zap
  • Fix other staticcheck deprecated issues that may be in the repo

Re-assess lines ignored by the linter

At the moment, there are a few lines of code that are ignored by the linter. Re-assess whether or not these should continue to be ignored

To Do

  • Search for nolint in the repo and re-assess the results, remove the ignore if needed
  • Run the linter to make sure no issues are flagged. Fix issues if they are flagged
@renaz6 renaz6 self-assigned this Oct 11, 2022
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

No branches or pull requests

1 participant