- anchors = local_assigns.fetch(:anchors, [])

- if anchors.size > 0
  %ul.nav
    - anchors.each do |anchor|
      %li
        - if anchor.link
          = link_to anchor.link, class: anchor.enabled ? 'stat-link' : "btn btn-#{anchor.class_modifier || 'missing'}" do
            = anchor.label
        - else
          %span.stat-text
            = anchor.label

- anchors = local_assigns.fetch(:anchors, [])

- return unless anchors.any?
%ul.nav
  - anchors.each do |anchor|
    %li
      = link_to_if anchor.link, anchor.label, anchor.link, class: anchor.enabled ? 'stat-link' : "btn btn-#{anchor.class_modifier || 'missing'}" do
        %span.stat-text= anchor.label

Remove indent and reduce bloat with link_to_if
Remove indent and reduce bloat with link_to_if

See

 - https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/16900#note_60163789
 - https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/16900#note_60164324
