nvm-sh/nvm
Node Version Manager - POSIX-compliant bash script to manage multiple active node.js versions.
Shell★ 95,494+52 that day#3 on trending
B70.4/100
Duplication75
3.5% in bash, perlDead coden/a
the languages dead code reads are under 5% of the codeComplexity66
30.7% The score is jscpd's own --health model: markup, data and text left out, tests kept. The numbers below are the trending scan's.
10.26%duplicated over all files · 2,943 of 28,674 lines
103clones
391files scanned
Most complex files
- nvm.sh1053 cx
- install.sh101 cx
- test/fast/Unit tests/nvm_die_on_prefix80 cx
- test/common.sh42 cx
- test/installation_node/install while reinstalling packages36 cx
- test/fast/Unit tests/nvm_is_valid_version35 cx
- release-notes.sh34 cx
- test/fast/Unit tests/nvm_get_download_slug34 cx
- test/fast/Unit tests/nvm_ensure_version_installed25 cx
- test/fast/Unit tests/nvm_print_color_legend25 cx
Dead code 0% unused · 0 findings
No dead code found — everything here is reachable.
Only 19 of the files count as code, too few for a code-only percentage; the numbers above cover every file.
Largest clones in the code
- 25 lines in 2 placesbash122 tokens
123# Emulate curl with wget 124local NVM_DOWNLOAD_WGET_COUNT 125NVM_DOWNLOAD_WGET_COUNT=$# 126local NVM_DOWNLOAD_WGET_SKIP 127NVM_DOWNLOAD_WGET_SKIP=0 128local NVM_DOWNLOAD_WGET_ARG 129for NVM_DOWNLOAD_WGET_ARG in "$@"; do 130 if [ "${NVM_DOWNLOAD_WGET_SKIP}" = '1' ]; then 131 NVM_DOWNLOAD_WGET_SKIP=0 132 continueFirst 10 of 25 lines.
- 11 lines in 2 placesbash73 tokens
4459if [ "${NVM_UPGRADE_NPM}" = 1 ]; then 4460 nvm install-latest-npm 4461 EXIT_CODE=$? 4462fi 4463if [ $EXIT_CODE -eq 0 ] && [ -z "${SKIP_DEFAULT_PACKAGES-}" ]; then 4464 nvm_install_default_packages 4465fi 4466if [ $EXIT_CODE -eq 0 ] && [ -n "${REINSTALL_PACKAGES_FROM-}" ] && [ "_${REINSTALL_PACKAGES_FROM}" != "_N/A" ]; then 4467 nvm reinstall-packages "${REINSTALL_PACKAGES_FROM}" 4468 EXIT_CODE=$?First 10 of 11 lines.
- 14 lines in 2 placesbash58 tokens
6 type "$1" > /dev/null 2>&1 7} 8 9# resolves like `command "${1}"` does: only executables on the PATH, 10# ignoring shell functions and aliases 11nvm_has_executable() { 12 ( 13 # `|| true` so that shells with errexit-style options (eg, zsh's ERR_RETURN) 14 # do not abort the subshell when the name is not an alias or a function 15 unalias "${1-}" 2>/dev/null || trueFirst 10 of 14 lines.
4 more
- 12 lines in 2 placesbash55 tokens
- 11 lines in 2 placesbash53 tokens
- 6 lines in 2 placesbash52 tokens
- 21 lines in 2 placesbash50 tokens
Largest clones over all files, tests and data included
- 522 lines in 2 placestxttests5,086 tokenstest/fast/Unit tests/mocks/nvm ls-remote node.txt:238–759test/fast/Unit tests/mocks/nvm ls-remote.txt:279–800
238v4.0.0 239v4.1.0 240v4.1.1 241v4.1.2 242v4.2.0 [0;37m (LTS: Argon)[0m 243v4.2.1 [0;37m (LTS: Argon)[0m 244v4.2.2 [0;37m (LTS: Argon)[0m 245v4.2.3 [0;37m (LTS: Argon)[0m 246v4.2.4 [0;37m (LTS: Argon)[0m 247v4.2.5 [0;37m (LTS: Argon)[0mFirst 10 of 522 lines.
- 242 lines in 2 placestxttests726 tokenstest/fast/Unit tests/mocks/nvm ls-remote node.txt:1–242test/fast/Unit tests/mocks/nvm_ls_remote.txt:1–242
1v0.1.14 2v0.1.15 3v0.1.16 4v0.1.17 5v0.1.18 6v0.1.19 7v0.1.20 8v0.1.21 9v0.1.22 10v0.1.23First 10 of 242 lines.
- 237 lines in 2 placestxttests711 tokenstest/fast/Unit tests/mocks/nvm ls-remote node.txt:1–237test/fast/Unit tests/mocks/nvm ls-remote.txt:1–237
1v0.1.14 2v0.1.15 3v0.1.16 4v0.1.17 5v0.1.18 6v0.1.19 7v0.1.20 8v0.1.21 9v0.1.22 10v0.1.23First 10 of 237 lines.
- 36 lines in 2 placestxttests649 tokens
- 34 lines in 2 placestxttests613 tokens
By format, code only
| Format | Files | Lines | Clones | Duplicated lines | Duplication |
|---|---|---|---|---|---|
| bash | 18 | 7,433 | 7 | 100 | 1.35% |
| perl | 1 | 168 | 0 | 0 | 0% |
By format, all files
| Format | Files | Lines | Clones | Duplicated lines | Duplication |
|---|---|---|---|---|---|
| bash | 347 | 21,043 | 47 | 744 | 3.54% |
| txt | 10 | 2,967 | 33 | 1,876 | 63.23% |
| yaml | 17 | 1,967 | 22 | 313 | 15.91% |
| markdown | 12 | 2,388 | 1 | 10 | 0.42% |
| perl | 1 | 168 | 0 | 0 | 0% |
| text | 3 | 88 | 0 | 0 | 0% |
| json | 1 | 53 | 0 | 0 | 0% |
Trending appearances
| Day | Rank | Stars | Files | Lines | Clones | All files | Code | Health | Commit |
|---|---|---|---|---|---|---|---|---|---|
| Oct 15, 2026 | #3 | 95,494 (+52) | 391 | 28,674 | 103 | 10.26% | — | B 70.4 | b1b3a00 |
| Sep 6, 2026 | #10 | 94,944 (+22) | 370 | 26,280 | 98 | 10.84% | — | — | ccb49e5 |
Want this for your own project? Install jscpd and run jscpd ., or measure it the way the baselines were measured.