Skip to content

Code Health

github-actions[bot] edited this page Nov 22, 2026 · 1 revision

Code Health

Measured at v2026.47 (8e5f39f6e), 2026-11-22. Rebuilt on every release from the code; nothing here is edited by hand.

How to help: pick a task under Pick up a cleanup; check the Code health section in your pull request's checks summary, which shows what your change improves; read how this is measured.

Scorecard

Structure

Measure Now Since last release Next milestone Trend Long-term
Upward dependencies (files) 196 — worse than the baseline (180) 0
Upward module pairs 32 — ▱▱▱▱▱▱▱▱▱▱ 0% to 16 0
Modules that use each other 26 — ▱▱▱▱▱▱▱▱▱▱ 0% to 13 0
Files over 3,000 lines 60 — worse than the baseline (59) 0
Functions over 150 lines 553 — worse than the baseline (532) 0
Top-level Message variants — — lower

Robustness

Measure Now Since last release Next milestone Trend Long-term
unwrap/expect/panic! in production code 663 — ▱▱▱▱▱▱▱▱▱▱ 2% to 335 lower
unwrap/expect/panic! in file import and export (src/io) 15 — worse than the baseline (8) 0
unsafe without a SAFETY note 108 — worse than the baseline (105) 0

Hygiene

Measure Now Since last release Next milestone Trend Long-term
Clippy warnings 29 — ▱▱▱▱▱▱▱▱▱▱ 0% to 14 0
Compiler warnings 3 — ▱▱▱▱▱▱▱▱▱▱ 0% to 1 0
Files rustfmt would change 394 — ▱▱▱▱▱▱▱▱▱▱ 0% to 197 0

Tests & dependencies

