Skip to content

Eliminate all build warnings and unblock the test suite on Windows 11 23H2 - #154

Open
jafin wants to merge 4 commits into
robertpopa22:mainfrom
jafin:chore/build-warnings-cleanup
Open

Eliminate all build warnings and unblock the test suite on Windows 11 23H2#154
jafin wants to merge 4 commits into
robertpopa22:mainfrom
jafin:chore/build-warnings-cleanup

Conversation

@jafin

@jafin jafin commented Aug 5, 2026

Copy link
Copy Markdown

Clears every compiler and analyzer warning in the solution (the build now reports 0 warnings) and fixes a test-project setting that made the suite unrunnable on any OS older than Windows 11 24H2.

Commits

  1. chore(tests)string.Equals(..., StringComparison.Ordinal) for MA0006; duplicate using System; removed (CS0105).
  2. fix(build) — nullability, analyzer and dead-code fixes across mRemoteNG. See the commit body for the per-warning rationale.
  3. chore(deps) — drops the System.DirectoryServices PackageReference (NU1510); the framework supplies it and no source uses the namespace. The forced recompile surfaced an unused designer field (CS0169).
  4. chore(tests) — lowers SupportedOSPlatformVersion from 10.0.26100.0 to 10.0.17763.0, and sets Nullable=annotations.

