Repository navigation
Code Health
Measured at v2026.48 (fe7adfcef), 2026-11-29. 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.
4 of 8 improved since main@8bed4f27f.
| Measure | Now | Since last release | Next milestone | Trend | Long-term |
|---|---|---|---|---|---|
| Upward dependencies (files) | 21 | better (-178) |
▰▱▱▱▱▱▱▱▱▱ 13% to 11 |
██▁ | 0 |
| Upward module pairs | 1 | better (-31) |
▱▱▱▱▱▱▱▱▱▱ 0% to 0 |
██▁ | 0 |
| Modules that use each other | 10 | better (-16) |
▰▰▰▰▱▱▱▱▱▱ 43% to 6 |
██▁ | 0 |
| Files over 3,000 lines | 61 | better (-1) | worse than the baseline (59) | ▁█▅ | 0 |
| Functions over 150 lines | 592 | worse (+6) | worse than the baseline (532) | ▁▇█ | 0 |
| Top-level Message variants | — | — | lower | ||
| Process-wide mutable statics | 320 | — |
▱▱▱▱▱▱▱▱▱▱ 0% to 160 |
lower | |
| thread_local! blocks | 76 | — |
▱▱▱▱▱▱▱▱▱▱ 0% to 38 |
lower |
3 of 3 improved since main@8bed4f27f.
| Measure | Now | Since last release | Next milestone | Trend | Long-term |
|---|---|---|---|---|---|
| unwrap/expect/panic! in production code | 670 | better (-1) |
▱▱▱▱▱▱▱▱▱▱ 0% to 335 |
▁█▇ | lower |
| unwrap/expect/panic! in file import and export (src/io) | 0 | better (-25) | reached the target | ▅█▁ | 0 |
| unsafe without a SAFETY note | 101 | better (-8) |
▰▱▱▱▱▱▱▱▱▱ 8% to 52 |
▇█▁ | 0 |
0 of 3 improved since main@8bed4f27f.
| Measure | Now | Since last release | Next milestone | Trend | Long-term |
|---|---|---|---|---|---|
| Clippy warnings | 1,182 | worse (+30) | worse than the baseline (29) | ▁██ | 0 |
| Compiler warnings | 214 | worse (+11) | worse than the baseline (3) | ▁██ | 0 |
| Files rustfmt would change | 716 | worse (+170) | worse than the baseline (394) | ▁▄█ | 0 |
2 of 4 improved since main@8bed4f27f.
| Measure | Now | Since last release | Next milestone | Trend | Long-term |
|---|---|---|---|---|---|
| Line coverage of the core layers (%) | 63.3 | better (+0.5) |
▰▰▱▱▱▱▱▱▱▱ 24% to 67.1 |
▁▅█ | 100 |
| Test functions (#[test]) | 8,810 | better (+193) |
▰▰▰▰▰▰▰▱▱▱ 69% to 9,065 |
▁▇█ | higher |
| RustSec advisories in dependencies | 19 | no change |
▰▰▰▰▰▰▰▰▰▱ 94% to 18 |
█▁▁ | 0 |
| Crates in the dependency tree | 851 | no change | above the baseline (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.0% | 693 | better (+2.2) | █▁▇ |
| 1 Drawing model and geometry | 57.1% | 27,565 | better (+2.9) | ▁▂█ |
| 2 File formats and rendering | 75.9% | 29,035 | better (+1.0) | ▁▅█ |
| 3 Tool contract and plugin runtime | 77.1% | 1,945 | better (+13.0) | ▁▁█ |
| 4 Features (modules) | 49.1% | 44,119 | worse (-0.2) | █▃▁ |
The crates planned in TARGET.md, lowest first. A crate can move out of the root package when its modules use nothing that is neither in the crate nor in a crate below it. Test code is counted apart: the tests move with their crate. Unlike the upward dependencies, this also counts ui using app::Message, items in the crate root and the exported macros.
| Crate | Modules | Production code | Test code |
|---|---|---|---|
ocs_base |
par, perf, i18n, config, network, wildcard, xml_depth, schema_validation, sys, sysinfo, paths, icon_assets
|
ready | ready |
ocs_model |
entities, parametric, filter, calc, display, text, catalog, media
|
ready | ready |
ocs_io |
io, ifc_plan
|
ready | ready |
ocs_session |
— | no modules yet | no modules yet |
ocs_render |
scene, gpu_backend, snap
|
ready | 37 files |
ocs_commands |
command, plugin_catalog, modules, entity_creation
|
ready | ready |
ocs_ui |
ui, input
|
176 files | 19 files |
What blocks ocs_render
-
scene -> io: in test code, 27 files, for examplesrc/scene/annotation_visibility_tests.rs:86 -
scene -> modules: in test code, 8 files, for examplesrc/scene/block_base_point_tests.rs:31 -
scene -> command: in test code, 6 files, for examplesrc/scene/block_base_point_tests.rs:30 -
scene -> ui: in test code, 2 files, for examplesrc/scene/block_base_point_tests.rs:36 -
scene -> output: in test code, 1 file, for examplesrc/scene/pipeline/dash_gpu_tests.rs:4 -
snap -> command: in test code, 1 file, for examplesrc/snap.rs:7553
What blocks ocs_ui
-
ui -> app: 176 files, for examplesrc/ui/color_select/editor.rs:8 -
ui -> output: 1 file, for examplesrc/ui/window/plot.rs:11 -
ui -> crate root: in test code, 14 files, for examplesrc/ui/properties.rs:2674 -
ui -> app: in test code, 6 files, for examplesrc/ui/kit/press.rs:152 -
ui -> plugin: in test code, 1 file, for examplesrc/ui/ribbon/qat.rs:1567
Not in a planned crate yet: loader, output (CRATES in scripts/arch_check.py).
State held for the whole process, by module: statics whose value can change after start (atomics, mutexes, OnceLock, cells) and thread_local! blocks. Step 3 of TARGET.md moves it into the session or the app state.
Contributors whose merged work improved a measure in this release, in alphabetical order:
- antonio42ch: test functions (#[test]) +11 (#3609, #3664)
- assamaral: test functions (#[test]) +1 (#3463)
- BeeBeeSix: test functions (#[test]) +2 (#3733)
- BjornFidder: test functions (#[test]) +51 (#3379, #3338, #3511, #3651, #3662, #3774)
- bomxacalaka: test functions (#[test]) +5 (#3836)
- CiberNin: test functions (#[test]) +2 (#3556)
- claude: test functions (#[test]) +23; functions over 150 lines −1 (11 direct commits)
- D-Fed11: test functions (#[test]) +8 (#3478)
- DmitriG372: test functions (#[test]) +6 (#3509, #3550, #3644)
- HakanSeven12: test functions (#[test]) +8; upward module pairs −26; upward dependencies (files) −171; modules that use each other −18; files over 3,000 lines −4; unwrap/expect/panic! in file import and export (src/io) −25; unwrap/expect/panic! in production code −10 (15 direct commits)
- insanedps: test functions (#[test]) +52 (#3574, #3613, #3614, #3714, #3715, #3716, #3718, #3719, and 21 more)
- jespinolao: test functions (#[test]) +27 (#3492, #3475, #3469, #3471, #3484, #3482, #3462, #3537, and 1 more)
- KarimJerbi: test functions (#[test]) +31 (5 direct commits)
- MarcelP102: test functions (#[test]) +26 (#3639, #3670, #3783)
- ohagmann: test functions (#[test]) +123 (#3571, #3582, #3580, #3583, #3572, #3573, #3590, #3606, and 14 more)
- ramox81: test functions (#[test]) +10 (#3607, #3653, #3668, #3672, #3678, #3690, #3691)
- schoeller: test functions (#[test]) +38 (#3510, #3530, #3540, #3545, #3576, #3586, #3642)
- surfcu: test functions (#[test]) +79; unsafe without a SAFETY comment −9; unwrap/expect/panic! in production code −1 (#3789, #3790, #3791, #3792, #3793, #3794, #3796, #3799, and 2 more)
- travisjhughes: test functions (#[test]) +478; unwrap/expect/panic! in production code −14; upward module pairs −2; upward dependencies (files) −6; modules that use each other −2; functions over 150 lines −1 (#3496, #3490, #3487, #3486, #3467, #3483, #3473, #3472, and 42 more)
- X1ehua: test functions (#[test]) +2 (#3495)
- yunusdede9-cyber: test functions (#[test]) +1 (#3772)
- yztink: test functions (#[test]) +4 (#3694)
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/output/print_to_printer.rs: 20 (first at line 218) -
src/input/spacemouse/raw_input.rs: 11 (first at line 35) -
crates/ocs_io/src/io/file_association.rs: 11 (first at line 192) -
src/app/control/spellcheck.rs: 5 (first at line 129) -
src/bin/ocs_launcher.rs: 5 (first at line 101) -
crates/ocs_model/src/entities/field.rs: 5 (first at line 443) -
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::chunks_exact_to_as_chunks |
119 |
clippy::useless_conversion |
27 |
clippy::unnecessary_cast |
18 |
clippy::items_after_test_module |
16 |
clippy::unnecessary_lazy_evaluations |
13 |
clippy::needless_borrow |
12 |
clippy::cloned_ref_to_slice_refs |
12 |
clippy::bool_assert_comparison |
11 |
clippy::collapsible_match |
10 |
clippy::needless_return |
9 |
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,934 | 78.5% | 187 |
src/scene/modify.rs |
1,254 | 53.0% | 24 |
src/scene/convert/tess.rs |
672 | 61.9% | 30 |
src/modules/draw/draw/hatch.rs |
1,053 | 42.4% | 18 |
src/scene/entity.rs |
353 | 89.1% | 53 |
src/snap.rs |
717 | 78.8% | 21 |
src/scene/cache/block_cache.rs |
456 | 86.7% | 33 |
src/scene/convert/tessellate.rs |
589 | 78.0% | 25 |
src/modules/draw/modify/fillet.rs |
1,019 | 55.1% | 14 |
src/modules/annotate/mleader_cmd.rs |
936 | 7.4% | 15 |
No tests yet: 41 core-layer files are not run by any test. The largest:
-
crates/ocs_model/src/entities/mesh_edit.rs: 686 lines -
src/modules/model/polysolid_cmd.rs: 463 lines -
src/modules/annotate/dim_cmd.rs: 434 lines -
src/modules/model/solidedit_cmd.rs: 392 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/surface/command.rs: 297 lines
Larger work: propose a split in a discussion first.
-
update_innerinsrc/app/update/dispatch.rs:4: 15,287 lines -
dispatch_stylepropsinsrc/app/commands/styleprops.rs:68: 4,611 lines -
control_ui_actioninsrc/app/control/actions.rs:1891: 3,582 lines -
dispatch_drawinsrc/app/commands/draw.rs:4: 3,427 lines -
view_maininsrc/app/view/mod.rs:910: 3,335 lines
| Measure | v2026.48 | main@8bed4f27f | v2026.47 |
|---|---|---|---|
| Upward dependencies (files) | 21 | 199 | 196 |
| Upward module pairs | 1 | 32 | 32 |
| Modules that use each other | 10 | 26 | 26 |
| Files over 3,000 lines | 61 | 62 | 60 |
| Functions over 150 lines | 592 | 586 | 553 |
| Top-level Message variants | — | — | — |
| Process-wide mutable statics | 320 | — | — |
| thread_local! blocks | 76 | — | — |
| unwrap/expect/panic! in production code | 670 | 671 | 663 |
| unwrap/expect/panic! in file import and export (src/io) | 0 | 25 | 15 |
| unsafe without a SAFETY note | 101 | 109 | 108 |
| Clippy warnings | 1,182 | 1,152 | 29 |
| Compiler warnings | 214 | 203 | 3 |
| Files rustfmt would change | 716 | 546 | 394 |
| Line coverage of the core layers (%) | 63.3 | 62.8 | 62.1 |
| Test functions (#[test]) | 8,810 | 8,617 | 7,830 |
| RustSec advisories in dependencies | 19 | 19 | 36 |
| Crates in the dependency tree | 851 | 851 | 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.
- Process-wide mutable statics: State held for the whole process is shared by every drawing and every test, so tests that touch it run one at a time; it belongs in the session or the app state (TARGET.md, step 3).
- thread_local! blocks: Per-thread state is hidden from the code that calls it and differs between the UI thread and the workers; it belongs in the session or the app state (TARGET.md, step 3).
- 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