← Back to issue list

Create an inner class for LXD variables

View original Github issue

Metadata

Project
craft-providers
Number
#792
Type
issue
State
open
Author
bepri
Labels
Type: Enhancement
Created
Updated
Closed

Current evaluation

Enhancement to create an inner class or dataclass for LXD variables to reduce parameter lists in launcher.py methods

Suggested action: keep open

Reason: This is a valid enhancement request from a maintainer (bepri) to improve code clarity by consolidating the large parameter lists in _create_instance and launch methods. The issue remains relevant as the code still has excessive parameters (evidenced by the noqa PLR0913 comment). A recent comment from @cmatsuoka suggests an alternative dataclass approach, indicating ongoing discussion about implementation.

Impact: 50 Quick Win: 32.5 Staleness: 65 Complexity: 35 Confidence: 70 Support Request: 0

Issue body

### What needs to get done An inner class to store some of the nitty-gritty LXD variables should be made in the `lxd` module. ### Why it needs to get done A few methods (in particular, `craft_providers/lxd/launcher.py:launch`) have enormous parameter lists. A wrapper class to store a lot of the related variables and reduce the number of parameters passed around between internal function calls would improve code clarity.

Evaluation history

Date Model Scores Action Summary
qwen3.6-35b-a3b-mtp-q6
Impact: 50
Quick Win: 32.5
Staleness: 65
Complexity: 35
Confidence: 70
Support Request: 0
keep open Enhancement to create an inner class or dataclass for LXD variables to reduce parameter lists in launcher.py methods
qwen/qwen3.8-27b
Impact: 25
Quick Win: 13.75
Staleness: 5
Complexity: 45
Confidence: 85
Support Request: 0
keep open Enhancement to add an inner class (or launcher context dataclass) in the lxd module to consolidate the huge parameter lists of launcher.launch() and related internal calls. Still unimplemented; recent maintainer comment proposes a dataclass approach.
qwen/qwen3.6-35b-a3b
Staleness: 90
Complexity: 25
Confidence: 85
Support Request: 0
needs triage Enhancement to group LXD variables into an inner class in the lxd module, reducing large parameter lists in internal methods. Unassigned, no maintainer comments, inactive for over a year.
qwen3.6-35b-a3b-mtp-q6
Staleness: 90
Complexity: 20
Confidence: 80
Support Request: 0
needs triage Refactoring task to group LXD-related variables into an inner class to reduce parameter lists in internal methods. Unassigned, no maintainer comments, and inactive for over a year.
qwen3.6-35b-a3b-mtp-q6
Staleness: 90
Complexity: 20
Confidence: 80
Support Request: 0
keep open Enhancement to create an inner class grouping LXD variables, reducing parameter lists in internal functions for improved code clarity. Currently open with no maintainer comments or activity for over 300 days.

Update history

Date Change
updated

Related issues

No related issues found above the similarity threshold.