From 73672794477689fcd2a4a07078442e935a2fff2a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 27 Jul 2026 09:26:01 +0000 Subject: [PATCH] Update website for v0.2.5 --- complexity.html | 28 ++++++++++++++-------------- index.html | 4 ++-- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/complexity.html b/complexity.html index d68ae25..918fd3a 100644 --- a/complexity.html +++ b/complexity.html @@ -44,23 +44,23 @@ -
STATIC ANALYSIS · PYTHON PRODUCTION SOURCE

Complexity report

The codebase is mostly made of small, low-complexity functions, but risk is concentrated in a few execution paths. src/sbx/cli.py contains 37.9% of production LOC; the peak is cmd_start at CC 46.

Snapshot 5254df1055ee · generated 2026-07-23 01:41 UTC · scope src/**/*.py

sbx low-fi pouch logo
+
STATIC ANALYSIS · PYTHON PRODUCTION SOURCE

Complexity report

The codebase is mostly made of small, low-complexity functions, but risk is concentrated in a few execution paths. src/sbx/cli.py contains 37.6% of production LOC; the peak is cmd_start at CC 56.

Snapshot 77d7b5847121 · generated 2026-07-27 09:26 UTC · scope src/**/*.py

sbx low-fi pouch logo

General health

-
3,772

physical source lines
3,313 nonblank/non-comment

-
160

functions + methods
2 classes

-
4.6

mean cyclomatic complexity
729 aggregate decisions

-
11

high-or-higher callables
6.9% of callables

+
3,941

physical source lines
3,456 nonblank/non-comment

+
166

functions + methods
2 classes

+
4.6

mean cyclomatic complexity
767 aggregate decisions

+
14

high-or-higher callables
8.4% of callables

-

Assessment: critical peak

Most callables are easy to reason about, but the maximum CC of 46 in cmd_start makes change risk uneven. Review high-complexity routines before adding more paths.

A 120B 29C+ 11

120 low (A), 29 moderate (B), 11 high or above (C–F).

-

Testability signal

166 test functions across 9 test modules and 4,174 test LOC (1.11× production LOC). This is a useful safety net, but runtime coverage was not re-measured for this static report, so no coverage percentage is claimed.

-

Complexity by module

ModuleLOCSLOCFunctionsClassesTotal CCMean CCMax CCMax rank
src/sbx/cli.py1,4301,2695102845.646F · critical
src/sbx/image/build_debian.py445393111443.721D · very high
src/sbx/network.py338293190844.414C · high
src/sbx/completion.py40938670243.413C · high
src/sbx/guest_setup.py379336150865.713C · high
src/sbx/doctor.py1029050377.412C · high
src/sbx/lifecycle_warnings.py181150130473.610B · moderate
src/sbx/image/ls.py856980334.18B · moderate
src/sbx/smolvm_preset.py80702084.07B · moderate
src/sbx/session_state.py685560223.77B · moderate
src/sbx/vm_metadata.py362740112.86B · moderate
src/sbx/runtime.py166132151422.85A · low
src/sbx/vm_state.py40323072.33A · low
src/sbx/constants.py1090000.00
src/sbx/__init__.py320000.00
src/sbx/image/__init__.py000000.00
src/sbx/image/resources/__init__.py000000.00

Total CC is useful for concentration, not a quality grade: larger modules naturally accumulate more paths. Max and mean CC should be read together.

-

High and superior complexity

Every callable at CC ≥ 11 is listed. These are the routines most likely to require extra review and focused tests when changed.

CallableSource linesLOCCCRankMax nestingParametersReturns
cmd_startfunctionsrc/sbx/cli.py:698–92622946F · critical4114
cmd_shellfunctionsrc/sbx/cli.py:939–10339527D · very high319
_start_local_imagefunctionsrc/sbx/cli.py:550–67412523D · very high2172
main_from_argsfunctionsrc/sbx/image/build_debian.py:312–43512421D · very high415
expose_auth_portfunctionsrc/sbx/network.py:138–2167914C · high348
_insert_missing_sbx_valuesfunctionsrc/sbx/cli.py:469–4932514C · high223
fish_completionfunctionsrc/sbx/completion.py:353–4095713C · high201
host_git_configfunctionsrc/sbx/guest_setup.py:81–1173713C · high313
doctor_metadatafunctionsrc/sbx/doctor.py:9–403212C · high314
_maybe_write_project_configfunctionsrc/sbx/cli.py:514–5473411C · high254
sync_forwarded_envfunctionsrc/sbx/guest_setup.py:173–2012911C · high242
-

Size hotspots

Long routines are shown separately because generated strings and parser declarations can be large while having few branches.

CallableSource linesLOCCCRank
cmd_startsrc/sbx/cli.py:698–92622946F · critical
build_parsersrc/sbx/cli.py:1231–14011713A · low
bash_completionsrc/sbx/completion.py:108–2331261A · low
_start_local_imagesrc/sbx/cli.py:550–67412523D · very high
main_from_argssrc/sbx/image/build_debian.py:312–43512421D · very high
_add_start_optionssrc/sbx/cli.py:1114–12281151A · low
zsh_completionsrc/sbx/completion.py:236–3441091A · low
cmd_shellsrc/sbx/cli.py:939–10339527D · very high
expose_auth_portsrc/sbx/network.py:138–2167914C · high
-

Classes

