Repository navigation
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.
| 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 |
| 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 |
| 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 |
| 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 |
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 | — |
Contributors whose merged work improved a measure in this release, in alphabetical order:
- antonio42ch: test functions (#[test]) +9 (#3297)
- assamaral: test functions (#[test]) +4 (#3083, #3451)
- BjornFidder: test functions (#[test]) +2 (#3177, #3245)
- CiberNin: test functions (#[test]) +2 (#3359)
- DmitriG372: test functions (#[test]) +2 (#3449, #3448)
- emrahoksak: test functions (#[test]) +11 (#3278, #3362, #3366, #3387)
- ftaski: test functions (#[test]) +14 (#3319, #3345, #3349, 1 direct commit)
- HakanSeven12: test functions (#[test]) +1,013; upward module pairs −1; upward dependencies (files) −1; functions over 150 lines −5; top-level Message variants −2 (15 direct commits)
- insanedps: test functions (#[test]) +90 (#3121, #3168, #3169, #3172, #3173, #3174, #3175, #3224, and 19 more)
- jespinolao: test functions (#[test]) +189; functions over 150 lines −1 (#3133, #3145, #3146, #3156, #3153, #3160, #3186, #3262, and 13 more)
- KarimJerbi: test functions (#[test]) +140; files over 3,000 lines −4 (73 direct commits)
- MarcelP102: test functions (#[test]) +40 (#3358)
- megabrain-agent: test functions (#[test]) +2 (#3250)
- ramox81: unwrap/expect/panic! in production code −1; test functions (#[test]) +5; top-level Message variants −9; functions over 150 lines −1 (#3104, #3157, #3178, #3229, #3242)
- schoeller: test functions (#[test]) +52 (#3389, #3440, #3442, #3413)
- surfcu: test functions (#[test]) +1 (#3423)
- travisjhughes: test functions (#[test]) +346; unwrap/expect/panic! in production code −55; functions over 150 lines −3 (#3071, #3075, #3079, #3080, #3081, #3085, #3087, #3114, and 51 more)
- yztink: test functions (#[test]) +4 (#3092, #3438)
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_PXto a lower layer (or pass it in), used atsrc/command.rs:1085. Removes thecommand -> uidependency. Size: one file. - Move
ui::window::table_cell_dialog::FORMAT_KINDSto a lower layer (or pass it in), used atsrc/entities/table.rs:6362. Removes theentities -> uidependency. Size: one file. - Move
command::WorkingPlaneto a lower layer (or pass it in), used atsrc/entity_creation.rs:1025. Removes theentity_creation -> commanddependency. Size: one file. - Move
app::QSelectCondition,app::QSelectOpto a lower layer (or pass it in), used atsrc/filter/qselect.rs:11. Removes thefilter -> appdependency. Size: one file. - Move
io::xref_model::wildcard_match_with_digitsto a lower layer (or pass it in), used atsrc/filter/compare.rs:51. Removes thefilter -> iodependency. Size: one file. - Move
cli::low_memory_viewingto a lower layer (or pass it in), used atsrc/io/mod.rs:532. Removes theio -> clidependency. Size: one file. - Move
modules::draw::modify::explode::bake_dimension_blocksto a lower layer (or pass it in), used atsrc/io/mod.rs:2716. Removes theio -> modulesdependency. Size: one file. - Move
modules::registry,modules::CadModuleto a lower layer (or pass it in), used atsrc/plugin/registry.rs:6. Removes theplugin -> modulesdependency. Size: one file. - Move
plugin::entity_labels::native_edit_disabledto a lower layer (or pass it in), used atsrc/scene/mod.rs:8488. Removes thescene -> plugindependency. Size: one file. - Move
command::DimensionAssociationSource,command::TangentObjectto a lower layer (or pass it in), used atsrc/snap.rs:14. Removes thesnap -> commanddependency. Size: one file. - Move
io::host_bridge::is_embed_mode,io::host_bridge::emit_dirtyto a lower layer (or pass it in), used atsrc/sys.rs:139. Removes thesys -> iodependency. Size: one file. - Move
scene::model::image_model::register_source,scene::model::image_model::has_sourceto a lower layer (or pass it in), used atsrc/sys.rs:412. Removes thesys -> scenedependency. Size: one file.
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.
src/io/crs.rs:154src/io/paper_catalog.rs:524src/io/plot_style.rs:49src/io/plot_style.rs:81src/io/save_audit.rs:25src/io/save_audit.rs:50src/io/save_audit.rs:54src/io/save_audit.rs:75src/io/save_audit.rs:130src/io/save_audit.rs:135- …and 5 more (
python3 scripts/health.py measurelists them all)
Add a // SAFETY: comment saying why the block is sound (for an unsafe fn, a # Safety doc section). Size: comments only.
-
src/input/spacemouse/navlib.rs: 24 (first at line 102) -
src/io/print_to_printer.rs: 22 (first at line 218) -
src/app/control/spellcheck.rs: 12 (first at line 129) -
src/input/spacemouse/raw_input.rs: 11 (first at line 35) -
src/io/file_association.rs: 11 (first at line 192) -
src/bin/ocs_launcher.rs: 5 (first at line 101) -
src/entities/field.rs: 4 (first at line 442) -
src/input/spacemouse/worker.rs: 4 (first at line 13)
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 |
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:
-
src/modules/annotate/text_edit.rs: 842 lines -
src/modules/model/polysolid_cmd.rs: 463 lines -
src/modules/annotate/dim_cmd.rs: 434 lines -
src/modules/model/solidedit_cmd.rs: 388 lines -
src/modules/draw/draw/face3d.rs: 377 lines -
src/modules/insert/pdf_clip.rs: 322 lines -
src/modules/annotate/count_cmd.rs: 319 lines -
src/modules/insert/pc_crop.rs: 289 lines
Larger work: propose a split in a discussion first.
-
update_innerinsrc/app/update/dispatch.rs:4: 14,897 lines -
dispatch_stylepropsinsrc/app/commands/styleprops.rs:68: 4,579 lines -
dispatch_drawinsrc/app/commands/draw.rs:4: 3,444 lines -
control_ui_actioninsrc/app/control/actions.rs:1880: 3,382 lines -
view_maininsrc/app/view/mod.rs:810: 3,170 lines
| 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 |
- 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.
Open CAD Studio is free software under the GPL-3.0 licence · Source code · Download · Web app · Discussions
Get started
- Installation
- Your First Drawing
- Tutorials
- The User Interface
- Ribbon Reference
- Workspaces and Toolbars
- Navigating the Drawing
Draw and edit
- Drawing Setup and Units
- Precision Drawing
- Isometric Drafting
- Drawing Objects
- Multilines
- Selecting Objects
- Modifying Objects
- Hatches and Fills
- Layers and Properties
Annotate
Organise and reuse
Present and share
3D
Tools
Reference