Module: GraphHelper

Defined in:
app/helpers/graph_helper.rb

Instance Method Summary collapse

Instance Method Details

#parents_zip_spaces(parents, parent_spaces) ⇒ Object



16
17
18
19
# File 'app/helpers/graph_helper.rb', line 16

def parents_zip_spaces(parents, parent_spaces)
  ids = parents.map(&:id)
  ids.zip(parent_spaces)
end

#refs(repo, commit) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
# File 'app/helpers/graph_helper.rb', line 4

def refs(repo, commit)
  refs = [commit.ref_names(repo).join(' ')]

  # append note count
  unless Feature.enabled?(:disable_network_graph_notes_count, @project, type: :experiment)
    notes_count = @graph.notes[commit.id]
    refs << "[#{pluralize(notes_count, 'note')}]" if notes_count > 0
  end

  refs.join
end

#should_render_dora_chartsObject



28
29
30
# File 'app/helpers/graph_helper.rb', line 28

def should_render_dora_charts
  false
end

#should_render_quality_summaryObject



32
33
34
# File 'app/helpers/graph_helper.rb', line 32

def should_render_quality_summary
  false
end

#success_ratio(counts) ⇒ Object



21
22
23
24
25
26
# File 'app/helpers/graph_helper.rb', line 21

def success_ratio(counts)
  return 100 if counts[:failed] == 0

  ratio = (counts[:success].to_f / (counts[:success] + counts[:failed])) * 100
  ratio.to_i
end