Notable decisions

  • Pkcs5S2KeyGenerator now calls the static Rfc2898DeriveBytes.Pbkdf2 overload, clearing SYSLIB0060 and CA5379. SHA1 is retained deliberately — it is required to decrypt existing connection files. Derived bytes are unchanged. This is the change most worth a careful review, since it sits on the key-derivation path for every stored password.
  • SupportedOSPlatformVersion: the test project was pinned stricter than the app it tests (26100 vs the app's 17763). The test host therefore reported Only supported on Windows10.0.26100.0 and executed zero tests on Windows 11 23H2. Aligning it with mRemoteNG.csproj produces no CA1416 warnings. CI on windows-2025-vs2026 is unaffected.
  • Nullable=annotations rather than per-file #nullable enable pragmas: it enables the annotation context without turning on flow-analysis warnings across a ~6.3k-test project.
  • PlaceholderCredentialRecord.PropertyChanged uses a scoped #pragma warning disable CS0067 instead of no-op add/remove accessors, so the event still behaves normally if the type ever starts raising it.

Verification

  • Full build via build.ps1: exit 0, 0 warnings, 0 errors.
  • Test suite: 6,339 / 6,341 passing.

Known failure, pre-existing

ConnectionsServiceStartupPathTests.StartupConnectionPathReturnsSavedPathWhenItIsTheSoleCandidate fails on my dev box. It calls GetStartupConnectionFileName via reflection, which performs live filesystem discovery; discovery finds a candidate beside the test binaries and prefers it over the injected temp path. The test's own comment anticipates this scenario, but the assertion is stricter than the comment.

None of the files touched here are on that code path — ConnectionsService and ConnectionsFileResolver are untouched, and the one settings-adjacent edit (nullnull!) is annotation-only with identical IL. Caveat: I have no local baseline, because the suite could not run on this machine before commit 4.

Relatedly, the parallel group runner reports 2 failures where a single-process run reports 1 — the extra one is order-dependent, as this test mutates the static OptionsConnectionsPage.Default singleton.

jafin added 4 commits August 5, 2026 20:28
Replace == string comparisons with string.Equals(..., StringComparison.Ordinal) to satisfy MA0006, and drop a duplicate 'using System;' (CS0105).
Nullability: align IRegistryRead.GetValue with its nullable implementation
(CS8766); use [AllowNull] on the Control.Text overrides in MrngIpTextBox and
CommandButton (CS8765/CS8764); match the base TypeConverter.CanConvertFrom
signature (CS8604); return string.Empty rather than default from the RDM CSV
tuple, which callers already test with IsNullOrEmpty (CS8619); add null guards
in DataTableSerializer, PortableSettingsInitializer, RdpProtocol8, PuttyBase
and XmlConnectionsDeserializer; drop a [NotNull] on an unassigned parameter
(CS8777).

Analyzers: Environment.CurrentManagedThreadId (CA1840); System.Threading.Lock
(MA0158); CultureInfo-aware StringBuilder.Append (CA1305); explicit discards on
BCrypt cleanup results (CA1806); log instead of swallowing in a best-effort
hit-test (RCS1075).

Dead code: remove the unreferenced FrmMain.UserInterfaceResize event and the
BackupPage._frmMain field, whose only uses sit in a commented-out block; the
never-raised ICredentialRecord.PropertyChanged on PlaceholderCredentialRecord
keeps its normal semantics behind a scoped CS0067 suppression.

Pkcs5S2KeyGenerator moves to the static Rfc2898DeriveBytes.Pbkdf2 overload,
clearing SYSLIB0060 and CA5379. SHA1 is retained deliberately - it is required
to decrypt existing connection files - and the derived bytes are unchanged.
The package is supplied by the targeted framework, so the explicit
PackageReference only produced NU1510; no source in the repo uses the
System.DirectoryServices namespace. Removing it forced a real recompile of
ExternalConnectors, which surfaced an unused designer field (CS0169).
SupportedOSPlatformVersion was pinned at 10.0.26100.0 - stricter than
mRemoteNG.csproj's 10.0.17763.0 - so the test host refused to run on anything
older than Windows 11 24H2, reporting 'Only supported on Windows10.0.26100.0'
and zero executed tests. Aligning it with the app lets the suite run on 23H2
(10.0.22631) and older; no CA1416 warnings result.

Also set Nullable=annotations so tests may use 'T?' without enabling flow
analysis warnings across the project (CS8632).
Copilot AI lite review requested due to automatic review settings August 5, 2026 10:29
@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Eliminate build warnings and unblock test runs on Windows 11 23H2

🐞 Bug fix 🧪 Tests ⚙️ Configuration changes ✨ Enhancement 🕐 40+ Minutes

Grey Divider

AI Description

• Remove/resolve compiler and analyzer warnings across app, connectors, and tests.
• Harden nullability and error-handling in deserializers, UI helpers, and protocol code.
• Fix test project platform targeting so tests run on Windows 11 23H2.
Diagram

graph TD
  A["mRemoteNGTests.csproj"] --> B["Test host"] --> C["mRemoteNG app"] --> D["XML deserializer"] --> E["Connections decryptor"] --> F["PKCS5S2 KDF"] --> G[".NET PBKDF2 API"]
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Keep instance-based Rfc2898DeriveBytes + suppress warnings
  • ➕ No change to call pattern (closer to prior code)
  • ➕ Easier to attach per-instance state if needed later
  • ➖ Continues to trigger SYSLIB0060/CA5379 without suppression
  • ➖ Requires explicit disposal and can allocate more than static overload
2. Introduce a versioned KDF upgrade path (e.g., PBKDF2-SHA256 for new files)
  • ➕ Improves cryptographic posture for newly saved connection files
  • ➕ Avoids SHA1 dependence over time while retaining legacy support
  • ➖ Requires file format/version negotiation and migration logic
  • ➖ Higher QA burden; risk of breaking interoperability/backward reads
3. Centralize warning policy (global suppressions for known-acceptable legacy crypto)
  • ➕ Reduces churn across codebase for compatibility-driven exceptions
  • ➕ Makes legacy/security exceptions explicit and discoverable
  • ➖ Can hide real regressions if suppressions are too broad
  • ➖ Does not address test-host OS gating issue (still needs project fix)

Recommendation: The PR’s approach is appropriate: keep SHA1-based PBKDF2 for backward compatibility but switch to the static PBKDF2 API to remove obsolete/analyzer warnings without changing derived bytes. Review the key-derivation change carefully (inputs/iteration count/output length) and consider a future versioned KDF upgrade for new files if/when the file format can evolve.

Files changed (24) +45 / -36

Bug fix (10) +14 / -11
CsvConnectionsDeserializerRdmFormat.csReturn non-null group name in tuple +1/-1

Return non-null group name in tuple

• Replaces a default tuple value with string.Empty so callers consistently receive a non-null string and nullability warnings are avoided.

mRemoteNG/Config/Serializers/ConnectionSerializers/Csv/RemoteDesktopManager/CsvConnectionsDeserializerRdmFormat.cs

DataTableSerializer.csValidate ConstantID column before setting primary key +3/-1

Validate ConstantID column before setting primary key

• Adds an explicit guard when retrieving the ConstantID DataColumn and throws a clear exception if missing, preventing null-related warnings and failures.

mRemoteNG/Config/Serializers/ConnectionSerializers/Sql/DataTableSerializer.cs

XmlConnectionsDeserializer.csNull-safe full-file decryption assignment +2/-2

Null-safe full-file decryption assignment

• Ensures decrypt input/output are never null when setting InnerXml, preventing nullability warnings and reducing risk of null propagation during decrypt flows.

mRemoteNG/Config/Serializers/ConnectionSerializers/Xml/XmlConnectionsDeserializer.cs

PuttyBase.csAssert non-null InterfaceControl.Info for Vault OpenBao call +1/-1

Assert non-null InterfaceControl.Info for Vault OpenBao call

• Uses the null-forgiving operator for VaultOpenbaoSecretEngine access, aligning the cast with the surrounding null checks and analyzer expectations.

mRemoteNG/Connection/Protocol/PuttyBase.cs

RdpProtocol8.csAvoid possible null dereference in resize log message +1/-1

Avoid possible null dereference in resize log message

• Uses a null-safe hostname interpolation in the debug message to satisfy nullability analysis.

mRemoteNG/Connection/Protocol/RDP/RdpProtocol8.cs

Pkcs5S2KeyGenerator.csSwitch PBKDF2 derivation to static API +1/-2

Switch PBKDF2 derivation to static API

• Replaces instance-based Rfc2898DeriveBytes usage with the static Pbkdf2 overload to clear obsoletion/security analyzers while keeping PBKDF2-HMAC-SHA1 for legacy decryption compatibility.

mRemoteNG/Security/KeyDerivation/Pkcs5S2KeyGenerator.cs

MiscTools.csMatch TypeConverter signature for CanConvertFrom +1/-1

Match TypeConverter signature for CanConvertFrom

• Updates CanConvertFrom signature to match base type expectations, eliminating analyzer/compiler warnings and maintaining conversion behavior.

mRemoteNG/Tools/MiscTools.cs

IRegistryRead.csAlign registry read interface with nullable implementation +1/-1

Align registry read interface with nullable implementation

• Updates GetValue to return nullable and accept nullable name to match implementations and prevent nullability mismatches.

mRemoteNG/Tools/WindowsRegistry/IRegistryRead.cs

mrngIpTextBox.csAllow null assignment to Text override +1/-0

Allow null assignment to Text override

• Annotates Text override with [AllowNull] so callers can set null while the control normalizes it to empty strings.

mRemoteNG/UI/Controls/mrngIpTextBox.cs

CommandButton.csAllow null assignment to Text override +2/-1

Allow null assignment to Text override

• Adds [AllowNull] to the Text override to align with base behavior and silence nullability warnings while preserving rendering logic.

mRemoteNG/UI/TaskDialog/CommandButton.cs

Refactor (9) +16 / -14
CPSConnectionForm.Designer.csRemove unused designer field +0/-1

Remove unused designer field

• Deletes an unused WinForms designer label field to eliminate a dead-field warning.

ExternalConnectors/CPS/CPSConnectionForm.Designer.cs

DevLog.csUse Lock and CurrentManagedThreadId for analyzer compliance +2/-2

Use Lock and CurrentManagedThreadId for analyzer compliance

• Replaces object locking with System.Threading.Lock and logs thread id via Environment.CurrentManagedThreadId to satisfy analyzers without behavior change.

mRemoteNG/App/DevLog.cs

RemoteConnectionsSyncronizer.csUse System.Threading.Lock for timer synchronization +1/-1

Use System.Threading.Lock for timer synchronization

• Switches the timer gate from object to System.Threading.Lock to address analyzer guidance while preserving lock usage semantics.

mRemoteNG/Config/Connections/Multiuser/RemoteConnectionsSyncronizer.cs

PortableSettingsInitializer.csAnnotate provider initialization null argument +1/-1

Annotate provider initialization null argument

• Uses null! for SettingsProvider Initialize parameter to match API expectations and silence nullability warnings while keeping runtime behavior unchanged.

mRemoteNG/Config/Settings/Providers/PortableSettingsInitializer.cs

VncDesHelper.csExplicitly ignore BCrypt cleanup return values +3/-2

Explicitly ignore BCrypt cleanup return values

• Assigns BCrypt cleanup results to discards and documents why errors are ignored in finally blocks, satisfying CA1806.

mRemoteNG/Connection/Protocol/VNC/VncDesHelper.cs

PlaceholderCredentialRecord.csSuppress never-used PropertyChanged warning with scoped pragma +4/-0

Suppress never-used PropertyChanged warning with scoped pragma

• Adds a targeted CS0067 suppression around an intentionally never-raised event, preserving normal event semantics if later implemented.

mRemoteNG/Credential/PlaceholderCredentialRecord.cs

CredentialRecordListAdaptor.csRemove incorrect [NotNull] annotation from event handler +1/-1

Remove incorrect [NotNull] annotation from event handler

• Drops a [NotNull] attribute on a nullable sender parameter to satisfy nullability analyzers without changing behavior.

mRemoteNG/UI/Controls/Adapters/CredentialRecordListAdaptor.cs

BackupPage.csRemove unused FrmMain field +0/-1

Remove unused FrmMain field

• Deletes an unused FrmMain backing field that was only referenced in commented-out code, clearing dead-code warnings.

mRemoteNG/UI/Forms/OptionsPages/BackupPage.cs

frmMain.csLog hit-test exceptions and remove unused UI event +4/-5

Log hit-test exceptions and remove unused UI event

• Logs exceptions in IsCursorOverConfigWindow via DevLog instead of silently swallowing. Uses culture-aware StringBuilder.Append and removes an unused UserInterfaceResize event.

mRemoteNG/UI/Forms/frmMain.cs

Tests (3) +10 / -9
JsonConnectionsSerializerTests.csRemove duplicate using directive +0/-1

Remove duplicate using directive

• Eliminates a duplicate using System; to clear CS0105 in the test project.

mRemoteNGTests/Config/Serializers/ConnectionSerializers/Json/JsonConnectionsSerializerTests.cs

MicrosoftRdClientBackupDeserializerTests.csUse ordinal string comparisons in assertions +3/-2

Use ordinal string comparisons in assertions

• Rewrites string equality checks to string.Equals(..., StringComparison.Ordinal) to satisfy analyzer MA0006 and adds missing using directives.

mRemoteNGTests/Config/Serializers/MiscSerializers/MicrosoftRdClientBackupDeserializerTests.cs

MobaXTermSessionDeserializerTests.csUse ordinal string comparisons in LINQ predicates +7/-6

Use ordinal string comparisons in LINQ predicates

• Updates LINQ lookups to use StringComparison.Ordinal-based string.Equals to satisfy analyzer MA0006 and adds missing using directives.

mRemoteNGTests/Config/Serializers/MiscSerializers/MobaXTermSessionDeserializerTests.cs

Other (2) +5 / -2
ExternalConnectors.csprojDrop unused System.DirectoryServices reference +0/-1

Drop unused System.DirectoryServices reference

• Removes the System.DirectoryServices PackageReference since the framework supplies it and the codebase doesn’t use it, eliminating NU1510.

ExternalConnectors/ExternalConnectors.csproj

mRemoteNGTests.csprojUnblock test execution on older Windows by lowering platform minimum +5/-1

Unblock test execution on older Windows by lowering platform minimum

• Sets Nullable=annotations to enable nullable annotations without flow warnings. Lowers SupportedOSPlatformVersion to 10.0.17763.0 to match the app and allow running tests on Windows 11 23H2.

mRemoteNGTests/mRemoteNGTests.csproj

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR targets build/test hygiene across mRemoteNG by removing compiler/analyzer warnings, aligning test project platform settings so tests can execute on older Windows 11 builds, and applying small correctness/robustness tweaks in a few runtime components (notably logging, XML decryption, and key derivation).

Changes:

  • Aligns mRemoteNGTests platform/nullable settings to allow the test host to run on Windows 10.0.17763+ while enabling annotations-only nullability.
  • Eliminates warning sources via small API- and nullability-focused edits (e.g., string comparisons, nullability annotations, safer DataTable primary key setup).
  • Updates crypto and threading-related code paths to use newer framework APIs (Rfc2898DeriveBytes.Pbkdf2, System.Threading.Lock) while preserving existing behavior.

Reviewed changes

Copilot reviewed 23 out of 24 changed files in this pull request and generated no comments.

Show a summary per file
File Description
mRemoteNGTests/mRemoteNGTests.csproj Lowers SupportedOSPlatformVersion and enables Nullable=annotations to allow tests to run on older Windows builds.
mRemoteNGTests/Config/Serializers/MiscSerializers/MobaXTermSessionDeserializerTests.cs Replaces string equality checks with string.Equals(..., Ordinal) to satisfy analyzers.
mRemoteNGTests/Config/Serializers/MiscSerializers/MicrosoftRdClientBackupDeserializerTests.cs Same analyzer-driven ordinal string comparisons.
mRemoteNGTests/Config/Serializers/ConnectionSerializers/Json/JsonConnectionsSerializerTests.cs Removes duplicate using System; (CS0105).
mRemoteNG/UI/TaskDialog/CommandButton.cs Adjusts Text override nullability to match base while still allowing null assignment.
mRemoteNG/UI/Forms/OptionsPages/BackupPage.cs Removes an unused field.
mRemoteNG/UI/Forms/frmMain.cs Adds guarded dev logging for a hit-test exception path; adjusts formatting call and removes an unused event.
mRemoteNG/UI/Controls/mrngIpTextBox.cs Allows null assignment to Text override without making the property nullable.
mRemoteNG/UI/Controls/Adapters/CredentialRecordListAdaptor.cs Removes [NotNull] from event sender parameter to match event handler conventions.
mRemoteNG/Tools/WindowsRegistry/IRegistryRead.cs Updates registry read API nullability for name/return value.
mRemoteNG/Tools/MiscTools.cs Fixes override nullability signature for TypeConverter.CanConvertFrom.
mRemoteNG/Security/KeyDerivation/Pkcs5S2KeyGenerator.cs Uses the static PBKDF2 API to eliminate obsoletions/analyzer warnings while keeping SHA1 for compatibility.
mRemoteNG/Credential/PlaceholderCredentialRecord.cs Uses a scoped pragma to suppress an unused event warning without changing runtime event semantics.
mRemoteNG/Connection/Protocol/VNC/VncDesHelper.cs Explicitly ignores cleanup return codes in finally to satisfy analyzers.
mRemoteNG/Connection/Protocol/RDP/RdpProtocol8.cs Avoids potential nullability warnings in logging output.
mRemoteNG/Connection/Protocol/PuttyBase.cs Applies null-forgiveness to satisfy nullability analysis for VaultOpenbao secret engine access.
mRemoteNG/Config/Settings/Providers/PortableSettingsInitializer.cs Uses null! to satisfy nullability where an API requires a non-null argument but null is used by design.
mRemoteNG/Config/Serializers/ConnectionSerializers/Xml/XmlConnectionsDeserializer.cs Makes full-file decrypt assignment paths null-tolerant and preserves protective “empty tree” safety behavior.
mRemoteNG/Config/Serializers/ConnectionSerializers/Sql/DataTableSerializer.cs Throws a clear exception if the expected primary key column is missing.
mRemoteNG/Config/Serializers/ConnectionSerializers/Csv/RemoteDesktopManager/CsvConnectionsDeserializerRdmFormat.cs Normalizes tuple return value to string.Empty instead of a null default.
mRemoteNG/Config/Connections/Multiuser/RemoteConnectionsSyncronizer.cs Switches timer synchronization to System.Threading.Lock and keeps locking semantics localized.
mRemoteNG/App/DevLog.cs Switches to System.Threading.Lock and uses Environment.CurrentManagedThreadId for logging.
ExternalConnectors/ExternalConnectors.csproj Removes the redundant System.DirectoryServices package reference.
ExternalConnectors/CPS/CPSConnectionForm.Designer.cs Removes an unused designer field.
Files not reviewed (1)
  • ExternalConnectors/CPS/CPSConnectionForm.Designer.cs: Generated file

@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (3) 📜 Skill insights (0)

Grey Divider


Remediation recommended

1. GetValue missing XML param docs 📘 Rule violation ⚙ Maintainability
Description
The modified public interface method GetValue lacks required XML documentation elements for its
parameters and return value. This makes the public API documentation incomplete and non-compliant.
Code

mRemoteNG/Tools/WindowsRegistry/IRegistryRead.cs[21]

+        string? GetValue(RegistryHive hive, string path, string? name);
Evidence
Rule 1563561 requires public members to have XML documentation with at least <summary>, plus
<param> entries for each parameter and <returns> for non-void methods. The changed GetValue
declaration has only a <summary> block and no <param>/<returns> tags.

Rule 1563561: Require XML documentation comments on all public API members
mRemoteNG/Tools/WindowsRegistry/IRegistryRead.cs[13-22]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The public API member `IRegistryRead.GetValue(...)` is missing required XML documentation (`<param>` for each parameter and `<returns>` for the return value).

## Issue Context
The signature was modified in this PR (return type and `name` nullability), so its XML docs must meet the rule requirements.

## Fix Focus Areas
- mRemoteNG/Tools/WindowsRegistry/IRegistryRead.cs[13-22]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. BCrypt calls outside Security/ 📘 Rule violation ⛨ Security
Description
The modified cryptographic cleanup code in VncDesHelper calls BCrypt APIs directly from outside
the Security/ namespace, rather than delegating to an approved security provider. This violates
the project’s required crypto centralization pattern.
Code

mRemoteNG/Connection/Protocol/VNC/VncDesHelper.cs[R70-72]

+                // Cleanup status is intentionally ignored — nothing actionable can be done in a finally block.
+                if (hKey != 0) _ = BCryptDestroyKey(hKey);
+                if (hAlg != 0) _ = BCryptCloseAlgorithmProvider(hAlg, 0);
Evidence
Rule 1563368 requires cryptographic operations to be performed via approved providers in the
Security/ namespace, not via direct low-level crypto API calls in other areas. The modified code
in VncDesHelper directly calls BCryptDestroyKey and BCryptCloseAlgorithmProvider in a
non-Security/ path.

Rule 1563368: Use only approved security providers in the Security/ namespace for encryption and credential handling
mRemoteNG/Connection/Protocol/VNC/VncDesHelper.cs[47-73]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Crypto-related operations are being performed directly in `mRemoteNG/Connection/Protocol/VNC/VncDesHelper.cs` (outside the `Security/` namespace). The compliance rule requires crypto/credential handling to be invoked via approved providers under `Security/`.

## Issue Context
This PR modified the BCrypt cleanup calls (discarding return values) and added commentary, so the touched crypto code path must comply with the required provider pattern.

## Fix Focus Areas
- mRemoteNG/Connection/Protocol/VNC/VncDesHelper.cs[47-73]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Informational

3. _timerLock violates field naming 📘 Rule violation ⚙ Maintainability
Description
Modified non-public field names use leading underscores, violating the camelCase naming rule for
non-public fields and leaving touched code non-compliant with required naming conventions. This
change introduces/retains additional non-compliant naming in the updated declarations.
Code

mRemoteNG/Config/Connections/Multiuser/RemoteConnectionsSyncronizer.cs[18]

+        private readonly System.Threading.Lock _timerLock = new();
Evidence
Rule 1562273 requires non-public field names to be camelCase without leading underscores; the
changed declarations private readonly System.Threading.Lock _timerLock = new(); and `private
static readonly Lock _lock = new();` both include leading underscores, directly violating the rule
as shown in the cited lines.

Rule 1562273: Use camelCase for non-public field names
mRemoteNG/Config/Connections/Multiuser/RemoteConnectionsSyncronizer.cs[16-19]
mRemoteNG/App/DevLog.cs[14-14]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The modified non-public fields `_timerLock` and `_lock` use leading underscores, which violates the camelCase naming requirement for non-public fields.

## Issue Context
These fields were modified in this PR (type changed), so they should be brought into compliance while touched to avoid introducing or retaining naming-rule violations.

## Fix Focus Areas
- mRemoteNG/Config/Connections/Multiuser/RemoteConnectionsSyncronizer.cs[18-18]
- mRemoteNG/App/DevLog.cs[14-14]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context used
✅ Compliance rules (platform): 52 rules

To customize comments, go to the Qodo configuration screen, or learn more in the docs.

Qodo Logo

private readonly System.Timers.Timer _updateTimer;
private readonly IConnectionsUpdateChecker _updateChecker;
private readonly object _timerLock = new();
private readonly System.Threading.Lock _timerLock = new();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Informational

1. _timerlock violates field naming 📘 Rule violation ⚙ Maintainability

Modified non-public field names use leading underscores, violating the camelCase naming rule for
non-public fields and leaving touched code non-compliant with required naming conventions. This
change introduces/retains additional non-compliant naming in the updated declarations.
Agent Prompt
## Issue description
The modified non-public fields `_timerLock` and `_lock` use leading underscores, which violates the camelCase naming requirement for non-public fields.

## Issue Context
These fields were modified in this PR (type changed), so they should be brought into compliance while touched to avoid introducing or retaining naming-rule violations.

## Fix Focus Areas
- mRemoteNG/Config/Connections/Multiuser/RemoteConnectionsSyncronizer.cs[18-18]
- mRemoteNG/App/DevLog.cs[14-14]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

/// Gets the value of a registry entry specified by its name.
/// </summary>
string GetValue(RegistryHive hive, string path, string name);
string? GetValue(RegistryHive hive, string path, string? name);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remediation recommended

2. getvalue missing xml param docs 📘 Rule violation ⚙ Maintainability

The modified public interface method GetValue lacks required XML documentation elements for its
parameters and return value. This makes the public API documentation incomplete and non-compliant.
Agent Prompt
## Issue description
The public API member `IRegistryRead.GetValue(...)` is missing required XML documentation (`<param>` for each parameter and `<returns>` for the return value).

## Issue Context
The signature was modified in this PR (return type and `name` nullability), so its XML docs must meet the rule requirements.

## Fix Focus Areas
- mRemoteNG/Tools/WindowsRegistry/IRegistryRead.cs[13-22]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +70 to +72
// Cleanup status is intentionally ignored — nothing actionable can be done in a finally block.
if (hKey != 0) _ = BCryptDestroyKey(hKey);
if (hAlg != 0) _ = BCryptCloseAlgorithmProvider(hAlg, 0);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remediation recommended

3. Bcrypt calls outside security/ 📘 Rule violation ⛨ Security

The modified cryptographic cleanup code in VncDesHelper calls BCrypt APIs directly from outside
the Security/ namespace, rather than delegating to an approved security provider. This violates
the project’s required crypto centralization pattern.
Agent Prompt
## Issue description
Crypto-related operations are being performed directly in `mRemoteNG/Connection/Protocol/VNC/VncDesHelper.cs` (outside the `Security/` namespace). The compliance rule requires crypto/credential handling to be invoked via approved providers under `Security/`.

## Issue Context
This PR modified the BCrypt cleanup calls (discarding return values) and added commentary, so the touched crypto code path must comply with the required provider pattern.

## Fix Focus Areas
- mRemoteNG/Connection/Protocol/VNC/VncDesHelper.cs[47-73]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants