-
Notifications
You must be signed in to change notification settings - Fork 61
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
Fix gender in passenger format #490
base: master
Are you sure you want to change the base?
Fix gender in passenger format #490
Conversation
Updates from origin
Codecov Report
@@ Coverage Diff @@
## master #490 +/- ##
==========================================
+ Coverage 94.06% 94.09% +0.02%
==========================================
Files 120 120
Lines 2056 2066 +10
==========================================
+ Hits 1934 1944 +10
Misses 122 122
Continue to review full report at Codecov.
|
|
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.
Thanks for your PR!
In case of non-INF Gender could be missing (as still could be parsed from name), but for the INF passengers you propose to always include gender based on First name.
IMO, we should to stick for the similar behaviour in all cases.
Also we try not to mutate function params, so I would like to see the code slightly modified:
- if gender field exists, always take the gender from it
- if gender field is absent, take the gender from the name
- if name does not include strings like MR, RS, MSTR MISS etc, set gender to null
- use separate variable when detecting gender, using rules above instead of modifying function params
Please also make sure, you have included all possible variants of MR/MRS strings and your reg exp is valid.
Current regex has some flaws:
(/MSTR|MISS$/gi).test('MSTRME/NAME')
this one will return true, while it should not. This would return false correctly:
(/(?:MSTR|MISS)$/gi).test('MSTRME/NAME')
i did PR again check please |
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Extract gender from infant last name