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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unnecessary, dead and duplicate code around reports_menu #3187

Merged
merged 1 commit into from Jan 8, 2018

Conversation

skateman
Copy link
Member

@skateman skateman commented Jan 8, 2018

I started to untangle the code around the reports_menu and after a few 馃挜 馃挜 馃挜 found some stuff to clean up. For example setting @sb[:rpt_menu] and @sb[:grp_title] twice:

def reports_menu_in_sb		
  @sb[:rpt_menu]  = populate_reports_menu("reports", "menu")		
  @sb[:grp_title] = reports_group_title		
end

# ...

def populate_reports_menu(tree_type = 'reports', mode = 'menu')
  # ...
  @sb[:rpt_menu] = get_reports_menu(group, tree_type, mode)
end

# ...

def get_reports_menu
  # ...
  @sb[:grp_title] = reports_group_title
  # ...
end

After the cleanup the reports_menu_in_sb became an alias for populate_reports_menu and in its spec was misleading. So I decided to drop the method completely and rename the spec to #populate_reports_menu as it is actually testing that method.

@miq-bot add_label refactoring, cloud intel/reporting, gaprindashvili/no

@miq-bot
Copy link
Member

miq-bot commented Jan 8, 2018

Checked commit skateman@97f1814 with ruby 2.3.3, rubocop 0.47.1, haml-lint 0.20.0, and yamllint 1.10.0
3 files checked, 0 offenses detected
Everything looks fine. 馃崻

@mzazrivec mzazrivec self-assigned this Jan 8, 2018
@mzazrivec mzazrivec added this to the Sprint 77 Ending Jan 15, 2018 milestone Jan 8, 2018
@mzazrivec mzazrivec merged commit ffbc07f into ManageIQ:master Jan 8, 2018
@skateman skateman deleted the reports-menu-deduplicate branch January 8, 2018 14:00
simaishi pushed a commit that referenced this pull request Mar 8, 2018
Remove unnecessary, dead and duplicate code around reports_menu
(cherry picked from commit ffbc07f)
@simaishi
Copy link
Contributor

simaishi commented Mar 8, 2018

Gaprindashvili backport details:

$ git log -1
commit 021bc3a72c549dff2189dd0847fd0fe1e264d78a
Author: Milan Z谩zrivec <mzazrivec@redhat.com>
Date:   Mon Jan 8 14:56:12 2018 +0100

    Merge pull request #3187 from skateman/reports-menu-deduplicate
    
    Remove unnecessary, dead and duplicate code around reports_menu
    (cherry picked from commit ffbc07fe5a001f68a42aa439ff643a89c8283ee0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants