Skip to content

Split `Page::Project::Menu` into separate submenus

Page::Project::Menu has grown to the point where it's triggering code quality warnings:

Class Menu has 21 methods (exceeds 20 allowed). Consider refactoring.

To be consistent with the last menu refactoring, we should split the Project menu class into a separate class for each submenu. E.g.,

  • Page::Project::Repository::Menu
  • Page::Project::Issues::Menu
  • etc.

Or maybe it would be better to include submenus into the project menu, e.g.:

module QA
  module Page
    module Project
      class Menu
        include Submenu::Repository

That way we wouldn't have to update all the references to the menus - it would still look like one big class to the rest of the code (thanks @wlsf82 for the suggestion).

(~P2 because until we do this every time we add a method to Page::Project::Menu we'll get a code quality warning)

Edited by Mark Lapierre