Class: CC::Formatters::LinkedFormatter

Inherits:
Service::Formatter show all
Defined in:
lib/cc/formatters/linked_formatter.rb

Instance Attribute Summary

Attributes inherited from Service::Formatter

#options

Instance Method Summary collapse

Methods inherited from Service::Formatter

#initialize

Constructor Details

This class inherits a constructor from CC::Service::Formatter

Instance Method Details

#format_coverageObject



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/cc/formatters/linked_formatter.rb', line 9

def format_coverage
  message = message_prefix
  message << format_link(details_url, "Test coverage").to_s
  message << " has #{changed} to #{covered_percent}% (#{delta})"

  if compare_url
    message << " (#{format_link(compare_url, "Compare")})"
  end

  message
end

#format_qualityObject



21
22
23
24
25
26
27
28
29
30
31
# File 'lib/cc/formatters/linked_formatter.rb', line 21

def format_quality
  message = message_prefix
  message << format_link(details_url, constant_name).to_s
  message << " has #{changed} from #{previous_rating} to #{rating}"

  if compare_url
    message << " (#{format_link(compare_url, "Compare")})"
  end

  message
end

#format_testObject



4
5
6
7
# File 'lib/cc/formatters/linked_formatter.rb', line 4

def format_test
  message = message_prefix
  message << "This is a test of the #{service_title} service hook"
end

#format_vulnerabilityObject



33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/cc/formatters/linked_formatter.rb', line 33

def format_vulnerability
  message = message_prefix

  if multiple?
    message << "#{vulnerabilities.size} new"
    message << " #{format_link(details_url, warning_type)}"
    message << " issues found"
  else
    message << "New #{format_link(details_url, warning_type)}"
    message << " issue found"
    message << location_info
  end

  message
end