Refactor install_plugins() in install_plugins.py
- Dominant language
- Python
- Stars
- 37
- Forks
- 9
- PR merge metrics
- No merged PRs in 30d
Description
This is an unfinished refactoring sub-task coming from the [Add Pylint as a python static code analyzer #298](https://github.com/bitovi/bitops/pull/298).
The `install_plugins()` function in `install_plugins.py` is failing pylint check on:
> scripts/plugins/install_plugins.py:17:0: R0914: Too many local variables (22/15) (too-many-locals)
> scripts/plugins/install_plugins.py:17:0: R0915: Too many statements (59/50) (too-many-statements)
The function has almost 200 lines and pylint with multiple warnings is a great indicator that it needs to be restructured and divided into smaller logical pieces. For instance:
* Extract it into a new `Plugin` class perhaps with another layer `PluginInstaller ` (note: `PluginDeployer` #328) with multiple methods, so the interface would be `Plugin.install()` that we can call while iterating over each plugin in the sequence.
* Then another class `PluginConfig` would handle plugin config parsing and processing.
The pylint check for this function is silenced for now, don't forget to unsilence it when the refactoring is done.
Contributor guide
Assessment
This issue has not been assessed yet.