Skip to content

Fix CA1506 coupling and resolve cross-platform IDE0055 line-ending errors#59

Merged
matt-edmondson merged 1 commit into
mainfrom
claude/vibrant-dijkstra-huPfg
Jun 6, 2026
Merged

Fix CA1506 coupling and resolve cross-platform IDE0055 line-ending errors#59
matt-edmondson merged 1 commit into
mainfrom
claude/vibrant-dijkstra-huPfg

Conversation

@matt-edmondson

Copy link
Copy Markdown
Contributor

Summary

Addresses all CA1506 (avoid excessive class coupling) violations, and fixes the root cause that was masking them on non-Windows checkouts.

CA1506

Program.AddIosCommand was coupled with 42 different types (threshold is 41 / more than 40 for a method) because it inlined all three iOS subcommand handlers (build, package, upload). It is now split into AddIosBuildSubcommand, AddIosPackageSubcommand, and AddIosUploadSubcommand, distributing the coupling so each method stays under the threshold. This matches the existing per-command decomposition pattern already used throughout Program.cs.

The core library and test project had no CA1506 violations.

IDE0055 line endings (the reason CA1506 was hard to see)

.editorconfig declares end_of_line = crlf, but .gitattributes used only * text=auto, which checks .cs files out with LF on Linux/macOS. On those platforms (including CI) the IDE0055 formatting analyzer then failed on every line of every source file — ~2000 errors per project — drowning out real diagnostics like CA1506.

Added explicit eol=crlf rules for .NET source files (*.cs, *.csx, *.cake, *.fs, *.fsx, *.vb, *.vbx) so the working tree is consistent with .editorconfig on every platform. The stored blobs are unchanged (git keeps them normalized to LF); only the checkout smudge changes, so this is a clean, content-free fix that holds forever across all OSes.

Verification

  • All three projects build clean: 0 CA1506, 0 IDE0055.
  • Confirmed CA1506 is a live analyzer here (verified with a throwaway over-coupled probe method) so the build itself is the authoritative detector.
  • Full test suite passes: 349/349.

https://claude.ai/code/session_01R3sUvtkhQACQPZF9ejMgv9


Generated by Claude Code

…rors

Split AddIosCommand into per-subcommand methods (build/package/upload) so it
no longer exceeds the CA1506 class-coupling threshold (was coupled with 42
types, limit 41). The three handlers are extracted into AddIosBuildSubcommand,
AddIosPackageSubcommand, and AddIosUploadSubcommand, matching the existing
per-command decomposition pattern in Program.cs.

Add explicit eol=crlf .gitattributes rules for .NET source files so they are
checked out with CRLF on every platform, matching .editorconfig's
end_of_line = crlf. Previously text=auto produced LF working trees on
Linux/macOS, causing the IDE0055 formatting analyzer to fail on every line of
every source file during non-Windows checkouts (including CI).

https://claude.ai/code/session_01R3sUvtkhQACQPZF9ejMgv9
@sonarqubecloud

sonarqubecloud Bot commented Jun 6, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
5 Security Hotspots
64.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@matt-edmondson matt-edmondson merged commit 70238e7 into main Jun 6, 2026
4 of 5 checks passed
@matt-edmondson matt-edmondson deleted the claude/vibrant-dijkstra-huPfg branch June 6, 2026 05:39
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