Class: CC::Analyzer::Formatters::HTMLFormatter::Issue
- Inherits:
-
Object
- Object
- CC::Analyzer::Formatters::HTMLFormatter::Issue
- Defined in:
- lib/cc/analyzer/formatters/html_formatter.rb
Constant Summary collapse
- MARKDOWN_CONFIG =
{ autolink: true, fenced_code_blocks: true, no_intra_emphasis: true, tables: true }.freeze
Instance Method Summary collapse
- #body ⇒ Object
- #categories ⇒ Object
- #description ⇒ Object
- #engine_name ⇒ Object
-
#initialize(data, filesystem) ⇒ Issue
constructor
A new instance of Issue.
- #location ⇒ Object
- #other_locations ⇒ Object
- #source ⇒ Object
Constructor Details
#initialize(data, filesystem) ⇒ Issue
Returns a new instance of Issue.
253 254 255 256 |
# File 'lib/cc/analyzer/formatters/html_formatter.rb', line 253 def initialize(data, filesystem) @data = data @filesystem = filesystem end |
Instance Method Details
#body ⇒ Object
262 263 264 265 266 267 268 269 270 |
# File 'lib/cc/analyzer/formatters/html_formatter.rb', line 262 def body @body ||= begin text = data.fetch("content", {}).fetch("body", "").strip unless text.empty? markdown(text) end end end |
#categories ⇒ Object
296 297 298 |
# File 'lib/cc/analyzer/formatters/html_formatter.rb', line 296 def categories data.fetch("categories", []) end |
#description ⇒ Object
258 259 260 |
# File 'lib/cc/analyzer/formatters/html_formatter.rb', line 258 def description data["description"] end |
#engine_name ⇒ Object
300 301 302 |
# File 'lib/cc/analyzer/formatters/html_formatter.rb', line 300 def engine_name data["engine_name"] end |
#location ⇒ Object
279 280 281 282 283 284 285 |
# File 'lib/cc/analyzer/formatters/html_formatter.rb', line 279 def location @location ||= Location.new( source.buffer, data["location"], ) end |
#other_locations ⇒ Object
287 288 289 290 291 292 293 294 |
# File 'lib/cc/analyzer/formatters/html_formatter.rb', line 287 def other_locations @other_locations ||= begin data.fetch("other_locations", []).map do |loc| [SourceFile.new(loc["path"], filesystem), loc] end.to_h end end |
#source ⇒ Object
272 273 274 275 276 277 |
# File 'lib/cc/analyzer/formatters/html_formatter.rb', line 272 def source @source ||= SourceFile.new( data.fetch("location", {}).fetch("path", ""), filesystem, ) end |