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

Analyzed October 15, 2026 at b1b3a00 (master) with jscpd v5 in 1.5s.

B70.4/100
Project health20,966 lines of code (M)
Duplication75
3.5% in bash, perl
Dead coden/a
the languages dead code reads are under 5% of the code
Complexity66
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

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    continue
    

    First 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 || true
    

    First 10 of 14 lines.

4 more
Largest clones over all files, tests and data included
By format, code only
FormatFilesLinesClonesDuplicated linesDuplication
bash187,43371001.35%
perl1168000%
By format, all files
FormatFilesLinesClonesDuplicated linesDuplication
bash34721,043477443.54%
txt102,967331,87663.23%
yaml171,9672231315.91%
markdown122,3881100.42%
perl1168000%
text388000%
json153000%

Trending appearances

DayRankStarsFilesLinesClonesAll filesCodeHealthCommit
Oct 15, 2026#395,494 (+52)39128,67410310.26%—B 70.4b1b3a00
Sep 6, 2026#1094,944 (+22)37026,2809810.84%——ccb49e5

Want this for your own project? Install jscpd and run jscpd ., or measure it the way the baselines were measured.