Measure Now Since last release Next milestone Trend Long-term
Line coverage of the core layers (%) 62.1 — ▱▱▱▱▱▱▱▱▱▱ 0% to 67.1 100
Test functions (#[test]) 7,830 — ▰▰▰▰▰▱▱▱▱▱ 45% to 8,241 higher
RustSec advisories in dependencies 36 — ▱▱▱▱▱▱▱▱▱▱ 0% to 18 0
Crates in the dependency tree 809 — keep at or below 809 lower

Coverage by layer

Line coverage of production code in each core layer (test code, generated files and the excluded paths are left out).

Layer Coverage Lines not run by tests Since last release Trend
0 Foundations 61.3% 541 —
1 Drawing model and geometry 53.8% 22,865 —
2 File formats and rendering 73.4% 33,550 —
3 Tool contract and plugin runtime 63.6% 1,217 —
4 Features (modules) 49.8% 41,538 —

Thanks

Contributors whose merged work improved a measure in this release, in alphabetical order:

Pick up a cleanup

Remove a whole upward dependency

Each of these is the only use of a higher module by a lower one. Moving the item to a lower module (or passing it in) removes the dependency. Pure moves are easiest to review.

  • Move ui::overlay::TRACKING_DASH_PX to a lower layer (or pass it in), used at src/command.rs:1085. Removes the command -> ui dependency. Size: one file.
  • Move ui::window::table_cell_dialog::FORMAT_KINDS to a lower layer (or pass it in), used at src/entities/table.rs:6362. Removes the entities -> ui dependency. Size: one file.
  • Move command::WorkingPlane to a lower layer (or pass it in), used at src/entity_creation.rs:1025. Removes the entity_creation -> command dependency. Size: one file.
  • Move app::QSelectCondition, app::QSelectOp to a lower layer (or pass it in), used at src/filter/qselect.rs:11. Removes the filter -> app dependency. Size: one file.
  • Move io::xref_model::wildcard_match_with_digits to a lower layer (or pass it in), used at src/filter/compare.rs:51. Removes the filter -> io dependency. Size: one file.
  • Move cli::low_memory_viewing to a lower layer (or pass it in), used at src/io/mod.rs:532. Removes the io -> cli dependency. Size: one file.
  • Move modules::draw::modify::explode::bake_dimension_blocks to a lower layer (or pass it in), used at src/io/mod.rs:2716. Removes the io -> modules dependency. Size: one file.
  • Move modules::registry, modules::CadModule to a lower layer (or pass it in), used at src/plugin/registry.rs:6. Removes the plugin -> modules dependency. Size: one file.
  • Move plugin::entity_labels::native_edit_disabled to a lower layer (or pass it in), used at src/scene/mod.rs:8488. Removes the scene -> plugin dependency. Size: one file.
  • Move command::DimensionAssociationSource, command::TangentObject to a lower layer (or pass it in), used at src/snap.rs:14. Removes the snap -> command dependency. Size: one file.
  • Move io::host_bridge::is_embed_mode, io::host_bridge::emit_dirty to a lower layer (or pass it in), used at src/sys.rs:139. Removes the sys -> io dependency. Size: one file.
  • Move scene::model::image_model::register_source, scene::model::image_model::has_source to a lower layer (or pass it in), used at src/sys.rs:412. Removes the sys -> scene dependency. Size: one file.

Replace a panic in file import or export

15 places in src/io stop the app if their assumption fails. Where the value comes from a file, return an error instead and add a test with a file that triggers it. Size: a few lines each.

Document an unsafe block

Add a // SAFETY: comment saying why the block is sound (for an unsafe fn, a # Safety doc section). Size: comments only.

Apply an automatic clippy fix

These warnings have a fix clippy can apply. One lint per pull request keeps the diff easy to review: cargo clippy --fix --workspace --all-targets -- -A clippy::all -W <lint>, then check the diff. Size: mechanical.

Lint Fixable warnings
clippy::manual_is_multiple_of 2
clippy::unnecessary_map_or 2
clippy::excessive_precision 1
clippy::needless_return 1
clippy::chunks_exact_to_as_chunks 1
clippy::bind_instead_of_map 1
clippy::manual_contains 1
clippy::items_after_test_module 1
clippy::manual_range_contains 1

Add tests here

Core-layer files with the most lines no test runs, weighted by how often the file changed in the last 28 days, so a test here protects code that is actively changing. Size: one test or more.

File Lines not run by tests Coverage Changes in 28 days
src/scene/mod.rs 1,869 78.9% 190
src/entities/table.rs 1,740 65.5% 35
src/command.rs 486 65.8% 81
src/scene/modify.rs 1,259 52.8% 30
src/entities/multileader.rs 1,060 55.8% 35
src/entities/civil.rs 1,606 4.0% 19
src/io/mod.rs 536 70.4% 50
src/entities/extended.rs 2,170 2.6% 10
src/scene/entity.rs 363 88.9% 59
src/scene/convert/tess.rs 668 64.1% 30

No tests yet: 38 core-layer files are not run by any test. The largest:

Discuss splitting a long function

Larger work: propose a split in a discussion first.

History

Measure v2026.47
Upward dependencies (files) 196
Upward module pairs 32
Modules that use each other 26
Files over 3,000 lines 60
Functions over 150 lines 553
Top-level Message variants —
unwrap/expect/panic! in production code 663
unwrap/expect/panic! in file import and export (src/io) 15
unsafe without a SAFETY note 108
Clippy warnings 29
Compiler warnings 3
Files rustfmt would change 394
Line coverage of the core layers (%) 62.1
Test functions (#[test]) 7,830
RustSec advisories in dependencies 36
Crates in the dependency tree 809

Why these measures

  • Upward dependencies (files): Lower layers that do not reach up can be built, tested and reused without the app.
  • Upward module pairs: Each pair is a place where a lower layer depends on a higher one.
  • Modules that use each other: Two modules that depend on each other change together and cannot be understood apart.
  • Files over 3,000 lines: Large files are hard to review and collect merge conflicts.
  • Functions over 150 lines: Long functions are hard to test and to change safely.
  • Top-level Message variants: One enum for every event couples all features to the app module.
  • unwrap/expect/panic! in production code: A panic closes the app and can lose unsaved work; returning an error lets the user recover.
  • unwrap/expect/panic! in file import and export (src/io): A damaged or unusual drawing, or a failed export, should give an error message, never a crash.
  • unsafe without a SAFETY note: A SAFETY note records why the code is sound, so later changes keep it sound.
  • Clippy warnings: Clippy's default lints catch common mistakes and unclear code.
  • Compiler warnings: With zero warnings, a new one is noticed.
  • Files rustfmt would change: One format means diffs show only real changes.
  • Line coverage of the core layers (%): Every line a test runs is a line a change cannot silently break.
  • Test functions (#[test]): Tests let contributors change code without fear of breaking it.
  • RustSec advisories in dependencies: Known vulnerable or unmaintained crates.
  • Crates in the dependency tree: Each crate adds build time and supply-chain risk.

Clone this wiki locally