Skip to content
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

Prevent impossible hours_per_week to avoid distorted stats #125

Closed
3 of 4 tasks
iandunn opened this issue Dec 9, 2019 · 6 comments
Closed
3 of 4 tasks

Prevent impossible hours_per_week to avoid distorted stats #125

iandunn opened this issue Dec 9, 2019 · 6 comments
Assignees

Comments

@iandunn
Copy link
Member

iandunn commented Dec 9, 2019

There are some users who've entered obviously inaccurate hours_per_week values, like 72, 84, 96, 150, 300, etc

Devs with a sandbox can see examples with: SELECT * FROM bpmain_bp_xprofile_data where field_id = 29 and value > 40

Maybe some of them are including multiple people from their company? From looking at their profiles, it's also likely that they're counting the hours they work for their company, rather than hours they contributed to WP (see #83).

There's also some obviously fake ones like 2000, 100000, etc, and also some junk from spam bots like 555-555-0199@example.com and 200000000000000000000000000000

Most of them aren't associated with pledges, but they'll clutter the list in #69 with fake data, and will distort stats if/when we start tracking volunteered hours (see #124).

I think we should do these things:

  • cast the value to an integer when saving, to prevent direct POST submissions from entering strings like above
  • show an error if a value is above a certain realistic threshold, and don't save the value. What would be a good value? 60 hours per week?
  • Set the existing values above that threshold to 0
  • Notify those users so they can re-enter accurate data; maybe dependent on Regularly email contributors to prompt for updates #27. user ids that need to be notified: 17674961, 17653610, 17671111, 17671049, 16663455, 17573229, 17614682, 17423769, 17607296, 17131322, 17271425, 17276880, 13116230, 17280143, 17072245, 17406892, 17302971, 17175735, 17313771, 17314244, 17315728, 17319534, 15850564, 17358254, 17358376, 17360661, 17368090, 17245081, 17374592, 17377673, 17381029, 17402832, 15765414, 17176008, 17419841, 17423639, 17423940, 17448492, 17452888, 17459742, 17290995, 17463527, 17464167, 17474099, 16705919, 17482922, 17504558, 17502708, 17508094, 17517696, 17523489, 17540046, 17542244, 17542238, 17532010, 17618055, 16565535, 17547846, 6798946, 16619776, 17594852, 17600710, 16696193, 17605382, 17616140, 17630543, 17629519, 17647225, 13791648, 17412167, 14540841, 17655104, 17655888, 17657877, 17660396, 17663322, 17567236, 17569402, 17571235, 16577545, 17579039, 17580277, 17369105, 17631555, 17634691, 17180141, 17684823, 16015760, 17687500, 17688780, 17691401, 17693882, 17698369, 17698868, 17699275, 13961274, 17702143

What do y'all think?

@iandunn iandunn added this to the Stats milestone Dec 9, 2019
@coreymckrill
Copy link
Contributor

An alternative that wouldn't involve customizing the logic in BuddyPress XProfiles might be to just not include numbers on the 5ftf side if they are over the threshold (60 sounds good to me).

@iandunn
Copy link
Member Author

iandunn commented Dec 9, 2019

🤔 I worry that there are multiple places that pull from that data, so each one would have to be updated, and the logic might not be DRY across them, and future ones might get missed.

I think the code to add the warning would be pretty simple, like [dotorg 15598].

@hlashbrooke
Copy link

For reference, Josepha lists her hours as 60 per week, and I think we can largely agree that no one would realistically contribute more time to the project than her. So I think 60 is a good cap to use.

@iandunn
Copy link
Member Author

iandunn commented Dec 11, 2019

Doh, now I almost want to cap it at 40 to encourage healthy work/life balance 😆

Maybe I'll throw in a custom condition which does that only for @josephahaden. Only partially kidding 🐻

@iandunn
Copy link
Member Author

iandunn commented Dec 13, 2019

This is mostly done in dotorg 15648 and b68664c, but I haven't emailed the affected users yet. There's some related discussion in #27 which might affect that.

@coreymckrill
Copy link
Contributor

I should have explicitly stated earlier on this ticket that forcibly changing the values that people have entered into their profiles makes me really uncomfortable, and I'd like to avoid doing that again.

@iandunn iandunn modified the milestones: Stats, v2 Mar 4, 2022
@iandunn iandunn closed this as completed Mar 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants