Skip to content

IncrementalHashAdapter uses a this. qualifier, the only one in the codebase #10

Description

@matt-edmondson

Essentials/IncrementalHashAdapter.cs:38 reads:

this.inner = inner;

This is the only this.-qualified member access in the repository.

It contradicts three things at once: the project's stated C# conventions (CLAUDE.md says not to use this. qualifiers), .editorconfig:29 (dotnet_style_qualification_for_field = false:error), and the repo's own idiom for exactly this situation — Essentials.ObfuscationProviders.BitRotate/BitRotateObfuscationProvider.cs:15,29 resolves the same field/parameter name collision by naming the field _bits rather than qualifying.

It does not fail the build only because EnforceCodeStyleInBuild is not set anywhere in the project or props files, so the IDE-style analyzers do not run during dotnet build.

How it got there

IncrementalHashAdapter was originally written with a primary constructor. Adding argument validation (Ensure.NotNull(inner) plus a range check) required converting it to a normal constructor, which left the field and the parameter both named inner and forced the qualifier to disambiguate.

Fix

Rename the field to _inner and drop the qualifier, matching BitRotateObfuscationProvider. One line.

Aside

EnforceCodeStyleInBuild not being set means no .editorconfig style rule marked :error is actually enforced at build time. That is worth its own look — the settings currently read as stricter than they are.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P4Backlog; nothing brokenbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions