Repository Analysis

microsoft/windows-rs

Rust for Windows

0.3 Likely human-written View on GitHub
0.3
Adjusted Score
0.3
Raw Score
100%
Time Factor
2026-05-30
Last Push
12,268
Stars
Rust
Language
1,935,721
Lines of Code
3136
Files
339
Pattern Hits
2026-05-31
Scan Date

Score History

Severity Breakdown

CRITICAL 4HIGH 0MEDIUM 97LOW 238

Pattern Findings

339 matches across 6 categories. Click a row to expand file-level details.

Over-Commented Block234 hits · 234 pts
SeverityFileLineSnippet
LOWcrates/tests/misc/readme/src/lib.rs1#![cfg(windows)]
LOWcrates/tests/misc/no_std/src/lib.rs1#![cfg(windows)]
LOWcrates/tests/libs/reactor_backend/src/harness.rs361
LOWcrates/tests/libs/reactor_backend/src/harness.rs661 /// **Known limitation:** WinUI's `RadioButtons` control does not
LOWcrates/tests/libs/bindgen/tests/fixtures.rs81 } else {
LOWcrates/tests/libs/bindgen/tests/fixtures.rs101 filter: Option<String>,
LOWcrates/tests/libs/bindgen/tests/fixtures.rs121 /// a `SupportedArchitecture` attribute.
LOW…sts/libs/bindgen/data/clang/extern_c_macro_dep/input.h1// Defines EXTERN_C in a separate included header so that the macro's spelling
LOWcrates/tests/libs/bindgen/data/clang/sal/input.h1// Test SAL annotation extraction.
LOW…/data/clang/extern_c_macro_nested/extern_c_macro_dep.h1// Defines EXTERN_C in a separate included header so that the macro's spelling
LOW…ates/tests/libs/bindgen/data/clang/midl_params/input.h1// Test MIDL-style block-comment parameter annotations.
LOW…bindgen/data/clang/extern_c_macro/extern_c_macro_dep.h1// Defines EXTERN_C in a separate included header so that the macro's spelling
LOW…tests/libs/bindgen/data/rdl/mod_recursive/fixture.toml1# One input.rdl, multiple writer invocations with different filters: proves
LOW…/libs/bindgen/data/bindgen/derive_cpp_enum/expected.rs1#[repr(transparent)]
LOW…ndgen/data/error/writer_missing_enum_type/fixture.toml1# Asserts the writer fails with a clear error when the winmd that defines
LOWcrates/tests/libs/bindgen/src/lib.rs1//! Compile every fixture's `expected.rs` so stale goldens break the build.
LOWcrates/tests/libs/reference/tests/stock_reference.rs161fn equality() {
LOW…/libs/reactor/tests/keyboard_accelerators_universal.rs1//! Regression test that asserts every widget variant of `Element`
LOWcrates/tests/libs/reactor/tests/tooltip_universal.rs1//! Regression test that asserts every widget variant of `Element`
LOW…es/tests/libs/reactor/tests/grid_attached_universal.rs1//! Regression test that asserts every widget variant of `Element` round-trips
LOWcrates/tests/libs/reactor/tests/element_custom.rs1//! Tests for `CustomElement` — the open/closed extension hatch that lets
LOWcrates/libs/interface/src/guid.rs1//! GUID parsing and token generation for the `#[interface]` macro attribute.
LOWcrates/libs/interface/src/lib.rs1//! Define COM interfaces to call or implement.
LOWcrates/libs/interface/src/lib.rs21//!
LOWcrates/libs/interface/src/lib.rs41//! - The `_Impl` naming convention.
LOWcrates/libs/interface/src/lib.rs61/// unsafe trait IValue: IUnknown {
LOWcrates/libs/interface/src/tests.rs1//! Tests for the `#[interface]` macro that verify the generated code structure.
LOWcrates/libs/strings/src/lib.rs1#![doc = include_str!("../readme.md")]
LOWcrates/libs/strings/src/pwstr.rs41 ///
LOWcrates/libs/strings/src/pcwstr.rs41 /// Returns `true` if the string length is zero, and `false` otherwise.
LOWcrates/libs/strings/src/pcwstr.rs61 /// # Safety
LOWcrates/libs/strings/src/hstring_header.rs81// `WindowsDeleteString` / `HeapFree`) and the Rust global allocator elsewhere.
LOWcrates/libs/result/src/error.rs1use super::*;
LOWcrates/libs/result/src/error.rs21/// This error information can be disabled at compile time by setting `RUSTFLAGS=--cfg=windows_slim_errors`.
LOWcrates/libs/result/src/error.rs41///
LOWcrates/libs/core/src/com_object.rs1use crate::imp::Box;
LOWcrates/libs/core/src/com_object.rs21 type Outer: IUnknownImpl<Impl = Self>;
LOWcrates/libs/core/src/com_object.rs41
LOWcrates/libs/core/src/com_object.rs61/// single pointer.
LOWcrates/libs/core/src/com_object.rs81 ///
LOWcrates/libs/core/src/com_object.rs141
LOWcrates/libs/core/src/com_object.rs321/// objects, or objects that contain mutable global state.
LOWcrates/libs/core/src/interface_macro.rs1//! A `macro_rules!` declarative alternative to the `#[interface]` proc-macro.
LOWcrates/libs/core/src/interface_macro.rs21//! interfaces is not traversed; use the proc-macro for those cases.
LOWcrates/libs/core/src/interface_macro.rs41//! as a `u128` integer literal. The generated interface struct is always `pub`, matching
LOWcrates/libs/core/src/type.rs161///
LOWcrates/libs/core/src/interface.rs21 #[doc(hidden)]
LOWcrates/libs/core/src/interface.rs61 ///
LOWcrates/libs/core/src/interface.rs81 } else {
LOWcrates/libs/core/src/interface.rs121 ///
LOWcrates/libs/core/src/interface.rs181 /// object (e.g. `&MyApp_Impl`), not the inner `&MyApp`.
LOWcrates/libs/core/src/interface.rs201 Err(imp::E_NOINTERFACE.into())
LOWcrates/libs/core/src/interface.rs281 /// # Safety
LOWcrates/libs/core/src/compose.rs1use super::*;
LOWcrates/libs/core/src/compose.rs41///
LOWcrates/libs/core/src/event_revoker.rs1use super::*;
LOWcrates/libs/core/src/implement_macro.rs1//! A `macro_rules!` declarative alternative to the `#[implement]` proc-macro.
LOWcrates/libs/core/src/implement_macro.rs21//! ## Syntax
LOWcrates/libs/core/src/implement_macro.rs41//! unsafe fn Method(&self) -> HRESULT { HRESULT(0) }
LOWcrates/libs/core/src/implement_macro.rs61//! ```rust,ignore
174 more matches not shown…
Decorative Section Separators83 hits · 219 pts
SeverityFileLineSnippet
MEDIUMcrates/tests/libs/reactor_backend/src/registry.rs167 // ── Extended controls (previously missing mount coverage) ───────────
MEDIUMcrates/tests/libs/reactor_backend/src/registry.rs256 // ── Hook fixtures ──────────────────────────────────────────────────
MEDIUMcrates/tests/libs/reactor_backend/src/registry.rs271 // ── Prop update fixtures (control diff without recreate) ────────────
MEDIUMcrates/tests/libs/reactor_backend/src/registry.rs283 // ── Event detachment fixtures ──────────────────────────────────────
MEDIUMcrates/tests/libs/reactor_backend/src/registry.rs296 // ── Reconciler stress fixtures ─────────────────────────────────────
MEDIUMcrates/tests/libs/reactor/tests/controls_w1_w5.rs45// ── W2: PasswordBox ─────────────────────────────────────────────────────
MEDIUMcrates/tests/libs/reactor/tests/controls_w1_w5.rs107// ── W3: RadioButtons ────────────────────────────────────────────────────
MEDIUMcrates/tests/libs/reactor/tests/controls_w1_w5.rs162// ── W4: ComboBox ────────────────────────────────────────────────────────
MEDIUMcrates/tests/libs/reactor/tests/controls_w1_w5.rs233// ── W5: Canvas + attached position ─────────────────────────────────────
MEDIUMcrates/tests/libs/reactor/tests/controls_w1_w5.rs295// ── W1: virtual_list alias + scroll_to_index plumbing ──────────────────
MEDIUMcrates/libs/reactor/src/core/resource.rs12// ─── Resource enum ──────────────────────────────────────────────────────
MEDIUMcrates/libs/reactor/src/core/resource.rs133// ─── Mutation state ─────────────────────────────────────────────────────
MEDIUMcrates/libs/reactor/src/core/resource.rs172// ─── Generation token for cancellation ──────────────────────────────────
MEDIUMcrates/libs/reactor/src/core/resource.rs194// ─── use_resource ───────────────────────────────────────────────────────
MEDIUMcrates/libs/reactor/src/core/resource.rs261// ─── MutationTrigger ────────────────────────────────────────────────────
MEDIUMcrates/libs/reactor/src/core/widgets/text_block.rs73// ── Type-ramp factories (WinUI 3 spec) ──────────────────────────────────────
MEDIUMcrates/libs/reactor/src/winui/backend/mod.rs920 // ── ToggleButton ─────────────────────────────────────────────
MEDIUMcrates/libs/reactor/src/winui/backend/mod.rs1712 // ── W2: PasswordBox ───────────────────────────────────────────
MEDIUMcrates/libs/reactor/src/winui/backend/mod.rs1757 // ── W3: RadioButtons ──────────────────────────────────────────
MEDIUMcrates/libs/reactor/src/winui/backend/mod.rs1778 // ── W4: ComboBox ──────────────────────────────────────────────
MEDIUMcrates/libs/reactor/src/winui/backend/mod.rs1809 // ── W5: Canvas attached props ─────────────────────────────────
MEDIUMcrates/libs/reactor/src/winui/backend/mod.rs1819 // ── W6: RepeatButton ──────────────────────────────────────────
MEDIUMcrates/libs/reactor/src/winui/backend/mod.rs1831 // ── W7: RatingControl ─────────────────────────────────────────
MEDIUMcrates/libs/reactor/src/winui/backend/mod.rs1850 // ── W8: ColorPicker ───────────────────────────────────────────
MEDIUMcrates/libs/reactor/src/winui/backend/mod.rs1872 // ── W9: DatePicker ────────────────────────────────────────────
MEDIUMcrates/libs/reactor/src/winui/backend/mod.rs1890 // ── W10: TimePicker ───────────────────────────────────────────
MEDIUMcrates/libs/reactor/src/winui/backend/mod.rs1905 // ── W11: CalendarDatePicker ───────────────────────────────────
MEDIUMcrates/libs/reactor/src/winui/backend/mod.rs1928 // ── W12: CalendarView ─────────────────────────────────────────
MEDIUMcrates/libs/reactor/src/winui/backend/mod.rs1938 // ── W13: ListBox ──────────────────────────────────────────────
MEDIUMcrates/libs/reactor/src/winui/backend/mod.rs1957 // ── W14: DropDownButton ───────────────────────────────────────
MEDIUMcrates/libs/reactor/src/winui/backend/mod.rs1968 // ── W15: SplitButton ──────────────────────────────────────────
MEDIUMcrates/libs/reactor/src/winui/backend/mod.rs1979 // ── W16: AutoSuggestBox ───────────────────────────────────────
MEDIUMcrates/libs/reactor/src/winui/backend/mod.rs2016 // ── W17: SplitView ───────────────────────────────────────
MEDIUMcrates/libs/reactor/src/winui/backend/mod.rs2029 // ── W18: MenuBar ─────────────────────────────────────────
MEDIUMcrates/libs/reactor/src/winui/backend/mod.rs2131 // ── W19: ScrollView ──────────────────────────────────────
MEDIUMcrates/libs/reactor/src/winui/backend/mod.rs2160 // ── W20: TreeView ────────────────────────────────────────
MEDIUMcrates/libs/reactor/src/winui/backend/mod.rs2184 // ── W21: CommandBar ──────────────────────────────────────
MEDIUMcrates/libs/reactor/src/winui/backend/mod.rs2247 // ── W22: TeachingTip ────────────────────────────────────
MEDIUMcrates/libs/reactor/src/winui/backend/mod.rs2301 // ── W23: SelectorBar ────────────────────────────────────
MEDIUMcrates/libs/reactor/src/winui/backend/mod.rs2345 // ── Flyout on Button ──────────────────────────────────────────
MEDIUMcrates/libs/reactor/src/winui/backend/mod.rs2404 // ── RelativePanel attached props ──────────────────────────────
MEDIUMcrates/libs/reactor/src/winui/backend/mod.rs3438 // ── RatingControl ValueChanged ────────────────────────────────
MEDIUMcrates/libs/reactor/src/winui/backend/mod.rs3455 // ── ColorPicker ColorChanged ──────────────────────────────────
MEDIUMcrates/libs/reactor/src/winui/backend/mod.rs3475 // ── W9: DatePicker ────────────────────────────────────────────
MEDIUMcrates/libs/reactor/src/winui/backend/mod.rs3491 // ── W10: TimePicker ───────────────────────────────────────────
MEDIUMcrates/libs/reactor/src/winui/backend/mod.rs3508 // ── W11: CalendarDatePicker ───────────────────────────────────
MEDIUMcrates/libs/reactor/src/winui/backend/mod.rs3526 // ── W12: CalendarView ─────────────────────────────────────────
MEDIUMcrates/libs/reactor/src/winui/backend/mod.rs3540 // ── W13: ListBox ──────────────────────────────────────────────
MEDIUMcrates/libs/reactor/src/winui/backend/mod.rs3560 // ── W15: SplitButton ──────────────────────────────────────────
MEDIUMcrates/libs/reactor/src/winui/backend/mod.rs3572 // ── W16: AutoSuggestBox ───────────────────────────────────────
MEDIUMcrates/libs/reactor/src/winui/backend/mod.rs3639 // ── W17: SplitView ───────────────────────────────────────
MEDIUMcrates/libs/reactor/src/winui/backend/mod.rs3651 // ── W18: MenuBar ─────────────────────────────────────────
MEDIUMcrates/libs/reactor/src/winui/backend/mod.rs3682 // ── W20: TreeView ─────────────────────────────────────────
MEDIUMcrates/libs/reactor/src/winui/backend/mod.rs3710 // ── W21: CommandBar ─────────────────────────────────────────
MEDIUMcrates/libs/reactor/src/winui/backend/mod.rs3729 // ── W22: TeachingTip ─────────────────────────────────────────
MEDIUMcrates/libs/reactor/src/winui/backend/mod.rs3752 // ── W23: SelectorBar ─────────────────────────────────────────
MEDIUMcrates/libs/reactor/src/dsl/modifiers.rs272 // ── Accessibility modifiers ──────────────────────────────────────────
MEDIUMcrates/libs/reactor/src/dsl/modifiers.rs318 // ── RelativePanel attached property helpers ──────────────────────────
MEDIUMcrates/samples/reactor/gallery/src/registry.rs28 // ── Basic Input ─────────────────────────────────────────────────
MEDIUMcrates/samples/reactor/gallery/src/registry.rs157 // ── Collections ─────────────────────────────────────────────────
23 more matches not shown…
Hallucination Indicators4 hits · 40 pts
SeverityFileLineSnippet
CRITICAL…es/libs/windows/src/extensions/Win32/System/Variant.rs108 if from.Anonymous.Anonymous.vt == VT_UNKNOWN && !from.Anonymous.Anonymous.Anonymous.punkVal.is_none() {
CRITICAL…es/libs/windows/src/extensions/Win32/System/Variant.rs269 if from.Anonymous.Anonymous.vt == VT_DISPATCH && !from.Anonymous.Anonymous.Anonymous.pdispVal.is_none() {
CRITICAL…ndows/src/extensions/Win32/System/StructuredStorage.rs99 if from.Anonymous.Anonymous.vt == VT_UNKNOWN && !from.Anonymous.Anonymous.Anonymous.punkVal.is_none() {
CRITICAL…ndows/src/extensions/Win32/System/StructuredStorage.rs260 if from.Anonymous.Anonymous.vt == VT_DISPATCH && !from.Anonymous.Anonymous.Anonymous.pdispVal.is_none() {
AI Slop Vocabulary11 hits · 26 pts
SeverityFileLineSnippet
MEDIUMcrates/tests/libs/reactor_backend/src/main.rs110 println!("# Total failures: {}", harness.failures());
MEDIUMcrates/tests/libs/bindgen/Cargo.toml24# deps to Windows so the harness still builds on non-Windows hosts
MEDIUMweb/book/docs/searchindex.js1window.search = JSON.parse('{"doc_urls":["index.html","rust-getting-started/index.html#getting-started-with-rust","rust-
MEDIUMweb/book/docs/searchindex.js1window.search = JSON.parse('{"doc_urls":["index.html","rust-getting-started/index.html#getting-started-with-rust","rust-
MEDIUMweb/book/docs/searchindex.js1window.search = JSON.parse('{"doc_urls":["index.html","rust-getting-started/index.html#getting-started-with-rust","rust-
LOWweb/book/docs/searchindex.js1window.search = JSON.parse('{"doc_urls":["index.html","rust-getting-started/index.html#getting-started-with-rust","rust-
MEDIUMweb/book/docs/searchindex.js1window.search = JSON.parse('{"doc_urls":["index.html","rust-getting-started/index.html#getting-started-with-rust","rust-
MEDIUMweb/book/docs/print.html361<p>COM APIs are unique in that they expose functionality through interfaces. An interface is just a collection of virtua
MEDIUMweb/book/docs/print.html400<p>Windows 8 introduced the Windows Runtime, which at its heart, is just COM with a few more conventions thrown in to ma
MEDIUM…rust-getting-started/calling-your-first-winrt-api.html173<p>Windows 8 introduced the Windows Runtime, which at its heart, is just COM with a few more conventions thrown in to ma
MEDIUM…s/rust-getting-started/calling-your-first-com-api.html173<p>COM APIs are unique in that they expose functionality through interfaces. An interface is just a collection of virtua
Slop Phrases4 hits · 8 pts
SeverityFileLineSnippet
MEDIUMweb/book/docs/print.html690<p>The <code>src</code> sub directory contains the <code>lib.rs</code> Rust source file where we can add any functions t
MEDIUMweb/book/docs/print.html708<p>Here's a simple example in C++:</p>
MEDIUM…docs/rust-getting-started/creating-your-first-dll.html190<p>The <code>src</code> sub directory contains the <code>lib.rs</code> Rust source file where we can add any functions t
MEDIUM…docs/rust-getting-started/creating-your-first-dll.html208<p>Here's a simple example in C++:</p>
Verbosity Indicators3 hits · 4 pts
SeverityFileLineSnippet
LOWcrates/tests/libs/rdl/tests/guid-derive.rs52 // Step 1: RDL → WINMD (reader derives/validates GUIDs)
LOWcrates/tests/libs/rdl/tests/guid-derive.rs174 // Step 2: WINMD → RDL (writer roundtrip — explicit GUIDs must be preserved in the output)
LOWcrates/tests/libs/rdl/tests/guid-derive.rs181 // Step 3: Roundtripped RDL → WINMD (verify that all explicit GUIDs survived the roundtrip)