ClassSource linesLOCMethodsMethod CC totalMax method CCRank
SbxDockerImageBuildersrc/sbx/image/build_debian.py:85–9511111A · low
ConfigErrorsrc/sbx/runtime.py:16–172010A · low

0 classes have a high-complexity method.

-

Priority actions

Review first

  1. cmd_start — CC 46, 229 LOC at src/sbx/cli.py:698. Reduce branches along its existing execution paths before introducing new abstractions.
  2. cmd_shell — CC 27, 95 LOC at src/sbx/cli.py:939. Reduce branches along its existing execution paths before introducing new abstractions.
  3. _start_local_image — CC 23, 125 LOC at src/sbx/cli.py:550. Reduce branches along its existing execution paths before introducing new abstractions.
  4. main_from_args — CC 21, 124 LOC at src/sbx/image/build_debian.py:312. Reduce branches along its existing execution paths before introducing new abstractions.

Do not optimize for size alone

  • build_parser: 171 LOC but CC 3; size alone does not justify refactoring.
  • bash_completion: 126 LOC but CC 1; size alone does not justify refactoring.
  • _add_start_options: 115 LOC but CC 1; size alone does not justify refactoring.
  • zsh_completion: 109 LOC but CC 1; size alone does not justify refactoring.
-

Complete callable inventory

