Class: MetricFu::ReekGrapher
- Defined in:
- lib/graphs/reek_grapher.rb
Direct Known Subclasses
Constant Summary
Constants inherited from Grapher
Grapher::BLUFF_DEFAULT_OPTIONS, Grapher::BLUFF_GRAPH_SIZE
Constants included from GchartGrapher
GchartGrapher::COLORS, GchartGrapher::GCHART_GRAPH_SIZE, GchartGrapher::NUMBER_OF_TICKS
Instance Attribute Summary collapse
-
#reek_count ⇒ Object
Returns the value of attribute reek_count.
Attributes inherited from Grapher
Instance Method Summary collapse
- #get_metrics(metrics, date) ⇒ Object
-
#initialize ⇒ ReekGrapher
constructor
A new instance of ReekGrapher.
Methods inherited from Grapher
Methods included from GchartGrapher
Constructor Details
#initialize ⇒ ReekGrapher
Returns a new instance of ReekGrapher.
7 8 9 10 |
# File 'lib/graphs/reek_grapher.rb', line 7 def initialize super @reek_count = {} end |
Instance Attribute Details
#reek_count ⇒ Object
Returns the value of attribute reek_count.
5 6 7 |
# File 'lib/graphs/reek_grapher.rb', line 5 def reek_count @reek_count end |
Instance Method Details
#get_metrics(metrics, date) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/graphs/reek_grapher.rb', line 12 def get_metrics(metrics, date) counter = @labels.size super metrics[:reek][:matches].each do |reek_chunk| reek_chunk[:code_smells].each do |code_smell| # speaking of code smell... @reek_count[code_smell[:type]] = [] if @reek_count[code_smell[:type]].nil? if @reek_count[code_smell[:type]][counter].nil? @reek_count[code_smell[:type]][counter] = 1 else @reek_count[code_smell[:type]][counter] += 1 end end end end |