AI Slop Code Risk Monitor

microsoft/CsWin32

SlopCodeMonitor badge for microsoft/CsWin32 Adjusted legacy signal; badge bands: 25 / 50 / 75 (different from dashboard bands).

A source generator to add a user-defined set of Win32 P/Invoke methods and supporting types to a C# project.

4.2 Low pattern signal View on GitHub

Open-Source Code Quality, Security and Technical Debt Review

This report summarizes scanner evidence for microsoft/CsWin32, a C# project with 2,526 GitHub stars. SynthScan examined 40,154 lines of code across 274 source files, recording 64 pattern matches distributed across 5 syntactic categories. The legacy adjusted pattern signal is 4.2 (Low pattern signal); it is not an authorship estimate.

Use the findings to ask whether maintainers can explain intent, verify dependencies, simplify unnecessary scaffolding, and focus review effort. Risk Payload v1 adds ownership, supply-chain, over-engineering, and review-effort vectors when available. These are prompts for human verification, not probabilities, security findings, or measured maintenance costs.

4.2
Adjusted Signal
4.2
Raw Pattern Score
100%
Time Factor
2026-10-30
Last Push
2.5K
Stars
C#
Language
40.2K
Lines of Code
274
Files
64
Pattern Hits
2026-10-31
Scan Date
0.03
HC Hit Rate

Risk Review · Payload v1

Use each vector to guide manual verification of the underlying findings.

Payload schema: 1.0.0 · Engine: 2.0.0 · Scoring: heuristic-density-v1 · Scan date: 2026-10-31.

Cognitive Ownership Risk 8.3/100 · LOW

Can maintainers explain intent, assumptions, and trade-offs? 57 finding(s).

Hallucinated Dependency & Supply Chain Risk 11.7/100 · LOW

Are imports declared and package/API names verified? 7 finding(s).

Agent Over-Engineering Ratio 0.0/100 · LOW

Are wrappers, guards, and repeated structures necessary? 0 finding(s).

PR Review Velocity Impact 15.8/100 · LOW

Which changes need focused human review? 64 finding(s).

What These Metrics Mean

Adjusted Signal
Legacy pattern score normalized per 1,000 scanned lines and multiplied by the repository-level time factor. It is not an estimate of AI authorship.
Raw Pattern Score
Sum of severity- and context-weighted pattern findings before applying the time factor.
Time Factor
A coarse multiplier based on repository last-push metadata. It does not identify when individual code was written.
Pattern Hits
Count of configured pattern findings. Review each location and surrounding code before acting.
HC Hit Rate
High- and critical-severity findings per scanned file. Severity is a configured detector weight, not proof of a vulnerability or authorship.
Lines / Files
Scan coverage denominators used by the legacy normalized score.

Pattern-Signal History

This chart tracks the legacy adjusted pattern score across scan runs. Changes can reflect source changes, scan coverage, or detector/scoring versions; they do not measure AI adoption or prove that a team refactored code. Compare runs only when their scoring versions are compatible. The dashed line tracks the raw pattern-hit count.

Severity Breakdown

Groups findings by configured severity weight. Severity is not a confidence estimate, security rating, or proof that a package is missing. Verify imports against the project's manifests and inspect each finding in its local design context.

CRITICAL 7HIGH 1MEDIUM 3LOW 53

Directory Score Breakdown

This horizontal bar chart shows where configured pattern scores accumulate across directories. Treat the bars as locations to inspect, not as evidence of authorship or code quality. Use the file-level findings to decide whether a directory needs a focused ownership, dependency, complexity, or review check.

Pattern Findings

The scanner identified 64 distinct pattern matches across 5 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a detector match to inspect in context. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.

Reading the findings table: The Severity column indicates the configured finding weight (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — legacy comment-context matches receive a ×1.5 score weight. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier under the legacy scoring model.

Hallucination Indicators7 hits · 100 pts
SeverityFileLineSnippetContext
CRITICAL⚡src/Microsoft.Windows.CsWin32/BannedSymbols.txt34M:Microsoft.CodeAnalysis.CSharp.Syntax.ClassDeclarationSyntax.AddBaseListTypes(Microsoft.CodeAnalysis.CSharp.Syntax.BaseCODE
CRITICAL⚡src/Microsoft.Windows.CsWin32/BannedSymbols.txt35M:Microsoft.CodeAnalysis.CSharp.Syntax.InterfaceDeclarationSyntax.AddBaseListTypes(Microsoft.CodeAnalysis.CSharp.Syntax.CODE
CRITICAL⚡src/Microsoft.Windows.CsWin32/BannedSymbols.txt36M:Microsoft.CodeAnalysis.CSharp.Syntax.StructDeclarationSyntax.AddBaseListTypes(Microsoft.CodeAnalysis.CSharp.Syntax.BasCODE
CRITICAL⚡src/Microsoft.Windows.CsWin32/BannedSymbols.txt37M:Microsoft.CodeAnalysis.CSharp.Syntax.EnumDeclarationSyntax.AddBaseListTypes(Microsoft.CodeAnalysis.CSharp.Syntax.BaseTCODE
CRITICAL⚡src/Microsoft.Windows.CsWin32/BannedSymbols.txt38M:Microsoft.CodeAnalysis.CSharp.Syntax.PropertyDeclarationSyntax.AddAccessorListAccessors(Microsoft.CodeAnalysis.CSharp.CODE
CRITICAL⚡src/Microsoft.Windows.CsWin32/BannedSymbols.txt39M:Microsoft.CodeAnalysis.CSharp.Syntax.InvocationExpressionSyntax.AddArgumentListArguments(Microsoft.CodeAnalysis.CSharpCODE
CRITICAL…Microsoft.Windows.CsWin32/Generator.SafeHandleLease.cs67 && handle.Generator.MetadataIndex.MetadataByNamespace.Values.Count(metadata => metadata.Types.ContainsKey(naCODE
Over-Commented Block53 hits · 53 pts
SeverityFileLineSnippetContext
LOW…Microsoft.Windows.CsWin32.Tests/FullGenerationTests.cs1// Copyright (c) Microsoft Corporation. All rights reserved.COMMENT
LOW…icrosoft.Windows.CsWin32.Tests/InteriorPointerTests.cs1// Copyright (c) Microsoft Corporation. All rights reserved.COMMENT
LOW…/Microsoft.Windows.CsWin32.Tests/MultiMetadataTests.cs41 Assert.Contains(this.FindGeneratedType("RtlUnsubscribeWnfStateChangeNotificationSafeHandle"), static type => typCOMMENT
LOWtest/GenerationSandbox.Tests/HandleOwnershipTests.cs1// Copyright (c) Microsoft Corporation. All rights reserved.COMMENT
LOWtest/GenerationSandbox.Tests/HandleOwnershipTests.cs21/// </para>COMMENT
LOWtest/GenerationSandbox.Tests/SignExtendedHandleTests.cs21/// <c>GetCurrentThread</c> (-2) pseudo-handles, and 32-bit GDI/USER handles that are sign-extended to 64 bits.COMMENT
LOWazure-pipelines/build.yml1parameters:COMMENT
LOWintegration-tests/sdk-roslyn5/app/Program.cs1// This test verifies that the Roslyn 5.0 analyzer leg is loaded and theCOMMENT
LOWintegration-tests/nonsdk/Properties/AssemblyInfo.cs21COMMENT
LOW…Windows.CsWin32.BuildTasks/CsWin32CodeGeneratorTask.cs1// Copyright (c) Microsoft Corporation. All rights reserved.COMMENT
LOW…Windows.CsWin32.BuildTasks/CsWin32CodeGeneratorTask.cs61 /// Gets or sets the semicolon-separated paths to Windows metadata files (.winmd).COMMENT
LOW…Windows.CsWin32.BuildTasks/CsWin32CodeGeneratorTask.cs81COMMENT
LOW…Windows.CsWin32.BuildTasks/CsWin32CodeGeneratorTask.cs101COMMENT
LOWsrc/Microsoft.Windows.CsWin32/MetadataIndex.cs1// Copyright (c) Microsoft Corporation. All rights reserved.COMMENT
LOWsrc/Microsoft.Windows.CsWin32/MetadataIndex.cs41 /// </summary>COMMENT
LOWsrc/Microsoft.Windows.CsWin32/Generator.Constant.cs481 }COMMENT
LOWsrc/Microsoft.Windows.CsWin32/IGenerator.cs1// Copyright (c) Microsoft Corporation. All rights reserved.COMMENT
LOWsrc/Microsoft.Windows.CsWin32/IGenerator.cs21 /// Collects the result of code generation.COMMENT
LOWsrc/Microsoft.Windows.CsWin32/IGenerator.cs41 /// <summary>COMMENT
LOWsrc/Microsoft.Windows.CsWin32/IGenerator.cs61 /// <summary>COMMENT
LOWsrc/Microsoft.Windows.CsWin32/SourceGenerator.cs281 // Validate the ExtensionReceiver option (if set). On the Roslyn 5 leg, validation runs per-Generator:COMMENT
LOWsrc/Microsoft.Windows.CsWin32/GeneratorOptions.cs1// Copyright (c) Microsoft Corporation. All rights reserved.COMMENT
LOWsrc/Microsoft.Windows.CsWin32/GeneratorOptions.cs21COMMENT
LOWsrc/Microsoft.Windows.CsWin32/GeneratorOptions.cs41COMMENT
LOWsrc/Microsoft.Windows.CsWin32/GeneratorOptions.cs61 public FriendlyOverloadOptions FriendlyOverloads { get; set; } = new();COMMENT
LOWsrc/Microsoft.Windows.CsWin32/GeneratorOptions.cs81 /// </para>COMMENT
LOWsrc/Microsoft.Windows.CsWin32/GeneratorOptions.cs121COMMENT
LOWsrc/Microsoft.Windows.CsWin32/GeneratorOptions.cs141 /// <remarks>COMMENT
LOWsrc/Microsoft.Windows.CsWin32/GeneratorOptions.cs161 /// Gets or sets a value indicating whether to also generate overloads that use pointer types for parameters thaCOMMENT
LOWsrc/Microsoft.Windows.CsWin32/Generator.InlineArrays.cs161 elseCOMMENT
LOWsrc/Microsoft.Windows.CsWin32/Generator.Invariants.cs121 private static readonly string PartialPInvokeMacrosContentComment = @"COMMENT
LOWsrc/Microsoft.Windows.CsWin32/Generator.Invariants.cs141 private static readonly SyntaxTriviaList InlineCharArrayToStringComment = ParseLeadingTrivia(@"/// <summary>COMMENT
LOWsrc/Microsoft.Windows.CsWin32/Generator.Invariants.cs321 isActive: true)));COMMENT
LOWsrc/Microsoft.Windows.CsWin32/Generator.cs221 /// </summary>COMMENT
LOWsrc/Microsoft.Windows.CsWin32/Generator.cs241 /// </summary>COMMENT
LOWsrc/Microsoft.Windows.CsWin32/Generator.cs261 /// </summary>COMMENT
LOWsrc/Microsoft.Windows.CsWin32/Generator.cs1381 newName = methodName.Substring(0, methodName.Length - 1);COMMENT
LOWsrc/Microsoft.Windows.CsWin32/Generator.cs1621 /// </summary>COMMENT
LOWsrc/Microsoft.Windows.CsWin32/Generator.cs1821 }COMMENT
LOW….Windows.CsWin32/templates/NativeOwnershipAttribute.cs1// Copyright (c) Microsoft Corporation. All rights reserved.COMMENT
LOW…Microsoft.Windows.CsWin32/templates/SafeHandleLease.cs1// Copyright (c) Microsoft Corporation. All rights reserved.COMMENT
LOWsrc/Microsoft.Windows.CsWin32/templates/NTSTATUS.cs1/// <summary>COMMENT
LOWsrc/Microsoft.Windows.CsWin32/templates/ComOutPtr.cs1/// <summary>COMMENT
LOW…rosoft.Windows.CsWin32/templates/PInvokeClassMacros.cs1/// <summary>COMMENT
LOW…rosoft.Windows.CsWin32/templates/PInvokeClassMacros.cs21 /// <returns>A 32-bit unsigned integer.</returns>COMMENT
LOW…rosoft.Windows.CsWin32/templates/PInvokeClassMacros.cs41 /// Constructs a <see cref="global::Windows.Win32.Foundation.LRESULT"/> from two 16-bit values.COMMENT
LOW…rosoft.Windows.CsWin32/templates/PInvokeClassMacros.cs61COMMENT
LOW…rosoft.Windows.CsWin32/templates/PInvokeClassMacros.cs81COMMENT
LOW…rosoft.Windows.CsWin32/templates/PInvokeClassMacros.cs101 /// </summary>COMMENT
LOW…rosoft.Windows.CsWin32/templates/PInvokeClassMacros.cs121 /// </summary>COMMENT
LOW…rosoft.Windows.CsWin32/templates/PInvokeClassMacros.cs141 /// </summary>COMMENT
LOWsrc/Microsoft.Windows.CsWin32/templates/HRESULT.cs1/// <summary>COMMENT
LOWsrc/Microsoft.Windows.CsWin32/templates/HRESULT.cs21/// second severity bit.COMMENT
Synthetic Comment Markers1 hit · 8 pts
SeverityFileLineSnippetContext
HIGHsrc/Microsoft.Windows.CsWin32/Generator.Invariants.cs106// This code was generated by a tool.COMMENT
AI Slop Vocabulary2 hits · 6 pts
SeverityFileLineSnippetContext
MEDIUMsrc/Microsoft.Windows.CsWin32/Generator.Com.cs1202 // We leverage C# syntax that we know the modern C# compiler will turn into a pointer directly into COMMENT
MEDIUMsrc/Microsoft.Windows.CsWin32/Generator.cs1429 // We don't (yet) generate code to leverage aliases, so we skip any symbols defined in aliased referCOMMENT
Slop Phrases1 hit · 3 pts
SeverityFileLineSnippetContext
MEDIUMazure-pipelines/build.yml4##### Feel free to adjust their default value as needed.COMMENT