-
-
Notifications
You must be signed in to change notification settings - Fork 1k
refactor(internet): remove weigths in userAgent #1761
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
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## next #1761 +/- ##
=======================================
Coverage 99.65% 99.65%
=======================================
Files 2340 2340
Lines 242653 242619 -34
Branches 1111 1113 +2
=======================================
- Hits 241804 241783 -21
+ Misses 828 815 -13
Partials 21 21
|
The whole random_ua functions seem like overkill, and is hard to maintain (e.g. there's no Edge). Could it just be replaced by a random pick from a static array of popular UAs like: |
Most definitely. I had some other refactoring changes in mind to make this more maintainable in the future. |
Refactor
faker.internet.userAgent
, so that every return value is equally possible. That means that the function will no longer return values based on a "real-world" distribution.I did this for multiple reasons:
Faker
is not a real-world database! We provide data which is reasonable. It is not our goal to mirrow the real world in all tiny details.For example: In Germany, the last name "Müller" is super popular, yet it has the same return probability as any other last name in the German locale dataset.
Could be seen as a fix for #216.