Class: StateHTMLComplexityFormater

Inherits:
ParseStateFormater show all
Includes:
HTMLStyleSheet
Defined in:
lib/saikuro.rb

Instance Attribute Summary

Attributes inherited from BaseFormater

#current, #errors, #warnings

Instance Method Summary collapse

Methods included from HTMLStyleSheet

style_sheet, #style_sheet

Methods inherited from BaseFormater

#initialize, #reset_data, #warn_error?

Constructor Details

This class inherits a constructor from BaseFormater

Instance Method Details

#def_compute_state(name, complexity, lines) ⇒ Object



875
876
877
878
879
# File 'lib/saikuro.rb', line 875

def def_compute_state(name, complexity, lines)
  return if @filter.ignore?(complexity)
  klass = warn_error?(complexity, name)
  @out.puts "<tr><td>#{name}</td><td#{klass}>#{complexity}</td><td>#{lines}</td></tr>"
end

#endObject



855
856
857
858
# File 'lib/saikuro.rb', line 855

def end
  @out.puts "</body>"
  @out.puts "</html>"
end

#end_class_compute_state(name) ⇒ Object



870
871
872
873
# File 'lib/saikuro.rb', line 870

def end_class_compute_state(name)
  @out.puts "</table>"
  @out.puts "</div>"
end

#start(new_out = nil) ⇒ Object



847
848
849
850
851
852
853
# File 'lib/saikuro.rb', line 847

def start(new_out=nil)
  reset_data
  @out = new_out if new_out
  @out.puts "<html><head><title>Cyclometric Complexity</title></head>"
  @out.puts style_sheet
  @out.puts "<body>"
end

#start_class_compute_state(type_name, name, complexity, lines) ⇒ Object



860
861
862
863
864
865
866
867
868
# File 'lib/saikuro.rb', line 860

def start_class_compute_state(type_name,name,complexity,lines)
  @current = name
  @out.puts "<div class=\"class_complexity\">"
  @out.puts "<h2 class=\"class_name\">#{type_name} : #{name}</h2>"
  @out.puts "<div class=\"class_total_complexity\">Total Complexity: #{complexity}</div>"
  @out.puts "<div class=\"class_total_lines\">Total Lines: #{lines}</div>"
  @out.puts "<table width=\"100%\" border=\"1\">"
  @out.puts "<tr><th>Method</th><th>Complexity</th><th># Lines</th></tr>"
end