? How big is the bus factor for Forem’s most complicated files?

Ever since watching Adam Tornhill’s excellent talk on prioritizing technical debt as if time and money matters, I’ve wanted a simple way to analyze my own repos. I wanted to replicate Adam’s process of identifying code hotspots based on each file’s cod…


This content originally appeared on DEV Community and was authored by Steve Ziegler

Ever since watching Adam Tornhill's excellent talk on prioritizing technical debt as if time and money matters, I've wanted a simple way to analyze my own repos. I wanted to replicate Adam's process of identifying code hotspots based on each file's code complexity, change frequency, and recency of the last change. I also wanted to see if I could recreate his "bus factor" analysis to see which files would be most adversely affected if a primary developer was hit by a bus, won the lottery, or just plain quit.

I was able to create a simplified Python version that generated the hotspot data along with other basic git log metrics. I expected some high bus factor files knowing how many initial file commits Ben made to Forem. Surely there were plenty of complicated files that only he touched!

Top forem committers over time showing the old timers: Ben, Mac, Molly, Michael, and rhymes

The hotspot list shows some intuitive hotspots for a Rails app like schema.rb and routes.rb which are used to manage the database and url routing. It also shows how user.rb and article.rb are hotspots for Forem which make sense given its focus on content publishing.

? Hotspots 
Commits  Comp.   Age    Score  File
  388    63589     1    100.0  db/schema.rb
  427    29318     1     50.7  config/routes.rb
  157    65260     2     41.5  app/javascript/chat/chat.jsx
  359    24357     1     35.4  app/models/user.rb
   98    72604    20     28.8  app/views/admin/configs/show.html.erb
  290    24093     6     28.3  app/models/article.rb
  169    34455     3     23.6  spec/models/user_spec.rb
  154    37107     7     23.2  spec/models/article_spec.rb
   69    48449    59     13.5  spec/requests/api/v0/articles_spec.rb
  177    17235     2     12.4  app/controllers/stories_controller.rb

So how susceptible are these hotspots to losing a team member? To analyze the bus factor, you can see how many different authors touched the file in the last 365 days.

Histogram showing that most hotspots have had lots of authors touch it

Luckily, most hotspots have had at least 10 unique authors touch the file. This might be another big benefit of taking Forem open: many people have touched the code and that collective body of knowledge now has 20+ unique authors committing per month.

Forem has 20+ unique authors committing per month

The good news is that the bus factor with Forem is low and the project should be able to weather changes in contributors.

If you want to learn more, you can see all of the analytics on the repo and view the source code on GitHub.

Happy Coding!


This content originally appeared on DEV Community and was authored by Steve Ziegler


Print Share Comment Cite Upload Translate Updates
APA

Steve Ziegler | Sciencx (2021-06-18T19:33:01+00:00) ? How big is the bus factor for Forem’s most complicated files?. Retrieved from https://www.scien.cx/2021/06/18/%f0%9f%9a%8c-how-big-is-the-bus-factor-for-forems-most-complicated-files/

MLA
" » ? How big is the bus factor for Forem’s most complicated files?." Steve Ziegler | Sciencx - Friday June 18, 2021, https://www.scien.cx/2021/06/18/%f0%9f%9a%8c-how-big-is-the-bus-factor-for-forems-most-complicated-files/
HARVARD
Steve Ziegler | Sciencx Friday June 18, 2021 » ? How big is the bus factor for Forem’s most complicated files?., viewed ,<https://www.scien.cx/2021/06/18/%f0%9f%9a%8c-how-big-is-the-bus-factor-for-forems-most-complicated-files/>
VANCOUVER
Steve Ziegler | Sciencx - » ? How big is the bus factor for Forem’s most complicated files?. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/06/18/%f0%9f%9a%8c-how-big-is-the-bus-factor-for-forems-most-complicated-files/
CHICAGO
" » ? How big is the bus factor for Forem’s most complicated files?." Steve Ziegler | Sciencx - Accessed . https://www.scien.cx/2021/06/18/%f0%9f%9a%8c-how-big-is-the-bus-factor-for-forems-most-complicated-files/
IEEE
" » ? How big is the bus factor for Forem’s most complicated files?." Steve Ziegler | Sciencx [Online]. Available: https://www.scien.cx/2021/06/18/%f0%9f%9a%8c-how-big-is-the-bus-factor-for-forems-most-complicated-files/. [Accessed: ]
rf:citation
» ? How big is the bus factor for Forem’s most complicated files? | Steve Ziegler | Sciencx | https://www.scien.cx/2021/06/18/%f0%9f%9a%8c-how-big-is-the-bus-factor-for-forems-most-complicated-files/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.