-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Add XML comments on all public members where missing #629
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
📝 WalkthroughWalkthroughAdds 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
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
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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
⏰ 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)
🔇 Additional comments (2)
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. Comment |
There was a problem hiding this 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 forpostingKey
.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 throwInvalidCastException
if the hex color string is invalid. While this may be acceptable behavior, consider:
- Documenting in XML comments that
ArgumentException
orFormatException
may be thrown for invalid color strings, or- 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 toGetGraphic
’srepeatPerModule
; 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
📒 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
(notAes256Cfb
), 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 theQRCodeHelper
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 thePlaceVersion
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 theReserveSeperatorAreas
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 bothDotted
andFlat
options.
255-263
: LGTM! Enum documentation is clear and accurate.The XML documentation for the
BackgroundImageStyle
enum members correctly describes the rendering behavior for bothFill
andDataAreaOnly
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 allImageType
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 thePdfByteQRCode
class (lines 17-19 removed) but added toPdfByteQRCodeHelper
(lines 222-224). ThePdfByteQRCode
class uses Windows-onlySystem.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, IDisposableQRCoder/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.
Sorta nice when, for $2.69, you can fix hundreds of build warnings with a single prompt, while playing Minecraft with your kids:
|
If #628 is merged first, I'll make a slight change to enable CS1591;CS1572;CS1573;CS1587 warnings for IsPackable projects in this PR. |
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. 🙌 |
No functional changes; just XML comment changes.
Summary by CodeRabbit
New Features
Documentation
Chores