Here's a great answer to find where a specific rake task is defined .
Using this advice, it turned out that the task is rake statsdefined in the file gems/railties-3.2.11/lib/rails/tasks/statistics.rake; therefore it is located in railties gem, which is part of the repository.
At the very top of the file, the directories in question are included in the variable STATS_DIRECTORIES.
, rake - , my_stats - , .