Show all 160 functions and methods
CallableSource linesLOCCCRankMax nestingParametersReturns
_deep_mergefunctionsrc/sbx/cli.py:43–5084A · low221
_read_tomlfunctionsrc/sbx/cli.py:53–63114A · low211
load_configfunctionsrc/sbx/cli.py:66–88235A · low211
_sectionfunctionsrc/sbx/cli.py:91–9773A · low122
_cfgfunctionsrc/sbx/cli.py:100–10121A · low041
_sbx_configfunctionsrc/sbx/cli.py:104–10521A · low011
_cfg_agentfunctionsrc/sbx/cli.py:108–11252A · low111
_list_valuefunctionsrc/sbx/cli.py:115–12286B · moderate123
_resolve_project_pathfunctionsrc/sbx/cli.py:125–12952A · low111
_project_identityfunctionsrc/sbx/cli.py:132–151204A · low321
_same_path_mountfunctionsrc/sbx/cli.py:154–15631A · low011
_workspace_mounts_from_specsfunctionsrc/sbx/cli.py:159–180227B · moderate221
_warn_running_mount_driftfunctionsrc/sbx/cli.py:183–201195A · low132
_sync_existing_vm_start_configfunctionsrc/sbx/cli.py:204–239369B · moderate252
_project_guest_cwdfunctionsrc/sbx/cli.py:242–24542A · low112
_sync_forwarded_env_or_errorfunctionsrc/sbx/cli.py:248–25472A · low122
_validate_cpusfunctionsrc/sbx/cli.py:257–26152A · low111
_validate_boot_timeoutfunctionsrc/sbx/cli.py:264–26852A · low111
_smolvm_info_vmfunctionsrc/sbx/cli.py:271–280105A · low113
_get_existing_vm_statusfunctionsrc/sbx/cli.py:283–28863A · low112
_print_tablefunctionsrc/sbx/cli.py:291–301117B · moderate120
cmd_listfunctionsrc/sbx/cli.py:304–324217B · moderate111
_print_boot_timeout_running_hintfunctionsrc/sbx/cli.py:327–342161A · low020
_maybe_print_boot_timeout_running_hintfunctionsrc/sbx/cli.py:345–35173A · low123
_start_existing_vm_if_neededfunctionsrc/sbx/cli.py:354–369164A · low133
_stop_vm_if_last_sessionfunctionsrc/sbx/cli.py:372–38093A · low122
_post_start_actionsfunctionsrc/sbx/cli.py:383–415335A · low2113
_arg_or_configfunctionsrc/sbx/cli.py:418–429123A · low162
_manifest_sbxfunctionsrc/sbx/cli.py:432–43652A · low111
_project_config_pathfunctionsrc/sbx/cli.py:439–44021A · low001
_toml_valuefunctionsrc/sbx/cli.py:443–45196B · moderate114
_project_config_valuesfunctionsrc/sbx/cli.py:454–466135A · low241
_insert_missing_sbx_valuesfunctionsrc/sbx/cli.py:469–4932514C · high223
_write_project_config_valuesfunctionsrc/sbx/cli.py:496–511164A · low222
_maybe_write_project_configfunctionsrc/sbx/cli.py:514–5473411C · high254
_start_local_imagefunctionsrc/sbx/cli.py:550–67412523D · very high2172
cmd_doctorfunctionsrc/sbx/cli.py:677–68262A · low011
cmd_completionfunctionsrc/sbx/cli.py:685–68731A · low011
cmd_image_build_debianfunctionsrc/sbx/cli.py:690–69121A · low011
cmd_image_lsfunctionsrc/sbx/cli.py:694–69521A · low011
cmd_startfunctionsrc/sbx/cli.py:698–92622946F · critical4114
_confirm_destructive_actionfunctionsrc/sbx/cli.py:929–93683A · low123
cmd_shellfunctionsrc/sbx/cli.py:939–10339527D · very high319
cmd_stopfunctionsrc/sbx/cli.py:1036–104162A · low112
cmd_removefunctionsrc/sbx/cli.py:1044–105183A · low113
_delete_vmfunctionsrc/sbx/cli.py:1054–10833010B · moderate324
cmd_createfunctionsrc/sbx/cli.py:1086–109052A · low111
cmd_recreatefunctionsrc/sbx/cli.py:1093–1111197B · moderate114
_add_start_optionsfunctionsrc/sbx/cli.py:1114–12281151A · low010
build_parserfunctionsrc/sbx/cli.py:1231–14011713A · low101
mainfunctionsrc/sbx/cli.py:1404–1426236B · moderate214
_wordsfunctionsrc/sbx/completion.py:90–9121A · low011
_zsh_wordsfunctionsrc/sbx/completion.py:94–9522A · low011
completion_scriptfunctionsrc/sbx/completion.py:98–10584A · low113
bash_completionfunctionsrc/sbx/completion.py:108–2331261A · low001
zsh_completionfunctionsrc/sbx/completion.py:236–3441091A · low001
_fish_flagfunctionsrc/sbx/completion.py:347–35042A · low112
fish_completionfunctionsrc/sbx/completion.py:353–4095713C · high201
doctor_metadatafunctionsrc/sbx/doctor.py:9–403212C · high314
doctor_sessionsfunctionsrc/sbx/doctor.py:43–611910B · moderate310
doctor_tunnelsfunctionsrc/sbx/doctor.py:64–832010B · moderate410
doctor_error_vmsfunctionsrc/sbx/doctor.py:86–9494A · low210
run_doctor_checksfunctionsrc/sbx/doctor.py:97–10261A · low011
validate_vm_namefunctionsrc/sbx/guest_setup.py:29–3572A · low111
validate_run_userfunctionsrc/sbx/guest_setup.py:38–4142A · low111
validate_env_namesfunctionsrc/sbx/guest_setup.py:44–4854A · low111
sanitize_forwarded_envfunctionsrc/sbx/guest_setup.py:51–5663A · low221
credential_free_envfunctionsrc/sbx/guest_setup.py:59–78201A · low021
host_git_configfunctionsrc/sbx/guest_setup.py:81–1173713C · high313
parse_managed_env_scriptfunctionsrc/sbx/guest_setup.py:120–12895A · low311
sync_forwarded_env_direct_sshfunctionsrc/sbx/guest_setup.py:131–1704010B · moderate150
sync_forwarded_envfunctionsrc/sbx/guest_setup.py:173–2012911C · high242
host_timezonefunctionsrc/sbx/guest_setup.py:204–215124A · low103
sync_guest_clockfunctionsrc/sbx/guest_setup.py:218–244276B · moderate130
set_hostnamefunctionsrc/sbx/guest_setup.py:247–275296B · moderate130
install_git_configfunctionsrc/sbx/guest_setup.py:278–313368B · moderate151
prepare_run_userfunctionsrc/sbx/guest_setup.py:316–352376B · moderate140
attachfunctionsrc/sbx/guest_setup.py:355–379255A · low161
_packaged_resourcesfunctionsrc/sbx/image/build_debian.py:46–4831A · low100
_default_public_keyfunctionsrc/sbx/image/build_debian.py:51–5773A · low202
_compose_containerfilesfunctionsrc/sbx/image/build_debian.py:60–82235A · low240
SbxDockerImageBuilder._default_init_scriptmethodsrc/sbx/image/build_debian.py:86–95101A · low011
_downloadfunctionsrc/sbx/image/build_debian.py:98–10031A · low120
_build_kernel_builder_imagefunctionsrc/sbx/image/build_debian.py:103–120182A · low121
_docker_run_kernel_builderfunctionsrc/sbx/image/build_debian.py:123–139171A · low040
_build_docker_kernelfunctionsrc/sbx/image/build_debian.py:142–199584A · low232
_build_containerfile_base_imagefunctionsrc/sbx/image/build_debian.py:202–239383A · low131
add_argumentsfunctionsrc/sbx/image/build_debian.py:242–309681A · low010
main_from_argsfunctionsrc/sbx/image/build_debian.py:312–43512421D · very high415
mainfunctionsrc/sbx/image/build_debian.py:438–44141A · low011
_image_cache_dirfunctionsrc/sbx/image/ls.py:7–821A · low001
_manifestfunctionsrc/sbx/image/ls.py:11–20105A · low114
_featuresfunctionsrc/sbx/image/ls.py:23–2644A · low112
_image_rowfunctionsrc/sbx/image/ls.py:29–43155A · low112
_imagesfunctionsrc/sbx/image/ls.py:46–5167B · moderate112
_print_tablefunctionsrc/sbx/image/ls.py:54–72198B · moderate110
add_argumentsfunctionsrc/sbx/image/ls.py:75–7621A · low010
main_from_argsfunctionsrc/sbx/image/ls.py:79–8572A · low111
cfgfunctionsrc/sbx/lifecycle_warnings.py:14–1852A · low142
int_or_nonefunctionsrc/sbx/lifecycle_warnings.py:21–2773A · low113
ceil_mibfunctionsrc/sbx/lifecycle_warnings.py:30–3121A · low011
qcow2_virtual_size_mibfunctionsrc/sbx/lifecycle_warnings.py:34–51184A · low114
rootfs_size_mibfunctionsrc/sbx/lifecycle_warnings.py:54–6073A · low113
path_from_configfunctionsrc/sbx/lifecycle_warnings.py:63–6642A · low112
local_image_manifestfunctionsrc/sbx/lifecycle_warnings.py:69–81135A · low111
manifest_pathfunctionsrc/sbx/lifecycle_warnings.py:84–9183A · low131
local_image_rootfs_size_mibfunctionsrc/sbx/lifecycle_warnings.py:94–103103A · low213
local_image_disk_size_errorfunctionsrc/sbx/lifecycle_warnings.py:106–11491A · low021
local_image_config_warningsfunctionsrc/sbx/lifecycle_warnings.py:117–12484A · low113
existing_vm_config_mismatchesfunctionsrc/sbx/lifecycle_warnings.py:127–151256B · moderate232
doctor_config_statefunctionsrc/sbx/lifecycle_warnings.py:154–1812810B · moderate322
_validate_portfunctionsrc/sbx/network.py:28–3583A · low121
parse_port_forwardfunctionsrc/sbx/network.py:38–52156B · moderate212
port_forwards_from_specsfunctionsrc/sbx/network.py:55–5953A · low011
_load_tunnelsfunctionsrc/sbx/network.py:62–6321A · low001
_save_tunnelsfunctionsrc/sbx/network.py:66–6721A · low010
_tracked_auth_tunnelfunctionsrc/sbx/network.py:70–7784A · low113
_tracked_auth_tunnel_for_host_portfunctionsrc/sbx/network.py:80–90117B · moderate212
_record_auth_tunnelfunctionsrc/sbx/network.py:93–10081A · low040
_remove_auth_tunnel_recordfunctionsrc/sbx/network.py:103–11083A · low210
_localhost_port_is_listeningfunctionsrc/sbx/network.py:113–11641A · low111
_close_tracked_auth_tunnelfunctionsrc/sbx/network.py:119–135175A · low212
expose_auth_portfunctionsrc/sbx/network.py:138–2167914C · high348
_foreground_port_forwardfunctionsrc/sbx/network.py:219–229113A · low121
cmd_forwardfunctionsrc/sbx/network.py:232–251207B · moderate213
cmd_auth_portfunctionsrc/sbx/network.py:254–26072A · low112
cmd_close_auth_portfunctionsrc/sbx/network.py:263–273113A · low113
_port_forward_detailfunctionsrc/sbx/network.py:276–288135A · low113
_vm_port_forward_detailsfunctionsrc/sbx/network.py:291–29776B · moderate112
cmd_statusfunctionsrc/sbx/network.py:300–338399B · moderate214
vm_name_from_arg_or_configfunctionsrc/sbx/runtime.py:20–30115A · low132
debugfunctionsrc/sbx/runtime.py:33–3532A · low110
debug_commandfunctionsrc/sbx/runtime.py:38–47105A · low020
runfunctionsrc/sbx/runtime.py:50–61124A · low133
run_capturefunctionsrc/sbx/runtime.py:64–84215A · low222
smolvm_argvfunctionsrc/sbx/runtime.py:87–9371A · low011
env_booleanfunctionsrc/sbx/runtime.py:96–9722A · low011
smolvm_envfunctionsrc/sbx/runtime.py:100–10453A · low111
run_smolvmfunctionsrc/sbx/runtime.py:107–10931A · low011
run_smolvm_capturefunctionsrc/sbx/runtime.py:112–11651A · low011
missing_vm_messagefunctionsrc/sbx/runtime.py:119–12351A · low011
ssh_commandfunctionsrc/sbx/runtime.py:126–137122A · low111
read_json_objectfunctionsrc/sbx/runtime.py:140–149105A · low223
write_json_objectfunctionsrc/sbx/runtime.py:152–15431A · low030
pid_is_alivefunctionsrc/sbx/runtime.py:157–166104A · low114
load_sessionsfunctionsrc/sbx/session_state.py:9–1021A · low001
save_sessionsfunctionsrc/sbx/session_state.py:13–1421A · low010
live_sessionsfunctionsrc/sbx/session_state.py:17–27117B · moderate011
active_sessionsfunctionsrc/sbx/session_state.py:30–41125A · low211
register_sessionfunctionsrc/sbx/session_state.py:44–4961A · low020
unregister_sessionfunctionsrc/sbx/session_state.py:52–68177B · moderate111
_environmentfunctionsrc/sbx/smolvm_preset.py:18–2691A · low110
create_presetfunctionsrc/sbx/smolvm_preset.py:29–80527B · moderate3121
load_vm_metadatafunctionsrc/sbx/vm_metadata.py:7–16106B · moderate301
save_vm_metadatafunctionsrc/sbx/vm_metadata.py:19–2021A · low010
record_vm_projectfunctionsrc/sbx/vm_metadata.py:23–2641A · low020
validate_vm_projectfunctionsrc/sbx/vm_metadata.py:29–3683A · low120
smolvm_vmsfunctionsrc/sbx/vm_state.py:8–1362A · low011
existing_vm_start_configfunctionsrc/sbx/vm_state.py:16–25103A · low113
mark_error_vm_stopped_for_restartfunctionsrc/sbx/vm_state.py:28–40132A · low111
-

