Files
poli0981andClaude Opus 5.5 9c91f5f01d fix: findings of the first Qodana analysis
High-severity findings in the shipped code:
- HashEngine disposes exactly the hash functions it created (a list instead of an array with null checks).
- SingleInstance allocates the pipe header once, not on the stack in every retry, and AllowSetForegroundWindow's
  unused result is no longer declared.
- Lambdas whose first parameter was named "_" assigned tasks to that parameter instead of discarding them
  (UnhandledException handler, settings save timer).
- ChecksumWriter sets the writer's NewLine after the using declaration; LocalizationService raises the indexer change
  without a caller-info argument; VerifyCommand's Outcome drops a field nobody read.
- Nullability: converters return non-null values, the language combo box may set null, FocusManager is never null.
- Redundant usings (global usings of the app), qualifiers and default arguments; C# 14 lambda parameters.
- FocusHandOff, RowTabNavigation and HighlightTextBlock move to Views/Controls, matching their namespace.

qodana.yaml analyses the shipped code (tests and benchmarks are covered by the build, analyzers and SonarCloud),
leaves Roslyn analyzer suggestions to the build, documents each remaining exclusion, and fails on critical or high
findings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 09:17:31 +07:00

66 lines
2.5 KiB
YAML

# Qodana for .NET (Ultimate licence), run by .github/workflows/qodana.yml.
version: "1.0"
# Native mode: analyses with the .NET SDK installed on the runner instead of the one bundled in the Docker image.
linter: qodana-dotnet
withinDocker: false
dotnet:
solution: HashTool.slnx
# The shipped code. Tests and benchmarks are checked by the compiler, the analyzers and SonarCloud; the legacy client is
# pinned to Velopack 0.0.1298 on purpose (the release upgrade gate runs it like a Hash Tool 1.1.x client).
exclude:
- name: All
paths:
- tests
- bench
profile:
base:
name: qodana.recommended
groups:
- groupId: RoslynAnalyzers
groups:
- "category:C#/Roslyn Analyzers"
inspections:
# Roslyn analyzers (Meziantou, .NET, CommunityToolkit.Mvvm) already run in every build, where their warnings fail
# CI; their suggestions are not repeated here (SonarCloud ignores them too).
- group: RoslynAnalyzers
enabled: false
# Translations may equal the English text: en-GB/en-IN/en-SG, product and technical names.
- inspection: OverriddenWithSameValue
ignore:
- "src/HashTool.App/Lang/**"
# Compiled bindings such as $parent[Window].((vm:MainWindowViewModel)DataContext).X: the data context is set by the
# view that hosts the control.
- inspection: Xaml.PossibleNullReferenceException
enabled: false
# "accent" comes from the Fluent theme; "hashInput" marks the expected-hash box for code-behind.
- inspection: Xaml.StyleClassNotFound
enabled: false
# OnXChanged(value) partial methods are declared by CommunityToolkit.Mvvm's generator.
- inspection: UnusedParameterInPartialMethod
enabled: false
# Drag and drop handlers must be async void; their exceptions reach Dispatcher.UIThread.UnhandledException.
- inspection: AsyncVoidLambda
ignore:
- "src/HashTool.App/Views/**"
# The application manifest uses the Windows side-by-side schema, which the XML checker does not know.
- inspection: XmlHighlighting
ignore:
- "src/HashTool.App/app.manifest"
# Avalonia's application class, completed by the XAML compiler.
- inspection: PartialTypeWithSinglePart
ignore:
- "src/HashTool.App/App.axaml.cs"
# The smoke test cancels the token from a continuation that runs before the dispatcher loop returns.
- inspection: AccessToDisposedClosure
ignore:
- "src/HashTool.App/Infrastructure/SmokeTest.cs"
failureConditions:
severityThresholds:
critical: 0
high: 0