Skip to content

Conversation

Shane32
Copy link
Owner

@Shane32 Shane32 commented Oct 3, 2025

No functional changes; just XML comment changes.

Summary by CodeRabbit

  • New Features

    • Added richer XAML QR generation options and a one-call helper; new ASCII QR constructors and helper overloads; SVG adds a viewBox sizing mode.
    • Expanded supported image type to include GIF.
    • ShadowSocks config now exposes many additional cipher method options and a specific config exception type.
    • Russia payment payload supports 15 additional TechCode values.
  • Documentation

    • Extensive XML docs added/expanded across enums, parameters, and helpers.
  • Chores

    • Adjusted build warning suppression rules.

@Shane32 Shane32 added this to the 1.7.0 milestone Oct 3, 2025
@Shane32 Shane32 requested a review from gfoidl October 3, 2025 05:11
@Shane32 Shane32 self-assigned this Oct 3, 2025
Copy link

coderabbitai bot commented Oct 3, 2025

📝 Walkthrough

Walkthrough

Adds new public XAML and ASCII QR-generation APIs/overloads, expands several public enums (Base64 image types, ShadowSocks methods, Russia payment TechCode), introduces a ShadowSocksConfigException, adds an SVG sizing mode, moves a platform attribute, and applies many XML documentation updates. No behavioral changes beyond the added APIs and enum members.

Changes

Cohort / File(s) Summary of Changes
XAML QR rendering enhancements
QRCoder.Xaml/XamlQRCode.cs
Added multiple GetGraphic overloads (pixelsPerModule / viewBox / color hex / Brush / drawQuietZones), GetUnitsPerModule, and new public static XamlQRCodeHelper.GetQRCode(...). XML docs added.
ASCII QR helpers and ctor
QRCoder/ASCIIQRCode.cs
Added public AsciiQRCode(QRCodeData) constructor and two AsciiQRCodeHelper.GetQRCode(...) overloads (full-size and small) with XML docs.
SVG sizing mode update
QRCoder/SvgQRCode.cs
Added SizingMode.ViewBoxAttribute enum member; expanded XML docs for SvgLogo media types.
Base64 image type enum
QRCoder/Base64QRCode.cs
Added ImageType.Gif and updated ImageType.Jpeg summary; enum ordering now Gif, Jpeg, Png.
ShadowSocks config expansion
QRCoder/PayloadGenerator/ShadowSocksConfig.cs
Expanded Method enum with many cipher entries; added public nested ShadowSocksConfigException with standard constructors.
Russia payment tech codes
QRCoder/PayloadGenerator/RussiaPaymentOrder.cs
Added 15 new TechCode enum members (explicit numeric values 01–15) with XML docs.
PayloadGenerators documentation updates
QRCoder/PayloadGenerator/BezahlCode.cs, .../OneTimePassword.cs, .../SwissQrCode.cs
Added/updated XML documentation for currencies, OTP enums, and SwissQrCode AdditionalInformation param. No signature/behavior changes.
PDF / QRCode platform attributes
QRCoder/PdfByteQRCode.cs, QRCoder/QRCode.cs
Moved [SupportedOSPlatform("windows")] attribute from PdfByteQRCode to PdfByteQRCodeHelper; adjusted attribute placement in QRCode.cs XML region.
ArtQRCode docs
QRCoder/ArtQRCode.cs
Added XML docs for QuietZoneStyle and BackgroundImageStyle members.
Module placer docs
QRCoder/QRCodeGenerator/ModulePlacer.BlockedModules.cs, QRCoder/QRCodeGenerator/ModulePlacer.cs
Minor XML doc wording changes and added missing param docs.
Build files
Directory.Build.props, Directory.Build.targets
Narrowed global NoWarn (props) and added conditional NoWarn append for CS1591 when IsPackable != true (targets).

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Caller
  participant Generator as QRCodeGenerator
  participant Data as QRCodeData
  participant Xaml as XamlQRCode
  participant Image as DrawingImage

  Caller->>Generator: Create/CreateQrCode(plainText, ecc, options)
  Generator-->>Data: QRCodeData
  Caller->>Xaml: new XamlQRCode(Data)
  Caller->>Xaml: GetGraphic(pixelsPerModule/viewBox, colors, drawQuietZones)
  Xaml-->>Caller: DrawingImage