Methodology

Cyclomatic complexity (CC) starts at 1 and adds paths for branches, loops, exception handlers, boolean branches, assertions, comprehensions, ternaries, and match cases. Ratings follow common McCabe bands:

A · low B · moderate C · high D · very high E · severe F · critical

LOC spans the AST definition from first to last source line. SLOC excludes blank and comment-only lines. Max nesting counts nested control structures. Parameters include positional and keyword-only arguments; returns count explicit return statements.

This is deterministic static analysis, not a runtime profile. CC estimates branching difficulty; it does not measure correctness, coupling, duplication, performance, or test coverage. Line references apply only to commit 5254df1055ee45d4284844a7d01380447c100acb.

+

Assessment: critical peak

Most callables are easy to reason about, but the maximum CC of 56 in cmd_start makes change risk uneven. Review high-complexity routines before adding more paths.

A 125B 27C+ 14

125 low (A), 27 moderate (B), 14 high or above (C–F).

+

Testability signal

186 test functions across 10 test modules and 4,490 test LOC (1.14× production LOC). This is a useful safety net, but runtime coverage was not re-measured for this static report, so no coverage percentage is claimed.

+

Complexity by module

ModuleLOCSLOCFunctionsClassesTotal CCMean CCMax CCMax rank
src/sbx/cli.py1,4821,3145303206.056F · critical
src/sbx/image/build_debian.py491430121433.314C · high
src/sbx/network.py344299190834.414C · high
src/sbx/completion.py39036770243.413C · high
src/sbx/guest_setup.py379336150865.713C · high
src/sbx/doctor.py1029050377.412C · high
src/sbx/lifecycle_warnings.py181150130473.610B · moderate
src/sbx/image/ls.py856980334.18B · moderate
src/sbx/smolvm_preset.py80702084.07B · moderate
src/sbx/session_state.py685560223.77B · moderate
src/sbx/vm_metadata.py362740112.86B · moderate
src/sbx/runtime.py166132151422.85A · low
src/sbx/vm_state.py40323072.33A · low
src/sbx/image/kernel_inputs.py84743041.32A · low
src/sbx/constants.py1090000.00
src/sbx/__init__.py320000.00
src/sbx/image/__init__.py000000.00
src/sbx/image/resources/__init__.py000000.00

