-
Notifications
You must be signed in to change notification settings - Fork 3
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
v3.6.1 #64
v3.6.1 #64
Conversation
Modified the `Total` property in `PlayerRealtimeStatisticsFilterResult` to have a default value of 0. Changed `HitsPer60` and `TakeawaysPer60` in `PlayerRealtimeStatisticsResult` to nullable doubles. Updated several properties in `PlayerStatisticsResult` from non-nullable to nullable types, including `GameWinningGoals`, `GamesPlayed`, `Goals`, `OvertimeGoals`, `PenaltyMinutes`, `Points` (int to int?) and `PointsPerGame` (decimal to decimal?). Changed `Total` in `PlayerTimeOnIceStatisticsFilterResult` from int to int?. Updated multiple properties in `PlayerTimeOnIceStatisticsResult` from non-nullable to nullable types, including `EvTimeOnIce`, `GamesPlayed`, `OtTimeOnIce`, `PpTimeOnIce`, `SeasonId`, `ShTimeOnIce`, `Shifts`, `TimeOnIce` (int to int?) and `EvTimeOnIcePerGame`, `OtTimeOnIcePerOtGame`, `PpTimeOnIcePerGame`, `ShTimeOnIcePerGame`, `ShiftsPerGame` (double to double?).
Updated the version number from 3.6.0 to 3.6.1 in the following files: - Nhl.Api.Common.csproj - Nhl.Api.Domain.csproj - Nhl.Api.Tests.csproj - Nhl.Api.csproj
Changed SeasonId in PlayerTimeOnIceStatisticsResult from int? to int. This ensures SeasonId always has a valid integer value, preventing potential null reference issues in the code.
📝 WalkthroughWalkthroughThe pull request includes updates across several project files, primarily focusing on incrementing the version number from Changes
Possibly related PRs
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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: 1
🧹 Outside diff range and nitpick comments (2)
Nhl.Api.Domain/Models/Statistics/PlayerTimeOnIceStatisticsFilterResult.cs (1)
Line range hint
33-141
: Consider updating documentation for nullable propertiesWhile the changes to make these properties nullable are appropriate, consider updating the XML documentation comments to indicate that these values can be null and under what circumstances (e.g., "Can be null if the player had no even-strength time on ice or if the data is unavailable").
Nhl.Api.Domain/Models/Statistics/PlayerRealtimeStatisticsFilterResult.cs (1)
Line range hint
77-78
: Consider making GiveawaysPer60 nullable for consistencyThe
GiveawaysPer60
property is still non-nullable while similar per60 statistics properties (BlockedShotsPer60
,HitsPer60
,TakeawaysPer60
) are nullable. Consider making this property nullable as well for consistency.- public double GiveawaysPer60 { get; set; } + public double? GiveawaysPer60 { get; set; }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (7)
Nhl.Api.Common/Nhl.Api.Common.csproj
(1 hunks)Nhl.Api.Domain/Models/Statistics/PlayerRealtimeStatisticsFilterResult.cs
(2 hunks)Nhl.Api.Domain/Models/Statistics/PlayerStatisticsFilterResult.cs
(3 hunks)Nhl.Api.Domain/Models/Statistics/PlayerTimeOnIceStatisticsFilterResult.cs
(5 hunks)Nhl.Api.Domain/Nhl.Api.Domain.csproj
(1 hunks)Nhl.Api.Tests/Nhl.Api.Tests.csproj
(1 hunks)Nhl.Api/Nhl.Api.csproj
(1 hunks)
✅ Files skipped from review due to trivial changes (4)
- Nhl.Api.Common/Nhl.Api.Common.csproj
- Nhl.Api.Domain/Nhl.Api.Domain.csproj
- Nhl.Api.Tests/Nhl.Api.Tests.csproj
- Nhl.Api/Nhl.Api.csproj
🔇 Additional comments (8)
Nhl.Api.Domain/Models/Statistics/PlayerTimeOnIceStatisticsFilterResult.cs (6)
33-33
: LGTM: Even strength time properties are now nullable
The change to make EvTimeOnIce
and EvTimeOnIcePerGame
nullable is appropriate as these statistics might not be available for all scenarios.
Also applies to: 39-39
57-57
: LGTM: Overtime properties are now nullable
Making OtTimeOnIce
and OtTimeOnIcePerOtGame
nullable is logical since not all games go to overtime.
Also applies to: 63-63
81-81
: LGTM: Power play properties are now nullable
The change to make PpTimeOnIce
and PpTimeOnIcePerGame
nullable is appropriate as not all games will have power play situations.
Also applies to: 87-87
99-99
: LGTM: Short-handed properties are now nullable
Making ShTimeOnIce
and ShTimeOnIcePerGame
nullable aligns with the other special team statistics changes.
Also applies to: 105-105
141-141
: LGTM: Total time property is now nullable
Making TimeOnIce
nullable is consistent with the other time-related property changes.
Let's verify that all time-related properties in the codebase are consistently nullable:
✅ Verification successful
The previous ast-grep patterns might have been too strict. Let's use ripgrep to find any mentions of TimeOnIce properties with surrounding context to verify the consistency of nullability.
All time-related properties are consistently nullable in the codebase
The search results confirm that all time-on-ice related properties in the PlayerTimeOnIceStatisticsFilterResult
class are consistently nullable, including:
TimeOnIce
EvTimeOnIce
OtTimeOnIce
PpTimeOnIce
ShTimeOnIce
TimeOnIcePerGame
TimeOnIcePerShift
The only non-nullable time-on-ice property found is in TeamSeasonStatistics
class, which is a different context and not related to player statistics.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Search for any remaining non-nullable time-on-ice properties
ast-grep --pattern 'public int TimeOnIce { get; set; }'
ast-grep --pattern 'public double TimeOnIce { get; set; }'
Length of output: 118
Script:
#!/bin/bash
# Search for any time-on-ice properties with broader pattern matching
rg -i "timeonice" -A 1 -B 1
Length of output: 31084
Line range hint 33-141
: Verify data consumers handle null values
These changes make the model more accurate but could potentially break existing consumers that aren't prepared to handle null values.
Let's check for direct property access that might need null checking:
Consider:
- Adding validation or default value handling in the property getters
- Documenting the breaking change in release notes
- Providing migration guidance for consumers
✅ Verification successful
Let me gather more information about the usage of these nullable properties by checking for any direct property access in test files and implementations.
Let me try one more search pattern to find any direct usage of these properties:
Let me try one final search with the PCRE2 flag to find direct property usage:
Nullable time-on-ice properties are safe to introduce
Based on the codebase analysis, making these properties nullable is safe because:
- The properties are only used in API responses through
PlayerTimeOnIceStatisticsFilterResult
- The model is properly decorated with JSON attributes for serialization/deserialization
- No direct property access or calculations were found in the codebase that could be affected by null values
- The only usages are in API contracts where null values are already expected and handled
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Search for direct property access that might need null checking
rg -t cs "\.EvTimeOnIce|\.PpTimeOnIce|\.ShTimeOnIce|\.OtTimeOnIce|\.TimeOnIce"
Length of output: 1217
Script:
#!/bin/bash
# Search for test assertions or property usage in test files
rg -t cs "Assert.*\.(?:EvTimeOnIce|PpTimeOnIce|ShTimeOnIce|OtTimeOnIce|TimeOnIce)[^P]" -A 2
# Search for implementations that might be affected
ast-grep --pattern 'var $_ = $$.TimeOnIce'
ast-grep --pattern '$$.TimeOnIce = $_'
Length of output: 179
Script:
#!/bin/bash
# Search for any usage of these properties in the codebase
rg -t cs "(?<!\.Get)TimeOnIce\W" -A 2
# Also check if there are any consumers of this model
rg -t cs "PlayerTimeOnIceStatisticsFilterResult" -A 2
Length of output: 2844
Script:
#!/bin/bash
# Search for any usage of these properties in the codebase with PCRE2
rg -t cs --pcre2 "(?<!\.Get)TimeOnIce\W" -A 2
# Also check for any serialization/deserialization usage
rg -t cs "JsonConvert.*PlayerTimeOnIceStatisticsFilterResult" -A 2
Length of output: 9147
Nhl.Api.Domain/Models/Statistics/PlayerRealtimeStatisticsFilterResult.cs (1)
93-93
: LGTM! Nullable property changes align with the codebase pattern
The changes to make HitsPer60
and TakeawaysPer60
nullable are consistent with the overall pattern of allowing statistics properties to represent absent data.
Also applies to: 189-189
Nhl.Api.Domain/Models/Statistics/PlayerStatisticsFilterResult.cs (1)
62-62
: LGTM! Making these properties nullable aligns with the domain model.
The changes to make these statistics properties nullable is a good improvement as:
- It matches the pattern of other similar properties in the class that are already nullable
- It better represents the domain where not all statistics may be available
- The XML documentation already indicates null values are possible for some properties
Also applies to: 69-69, 76-76, 90-90, 97-97, 118-118, 125-125
No description provided.