mozilla / addons

☂ Umbrella repository for Mozilla Addons ✨
Other
126 stars 41 forks source link

[Task]: Identify dead code in addons-server #15045

Open KevinMind opened 2 weeks ago

KevinMind commented 2 weeks ago

Description

We can add a CI check to ensure we remove deadcode from our codebase.

There are tools like https://github.com/jendrikseipp/vulture that can help with this

Acceptance Criteria

  ### Milestones/checkpoints
  - [ ] A check that searches the codebase for deadcode and flags high likely dead code paths.
  - [ ] Integration to CI to ensure we do not merge dead code

Checks

┆Issue is synchronized with this Jira Task

diox commented 2 weeks ago

I'm not sure it's worth the effort depending on how annoying it is to set up, because I'm fairly confident we don't have that much dead code, we've already done a lot of cleanups over the years.

The one thing we may have are obsolete management commands for one-off tasks we then never deleted, but even those we tend to eventually get rid off (some already have issues opened about them)

eviljeff commented 1 week ago

When I've looked into these kind of tools in the past they've been pretty bad at identifying things like functions being called from templates, and django magic class properties.

But I'd be surprised if we have a significant amount of unused code - perhaps some management commands like Mat mentions - but they wouldn't be strictly dead code anyway.