Total CC is useful for concentration, not a quality grade: larger modules naturally accumulate more paths. Max and mean CC should be read together.

+

High and superior complexity

Every callable at CC ≥ 11 is listed. These are the routines most likely to require extra review and focused tests when changed.

CallableSource linesLOCCCRankMax nestingParametersReturns
cmd_startfunctionsrc/sbx/cli.py:787–104225656F · critical5115
_start_local_imagefunctionsrc/sbx/cli.py:628–76313626D · very high2172
cmd_shellfunctionsrc/sbx/cli.py:1055–11479326D · very high319
main_from_argsfunctionsrc/sbx/image/build_debian.py:375–48110714C · high413
expose_auth_portfunctionsrc/sbx/network.py:138–2167914C · high348
_start_existing_vm_if_neededfunctionsrc/sbx/cli.py:369–4104214C · high345
_maybe_write_project_configfunctionsrc/sbx/cli.py:564–6034014C · high354
_insert_missing_sbx_valuesfunctionsrc/sbx/cli.py:519–5432514C · high223
fish_completionfunctionsrc/sbx/completion.py:334–3905713C · high201
host_git_configfunctionsrc/sbx/guest_setup.py:81–1173713C · high313
_delete_vmfunctionsrc/sbx/cli.py:1168–11993212C · high334
doctor_metadatafunctionsrc/sbx/doctor.py:9–403212C · high314
cmd_statusfunctionsrc/sbx/network.py:291–3445411C · high214
sync_forwarded_envfunctionsrc/sbx/guest_setup.py:173–2012911C · high242
+

Size hotspots

Long routines are shown separately because generated strings and parser declarations can be large while having few branches.

CallableSource linesLOCCCRank
cmd_startsrc/sbx/cli.py:787–104225656F · critical
build_parsersrc/sbx/cli.py:1298–14531564A · low
_start_local_imagesrc/sbx/cli.py:628–76313626D · very high
bash_completionsrc/sbx/completion.py:86–2121271A · low
zsh_completionsrc/sbx/completion.py:215–3251111A · low
main_from_argssrc/sbx/image/build_debian.py:375–48110714C · high
cmd_shellsrc/sbx/cli.py:1055–11479326D · very high
expose_auth_portsrc/sbx/network.py:138–2167914C · high
+

Classes

ClassSource linesLOCMethodsMethod CC totalMax method CCRank
SbxImageBuildersrc/sbx/image/build_debian.py:67–7711111A · low
ConfigErrorsrc/sbx/runtime.py:16–172010A · low

0 classes have a high-complexity method.

+

Priority actions

Review first

  1. cmd_start — CC 56, 256 LOC at src/sbx/cli.py:787. Reduce branches along its existing execution paths before introducing new abstractions.
  2. _start_local_image — CC 26, 136 LOC at src/sbx/cli.py:628. Reduce branches along its existing execution paths before introducing new abstractions.
  3. cmd_shell — CC 26, 93 LOC at src/sbx/cli.py:1055. Reduce branches along its existing execution paths before introducing new abstractions.
  4. main_from_args — CC 14, 107 LOC at src/sbx/image/build_debian.py:375. Reduce branches along its existing execution paths before introducing new abstractions.

Do not optimize for size alone

  • build_parser: 156 LOC but CC 4; size alone does not justify refactoring.
  • bash_completion: 127 LOC but CC 1; size alone does not justify refactoring.
  • zsh_completion: 111 LOC but CC 1; size alone does not justify refactoring.
+

Complete callable inventory

