killercup / killercup/cargo-edit
upgrade: Show technical debt
- Dominant language
- Rust
- Stars
- 3.5k
- Forks
- 166
- PR merge metrics
- No merged PRs in 30d
Description
### Feature Request
Show [technical debt](https://medium.com/@ramanand.k/the-hidden-costs-of-technical-debt-what-lurks-beneath-bad-code-0b5f5390ae1f) numbers in `cargo upgrade` similar to like [badges](https://daily.dev/blog/best-practices-for-github-markdown-badges) do to encourage increasing maintainability, minimizing vulnerabilities, improving code and using new features.
The simplest number would be to sum up days between the installed version and the last stable release for all found upgrades (12 days between the old and new version of the first upgrade, 34 days between the old and new version of the second upgrade, ...).
If you count compatible and incompatible updates separately you can show the reduced technical debt after a successful upgrade and the remaining technical debt for incompatible upgrades.
Example:
```shell
$ cargo upgrade --verbose
Checking rewrk's dependencies
name old req compatible latest new req note debt
==== ======= ========== ====== ======= ==== ====
clap 2 2.34.0 4.5.9 2 incompatible 12 days
http 0.2 0.2.12 1.1.0 0.2 incompatible 34 days
hyper 0.14 0.14.30 1.4.1 0.14 incompatible 56 days
Technical debt: 102 days
Checking rewrk-core's dependencies
name old req compatible latest new req note
==== ======= ========== ====== ======= ====
http 0.2 0.2.12 1.1.0 0.2 incompatible 78 days
flume 0.10.14 0.10.14 0.11.0 0.10.14 incompatible 90 days
hyper 0.14 0.14.30 1.4.1 0.14 incompatible 12 days
axum 0.6.20 0.6.20 0.7.5 0.6.20 incompatible 34 days
Technical debt: 214 days
```
Please note that [crates.io](https://crates.io/crates/rewrk) already shows the age of a crate as the very first information below **Metadata**:
Other package managers like [npm and bundler](https://www.hansschnedlitz.com/2021/02/10/using-github-actions-to-detect-outdated-dependencies.html) already offer an `outdated` command, this could be used internally by `cargo upgrade` and offered as a public command as well.
Contributor guide
Research direction
Start by tracing the cargo upgrade command and its existing dependency table and verbose output. Clarify how crate age is obtained, how compatible and incompatible upgrades contribute to totals, and what the example output requires before defining the completion criteria.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 32/100