Loading
sequenceDiagram
  autonumber
  participant Caller
  participant Generator as QRCodeGenerator
  participant Data as QRCodeData
  participant Ascii as AsciiQRCode
  participant Text as ASCIIString

  Caller->>Generator: Create/CreateQrCode(plainText, ecc, options)
  Generator-->>Data: QRCodeData
  Caller->>Ascii: new AsciiQRCode(Data)
  Caller->>Ascii: GetGraphic(...)/GetGraphicSmall(...)
  Ascii-->>Caller: ASCII QR string
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • gfoidl
  • codebude

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title clearly states the primary action of adding missing XML documentation to public members, which aligns with the pull request’s stated objective of improving documentation across the codebase and concisely captures the main change.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch xml

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 93fb6c9 and e93b49d.

📒 Files selected for processing (2)
  • Directory.Build.props (1 hunks)
  • Directory.Build.targets (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: additional-tests
  • GitHub Check: build
🔇 Additional comments (2)
Directory.Build.props (1)

41-41: LGTM! Enables XML comment warnings for packable projects.

This change removes global suppression of XML comment warnings (CS1591, CS1572, CS1573, CS1587), enabling them for packable projects while Directory.Build.targets maintains CS1591 suppression for non-packable projects. This aligns with the PR objective to enforce XML documentation on public members in packable projects.

Directory.Build.targets (1)

14-18: LGTM! Correctly suppresses XML comment warnings for non-packable projects.

The conditional suppression of CS1591 (missing XML comments) for non-packable projects is appropriate, as test projects and samples don't require XML documentation. Note that CS1572, CS1573, and CS1587 (incorrect XML comments) remain enabled even for non-packable projects, ensuring any existing documentation is correct.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
QRCoder/PayloadGenerator/BezahlCode.cs (1)

40-56: Missing parameter documentation for postingKey.

The postingKey parameter exists in the constructor signature (line 56) but its XML documentation appears to have been removed. The SEPA constructor (lines 63-79) and the generic constructor (lines 86-109) both document this parameter.

Apply this diff to restore the parameter documentation:

 /// <param name="periodicFirstExecutionDate">Date of first periodic execution</param>
 /// <param name="periodicLastExecutionDate">Date of last periodic execution</param>
 /// <param name="reason">Reason (Verwendungszweck)</param>
+/// <param name="postingKey">Transfer Key (Textschlüssel, z.B. Spendenzahlung = 69)</param>
 /// <param name="currency">Currency (Währung)</param>
 /// <param name="executionDate">Execution date (Ausführungsdatum)</param>
🧹 Nitpick comments (2)
QRCoder.Xaml/XamlQRCode.cs (1)

54-67: Consider error handling for invalid color strings.

The method uses (Color)ColorConverter.ConvertFromString(...) which can throw InvalidCastException if the hex color string is invalid. While this may be acceptable behavior, consider:

  1. Documenting in XML comments that ArgumentException or FormatException may be thrown for invalid color strings, or
  2. Adding explicit validation and throwing a more descriptive exception.

This improves API usability by making the failure modes clearer to callers.

QRCoder/ASCIIQRCode.cs (1)

139-160: Clarify naming between pixelsPerModule and repeatPerModule.

  • The static helper’s pixelsPerModule parameter maps directly to GetGraphic’s repeatPerModule; consider aligning these names or adding a note in the XML docs to avoid confusion.
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 434e7be and 93fb6c9.

📒 Files selected for processing (14)
  • QRCoder.Xaml/XamlQRCode.cs (3 hunks)
  • QRCoder/ASCIIQRCode.cs (3 hunks)
  • QRCoder/ArtQRCode.cs (2 hunks)
  • QRCoder/Base64QRCode.cs (1 hunks)
  • QRCoder/PayloadGenerator/BezahlCode.cs (1 hunks)
  • QRCoder/PayloadGenerator/OneTimePassword.cs (3 hunks)
  • QRCoder/PayloadGenerator/RussiaPaymentOrder.cs (1 hunks)
  • QRCoder/PayloadGenerator/ShadowSocksConfig.cs (1 hunks)
  • QRCoder/PayloadGenerator/SwissQrCode.cs (1 hunks)
  • QRCoder/PdfByteQRCode.cs (1 hunks)
  • QRCoder/QRCode.cs (2 hunks)
  • QRCoder/QRCodeGenerator/ModulePlacer.BlockedModules.cs (1 hunks)
  • QRCoder/QRCodeGenerator/ModulePlacer.cs (2 hunks)
  • QRCoder/SvgQRCode.cs (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (4)
QRCoder/PdfByteQRCode.cs (2)
QRCoder/Base64QRCode.cs (2)
  • System (122-133)
  • System (144-158)
QRCoderConsole/Program.cs (1)
  • System (239-249)
QRCoder.Xaml/XamlQRCode.cs (3)
QRCoder/AbstractQRCode.cs (3)
  • AbstractQRCode (7-47)
  • AbstractQRCode (17-20)
  • AbstractQRCode (26-29)
QRCoder/QRCodeData.cs (5)
  • QRCodeData (12-251)
  • QRCodeData (23-30)
  • QRCodeData (37-44)
  • QRCodeData (51-53)
  • QRCodeData (60-126)
QRCoder/QRCodeGenerator.cs (10)
  • QRCodeData (33-34)
  • QRCodeData (43-44)
  • QRCodeData (57-58)
  • QRCodeData (67-68)
  • QRCodeData (77-78)
  • QRCodeData (87-94)
  • QRCodeData (107-158)
  • QRCodeData (168-237)
  • QRCodeData (246-259)
  • QRCodeData (287-460)
QRCoder/QRCode.cs (2)
QRCoder/Base64QRCode.cs (2)
  • System (122-133)
  • System (144-158)
QRCoderConsole/Program.cs (1)
  • System (239-249)
QRCoder/Base64QRCode.cs (1)
QRCoderConsole/Program.cs (1)
  • System (239-249)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: additional-tests
  • GitHub Check: build
🔇 Additional comments (29)
QRCoder/QRCodeGenerator/ModulePlacer.BlockedModules.cs (1)

21-24: Doc clarification looks accurate.

The updated summary and parameter description now match the constructor semantics. Nicely done.

QRCoder/PayloadGenerator/RussiaPaymentOrder.cs (1)

589-677: LGTM! Excellent documentation additions.

The XML documentation for all TechCode enum members is complete, well-formatted, and provides clear bilingual descriptions (English and Russian). This aligns perfectly with the PR objective to add XML comments on all public members where missing.

QRCoder/PayloadGenerator/OneTimePassword.cs (3)

70-78: LGTM! Clear documentation for OTP types.

The XML documentation correctly describes TOTP (Time-based One-Time Password) and HOTP (HMAC-based One-Time Password), making the enum members self-documenting.


86-99: LGTM! Clear documentation for hashing algorithms.

The XML documentation accurately describes each hashing algorithm option (SHA-1, SHA-256, SHA-512) for OTP generation.


108-121: LGTM! Appropriate documentation for obsolete enum.

The XML documentation correctly identifies each member and includes "(Obsolete)" notes, which is consistent with the enum-level [Obsolete] attribute. This helps developers understand both what the members represent and their deprecated status.

QRCoder/PayloadGenerator/ShadowSocksConfig.cs (2)

197-386: LGTM! Documentation is comprehensive and accurate.

The XML documentation for all Method enum members is thorough and correctly categorizes encryption methods (AEAD, stream cipher, deprecated, non-standard). Technical descriptions are accurate.

Note: Line 278 shows Aes256Cb (not Aes256Cfb), which appears to be a pre-existing naming inconsistency. The XML comment correctly identifies it as an "Alias for AES-256 Cipher Feedback (CFB)" and the mapping table (line 38) correctly maps it to "aes-256-cfb". Since this PR focuses on documentation additions only, this pre-existing naming anomaly is outside the scope of review.


389-419: LGTM! Exception documentation follows .NET conventions.

The XML documentation for ShadowSocksConfigException and its constructors is complete and follows standard .NET exception documentation patterns. All public members are properly documented with appropriate tags (<summary>, <param>, <see cref/>).

QRCoder/PayloadGenerator/SwissQrCode.cs (1)

44-44: LGTM! Documentation addition is accurate.

The XML documentation for the additionalInformation parameter correctly describes its purpose and is consistent with the other parameter documentation in the constructor.

QRCoder/QRCode.cs (2)

12-14: LGTM! Platform attribute placement is correct.

The SupportedOSPlatform attribute has been correctly positioned after the XML documentation and before the class declaration, which is the standard convention.


175-177: LGTM! Platform attribute correctly applied to helper class.

The SupportedOSPlatform attribute is appropriately added to the QRCodeHelper class, ensuring consistent platform restrictions across the QRCode module.

QRCoder/QRCodeGenerator/ModulePlacer.cs (2)

16-16: LGTM! Parameter documentation is accurate.

The XML documentation for the offset parameter correctly describes its purpose in the PlaceVersion method.


258-258: LGTM! Parameter documentation is accurate.

The XML documentation for the version parameter correctly describes its role in determining the number of finder patterns in the ReserveSeperatorAreas method.

QRCoder/ArtQRCode.cs (2)

239-247: LGTM! Enum documentation is clear and accurate.

The XML documentation for the QuietZoneStyle enum members correctly describes the rendering behavior for both Dotted and Flat options.


255-263: LGTM! Enum documentation is clear and accurate.

The XML documentation for the BackgroundImageStyle enum members correctly describes the rendering behavior for both Fill and DataAreaOnly options.

QRCoder/PayloadGenerator/BezahlCode.cs (1)

338-1049: LGTM! Comprehensive currency enum documentation.

The XML documentation for all 173 ISO 4217 currency codes is complete, accurate, and consistently formatted.

QRCoder/Base64QRCode.cs (1)

166-184: LGTM! ImageType enum documentation is comprehensive.

The addition of the Gif member and enhanced documentation for all ImageType enum values is accurate and consistent. The implementation already supports GIF format (line 152), so this change properly documents existing functionality.

QRCoder/PdfByteQRCode.cs (1)

17-21: Verify platform attribute removal from PdfByteQRCode class.

The SupportedOSPlatform("windows") attribute was removed from the PdfByteQRCode class (lines 17-19 removed) but added to PdfByteQRCodeHelper (lines 222-224). The PdfByteQRCode class uses Windows-only System.Drawing.Image (line 85), so removing the attribute may allow instantiation on non-Windows platforms where it will fail at runtime.

Consider whether the attribute should be on both the class and the helper, not moved from one to the other:

+#if NET6_0_OR_GREATER
+[System.Runtime.Versioning.SupportedOSPlatform("windows")]
+#endif
 public class PdfByteQRCode : AbstractQRCode, IDisposable
QRCoder/SvgQRCode.cs (2)

252-260: LGTM! SizingMode enum documentation is clear.

The XML documentation for the SizingMode enum members correctly describes the two SVG sizing approaches using width/height attributes vs. viewBox attribute.


372-386: LGTM! MediaType enum documentation is accurate.

The XML documentation for the MediaType enum members correctly describes both PNG and SVG image formats.

QRCoder/ASCIIQRCode.cs (2)

18-22: LGTM!

The XML documentation for the constructor is clear and accurate.


162-181: LGTM!

The helper method is well-documented and correctly implements the one-shot pattern for generating small ASCII QR codes. Resource disposal is handled properly with using statements.

QRCoder.Xaml/XamlQRCode.cs (8)

8-10: LGTM!

The class-level XML documentation is clear and accurately describes the purpose of the class.


18-22: LGTM!

The constructor XML documentation is clear and accurate.


24-30: LGTM!

The method overload and its documentation are clear and correctly delegate to the more specific overload.


32-43: LGTM!

The method overload and its documentation are clear. The implementation correctly calculates the view box size and delegates to the more specific overload with default colors.


45-52: LGTM!

The method overload and its documentation are clear. The implementation correctly delegates to the more specific overload with default colors.


69-105: LGTM!

The core rendering method and its documentation are clear and correct. The implementation properly constructs the XAML DrawingImage with the specified brushes and quiet zone settings.


110-121: LGTM!

The method and its documentation are clear. The implementation correctly calculates the units per module based on the view box size.


124-150: LGTM!

The helper class and its method are well-documented and correctly implement the one-shot pattern for generating XAML QR codes. Resource disposal is handled properly with using statements.

@Shane32
Copy link
Owner Author

Shane32 commented Oct 3, 2025

Sorta nice when, for $2.69, you can fix hundreds of build warnings with a single prompt, while playing Minecraft with your kids:

build the solution. fix the xml comment errors. rebuild and continue fixing xml comment errors. repeat until the project builds successfully

@Shane32
Copy link
Owner Author

Shane32 commented Oct 3, 2025

If #628 is merged first, I'll make a slight change to enable CS1591;CS1572;CS1573;CS1587 warnings for IsPackable projects in this PR.

@codebude
Copy link
Collaborator

codebude commented Oct 3, 2025

Sorta nice when, for $2.69, you can fix hundreds of build warnings with a single prompt, while playing Minecraft with your kids:

It's great to hear that you play with your kids. Given the number of commits, one might have thought you had forced your kids to code with you. 😄

I am deeply impressed by the pace you are setting here and really happy with the enthusiasm you are putting into the project. 🙌

@gfoidl
Copy link
Collaborator

gfoidl commented Oct 3, 2025

If #628 is merged first, I'll make a slight change to enable CS1591;CS1572;CS1573;CS1587 warnings for IsPackable projects in this PR.

#628 should be merged first. I'll review after that merge.
(I'm out of office, hopefully back on Sunday to continue work here).

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

Successfully merging this pull request may close these issues.

3 participants