Show all 166 functions and methods
CallableSource linesLOCCCRankMax nestingParametersReturns
_deep_mergefunctionsrc/sbx/cli.py:43–5084A · low221
_read_tomlfunctionsrc/sbx/cli.py:53–63114A · low211
load_configfunctionsrc/sbx/cli.py:66–88235A · low211
_sectionfunctionsrc/sbx/cli.py:91–9773A · low122
_cfgfunctionsrc/sbx/cli.py:100–10121A · low041
_sbx_configfunctionsrc/sbx/cli.py:104–10521A · low011
_cfg_agentfunctionsrc/sbx/cli.py:108–11252A · low111
_list_valuefunctionsrc/sbx/cli.py:115–12286B · moderate123
_resolve_project_pathfunctionsrc/sbx/cli.py:125–12952A · low111
_project_identityfunctionsrc/sbx/cli.py:132–151204A · low321
_same_path_mountfunctionsrc/sbx/cli.py:154–15631A · low011
_workspace_mounts_from_specsfunctionsrc/sbx/cli.py:159–180227B · moderate221
_warn_running_mount_driftfunctionsrc/sbx/cli.py:183–201195A · low132
_sync_existing_vm_start_configfunctionsrc/sbx/cli.py:204–239369B · moderate252
_project_guest_cwdfunctionsrc/sbx/cli.py:242–24542A · low112
_sync_forwarded_env_or_errorfunctionsrc/sbx/cli.py:248–25472A · low122
_validate_cpusfunctionsrc/sbx/cli.py:257–26152A · low111
_validate_boot_timeoutfunctionsrc/sbx/cli.py:264–26852A · low111
_smolvm_info_vmfunctionsrc/sbx/cli.py:271–280105A · low113
_get_existing_vm_statusfunctionsrc/sbx/cli.py:283–28863A · low112
_print_tablefunctionsrc/sbx/cli.py:291–301117B · moderate120
cmd_listfunctionsrc/sbx/cli.py:304–3393610B · moderate111
_print_boot_timeout_running_hintfunctionsrc/sbx/cli.py:342–357161A · low020
_maybe_print_boot_timeout_running_hintfunctionsrc/sbx/cli.py:360–36673A · low123
_start_existing_vm_if_neededfunctionsrc/sbx/cli.py:369–4104214C · high345
_stop_vm_if_last_sessionfunctionsrc/sbx/cli.py:413–42193A · low122
_post_start_actionsfunctionsrc/sbx/cli.py:424–456335A · low2113
_arg_or_configfunctionsrc/sbx/cli.py:459–470123A · low162
_manifest_sbxfunctionsrc/sbx/cli.py:473–47752A · low111
_manifest_run_userfunctionsrc/sbx/cli.py:480–48673A · low112
_project_config_pathfunctionsrc/sbx/cli.py:489–49021A · low001
_toml_valuefunctionsrc/sbx/cli.py:493–50196B · moderate114
_project_config_valuesfunctionsrc/sbx/cli.py:504–516135A · low241
_insert_missing_sbx_valuesfunctionsrc/sbx/cli.py:519–5432514C · high223
_write_project_config_valuesfunctionsrc/sbx/cli.py:546–561164A · low222
_maybe_write_project_configfunctionsrc/sbx/cli.py:564–6034014C · high354
_print_createdfunctionsrc/sbx/cli.py:606–625204A · low250
_start_local_imagefunctionsrc/sbx/cli.py:628–76313626D · very high2172
cmd_doctorfunctionsrc/sbx/cli.py:766–77162A · low011
cmd_completionfunctionsrc/sbx/cli.py:774–77631A · low011
cmd_image_buildfunctionsrc/sbx/cli.py:779–78021A · low011
cmd_image_lsfunctionsrc/sbx/cli.py:783–78421A · low011
cmd_startfunctionsrc/sbx/cli.py:787–104225656F · critical5115
_confirm_destructive_actionfunctionsrc/sbx/cli.py:1045–105283A · low123
cmd_shellfunctionsrc/sbx/cli.py:1055–11479326D · very high319
cmd_stopfunctionsrc/sbx/cli.py:1150–115562A · low112
cmd_removefunctionsrc/sbx/cli.py:1158–116583A · low113
_delete_vmfunctionsrc/sbx/cli.py:1168–11993212C · high334
cmd_createfunctionsrc/sbx/cli.py:1202–120541A · low011
cmd_recreatefunctionsrc/sbx/cli.py:1208–1226196B · moderate114
_add_start_optionsfunctionsrc/sbx/cli.py:1229–1295671A · low010
build_parserfunctionsrc/sbx/cli.py:1298–14531564A · low101
mainfunctionsrc/sbx/cli.py:1456–1478236B · moderate214
_wordsfunctionsrc/sbx/completion.py:68–6921A · low011
_zsh_wordsfunctionsrc/sbx/completion.py:72–7322A · low011
completion_scriptfunctionsrc/sbx/completion.py:76–8384A · low113
bash_completionfunctionsrc/sbx/completion.py:86–2121271A · low001
zsh_completionfunctionsrc/sbx/completion.py:215–3251111A · low001
_fish_flagfunctionsrc/sbx/completion.py:328–33142A · low112
fish_completionfunctionsrc/sbx/completion.py:334–3905713C · high201
doctor_metadatafunctionsrc/sbx/doctor.py:9–403212C · high314
doctor_sessionsfunctionsrc/sbx/doctor.py:43–611910B · moderate310
doctor_tunnelsfunctionsrc/sbx/doctor.py:64–832010B · moderate410
doctor_error_vmsfunctionsrc/sbx/doctor.py:86–9494A · low210
run_doctor_checksfunctionsrc/sbx/doctor.py:97–10261A · low011
validate_vm_namefunctionsrc/sbx/guest_setup.py:29–3572A · low111
validate_run_userfunctionsrc/sbx/guest_setup.py:38–4142A · low111
validate_env_namesfunctionsrc/sbx/guest_setup.py:44–4854A · low111
sanitize_forwarded_envfunctionsrc/sbx/guest_setup.py:51–5663A · low221
credential_free_envfunctionsrc/sbx/guest_setup.py:59–78201A · low021
host_git_configfunctionsrc/sbx/guest_setup.py:81–1173713C · high313
parse_managed_env_scriptfunctionsrc/sbx/guest_setup.py:120–12895A · low311
sync_forwarded_env_direct_sshfunctionsrc/sbx/guest_setup.py:131–1704010B · moderate150
sync_forwarded_envfunctionsrc/sbx/guest_setup.py:173–2012911C · high242
host_timezonefunctionsrc/sbx/guest_setup.py:204–215124A · low103
sync_guest_clockfunctionsrc/sbx/guest_setup.py:218–244276B · moderate130
set_hostnamefunctionsrc/sbx/guest_setup.py:247–275296B · moderate130
install_git_configfunctionsrc/sbx/guest_setup.py:278–313368B · moderate151
prepare_run_userfunctionsrc/sbx/guest_setup.py:316–352376B · moderate140
attachfunctionsrc/sbx/guest_setup.py:355–379255A · low161
_packaged_resourcesfunctionsrc/sbx/image/build_debian.py:37–3931A · low100
_compose_containerfilesfunctionsrc/sbx/image/build_debian.py:42–64234A · low140
SbxImageBuilder._default_init_scriptmethodsrc/sbx/image/build_debian.py:68–77101A · low011
_ssh_rootfs_dockerfilefunctionsrc/sbx/image/build_debian.py:80–103241A · low011
_build_rootfsfunctionsrc/sbx/image/build_debian.py:106–158535A · low152
_build_kernel_builder_imagefunctionsrc/sbx/image/build_debian.py:161–178182A · low121
_docker_run_kernel_builderfunctionsrc/sbx/image/build_debian.py:181–197171A · low040
_raise_if_linux_digest_mismatchfunctionsrc/sbx/image/build_debian.py:200–214153A · low111
_build_docker_kernelfunctionsrc/sbx/image/build_debian.py:217–278626B · moderate332
_build_containerfile_base_imagefunctionsrc/sbx/image/build_debian.py:281–318383A · low131
add_argumentsfunctionsrc/sbx/image/build_debian.py:321–372521A · low010
main_from_argsfunctionsrc/sbx/image/build_debian.py:375–48110714C · high413
mainfunctionsrc/sbx/image/build_debian.py:484–48741A · low011
raw_urlfunctionsrc/sbx/image/kernel_inputs.py:58–5921A · low031
fetchfunctionsrc/sbx/image/kernel_inputs.py:62–6431A · low111
download_verifiedfunctionsrc/sbx/image/kernel_inputs.py:67–84182A · low130
_image_cache_dirfunctionsrc/sbx/image/ls.py:7–821A · low001
_manifestfunctionsrc/sbx/image/ls.py:11–20105A · low114
_featuresfunctionsrc/sbx/image/ls.py:23–2644A · low112
_image_rowfunctionsrc/sbx/image/ls.py:29–43155A · low112
_imagesfunctionsrc/sbx/image/ls.py:46–5167B · moderate112
_print_tablefunctionsrc/sbx/image/ls.py:54–72198B · moderate110
add_argumentsfunctionsrc/sbx/image/ls.py:75–7621A · low010
main_from_argsfunctionsrc/sbx/image/ls.py:79–8572A · low111
cfgfunctionsrc/sbx/lifecycle_warnings.py:14–1852A · low142
int_or_nonefunctionsrc/sbx/lifecycle_warnings.py:21–2773A · low113
ceil_mibfunctionsrc/sbx/lifecycle_warnings.py:30–3121A · low011
qcow2_virtual_size_mibfunctionsrc/sbx/lifecycle_warnings.py:34–51184A · low114
rootfs_size_mibfunctionsrc/sbx/lifecycle_warnings.py:54–6073A · low113
path_from_configfunctionsrc/sbx/lifecycle_warnings.py:63–6642A · low112
local_image_manifestfunctionsrc/sbx/lifecycle_warnings.py:69–81135A · low111
manifest_pathfunctionsrc/sbx/lifecycle_warnings.py:84–9183A · low131
local_image_rootfs_size_mibfunctionsrc/sbx/lifecycle_warnings.py:94–103103A · low213
local_image_disk_size_errorfunctionsrc/sbx/lifecycle_warnings.py:106–11491A · low021
local_image_config_warningsfunctionsrc/sbx/lifecycle_warnings.py:117–12484A · low113
existing_vm_config_mismatchesfunctionsrc/sbx/lifecycle_warnings.py:127–151256B · moderate232
doctor_config_statefunctionsrc/sbx/lifecycle_warnings.py:154–1812810B · moderate322
_validate_portfunctionsrc/sbx/network.py:28–3583A · low121
parse_port_forwardfunctionsrc/sbx/network.py:38–52156B · moderate212
port_forwards_from_specsfunctionsrc/sbx/network.py:55–5953A · low011
_load_tunnelsfunctionsrc/sbx/network.py:62–6321A · low001
_save_tunnelsfunctionsrc/sbx/network.py:66–6721A · low010
_tracked_auth_tunnelfunctionsrc/sbx/network.py:70–7784A · low113
_tracked_auth_tunnel_for_host_portfunctionsrc/sbx/network.py:80–90117B · moderate212
_record_auth_tunnelfunctionsrc/sbx/network.py:93–10081A · low040
_remove_auth_tunnel_recordfunctionsrc/sbx/network.py:103–11083A · low210
_localhost_port_is_listeningfunctionsrc/sbx/network.py:113–11641A · low111
_close_tracked_auth_tunnelfunctionsrc/sbx/network.py:119–135175A · low212
expose_auth_portfunctionsrc/sbx/network.py:138–2167914C · high348
_foreground_port_forwardfunctionsrc/sbx/network.py:219–229113A · low121
cmd_forwardfunctionsrc/sbx/network.py:232–242114A · low113
cmd_auth_portfunctionsrc/sbx/network.py:245–25172A · low112
cmd_close_auth_portfunctionsrc/sbx/network.py:254–264113A · low113
_port_forward_detailfunctionsrc/sbx/network.py:267–279135A · low113
_vm_port_forward_detailsfunctionsrc/sbx/network.py:282–28876B · moderate112
cmd_statusfunctionsrc/sbx/network.py:291–3445411C · high214
vm_name_from_arg_or_configfunctionsrc/sbx/runtime.py:20–30115A · low132
debugfunctionsrc/sbx/runtime.py:33–3532A · low110
debug_commandfunctionsrc/sbx/runtime.py:38–47105A · low020
runfunctionsrc/sbx/runtime.py:50–61124A · low133
run_capturefunctionsrc/sbx/runtime.py:64–84215A · low222
smolvm_argvfunctionsrc/sbx/runtime.py:87–9371A · low011
env_booleanfunctionsrc/sbx/runtime.py:96–9722A · low011
smolvm_envfunctionsrc/sbx/runtime.py:100–10453A · low111
run_smolvmfunctionsrc/sbx/runtime.py:107–10931A · low011
run_smolvm_capturefunctionsrc/sbx/runtime.py:112–11651A · low011
missing_vm_messagefunctionsrc/sbx/runtime.py:119–12351A · low011
ssh_commandfunctionsrc/sbx/runtime.py:126–137122A · low111
read_json_objectfunctionsrc/sbx/runtime.py:140–149105A · low223
write_json_objectfunctionsrc/sbx/runtime.py:152–15431A · low030
pid_is_alivefunctionsrc/sbx/runtime.py:157–166104A · low114
load_sessionsfunctionsrc/sbx/session_state.py:9–1021A · low001
save_sessionsfunctionsrc/sbx/session_state.py:13–1421A · low010
live_sessionsfunctionsrc/sbx/session_state.py:17–27117B · moderate011
active_sessionsfunctionsrc/sbx/session_state.py:30–41125A · low211
register_sessionfunctionsrc/sbx/session_state.py:44–4961A · low020
unregister_sessionfunctionsrc/sbx/session_state.py:52–68177B · moderate111
_environmentfunctionsrc/sbx/smolvm_preset.py:18–2691A · low110
create_presetfunctionsrc/sbx/smolvm_preset.py:29–80527B · moderate3121
load_vm_metadatafunctionsrc/sbx/vm_metadata.py:7–16106B · moderate301
save_vm_metadatafunctionsrc/sbx/vm_metadata.py:19–2021A · low010
record_vm_projectfunctionsrc/sbx/vm_metadata.py:23–2641A · low020
validate_vm_projectfunctionsrc/sbx/vm_metadata.py:29–3683A · low120
smolvm_vmsfunctionsrc/sbx/vm_state.py:8–1362A · low011
existing_vm_start_configfunctionsrc/sbx/vm_state.py:16–25103A · low113
mark_error_vm_stopped_for_restartfunctionsrc/sbx/vm_state.py:28–40132A · low111
+

Methodology

Cyclomatic complexity (CC) starts at 1 and adds paths for branches, loops, exception handlers, boolean branches, assertions, comprehensions, ternaries, and match cases. Ratings follow common McCabe bands:

A · low B · moderate C · high D · very high E · severe F · critical

LOC spans the AST definition from first to last source line. SLOC excludes blank and comment-only lines. Max nesting counts nested control structures. Parameters include positional and keyword-only arguments; returns count explicit return statements.

This is deterministic static analysis, not a runtime profile. CC estimates branching difficulty; it does not measure correctness, coupling, duplication, performance, or test coverage. Line references apply only to commit 77d7b58471212918e249e2413d7dc2f7b9e8a6d9.

\ No newline at end of file diff --git a/index.html b/index.html index 373f4c9..04ec610 100644 --- a/index.html +++ b/index.html @@ -172,7 +172,7 @@

Summoning steps / Installation

aria-label="Example terminal commands" >
# install the released tool and check the defaults
-$ uv tool install git+https://github.com/nueces/sbx.git@v0.2.4
+$ uv tool install git+https://github.com/nueces/sbx.git@v0.2.5
 $ sbx doctor
 
 # select your quest and jump into it
@@ -331,7 +331,7 @@ 

Not public-ready yet