class MetricAdapter::Metric

A normalized representation of a code metric.

Attributes

location[RW]

Location where this metric applies (see the Location class)

message[RW]

Message indicating the issue being reported

score[RW]

Optional score for for the metric indicating severity A score is not normalized across analyzers

signature[RW]

Associated class and method signature

Public Class Methods

new(location, signature, message) click to toggle source

Create an instance of Metric. `location` is expected to be a `Location` instance

# File lib/metric.rb, line 21
def initialize(location, signature,  message)
  @location  = location
  @signature = signature
  @message   = message
  @score     = 0
end

Public Instance Methods

line() click to toggle source

Returns the line number this metric applies to.

# File lib/metric.rb, line 35
def line
  location.line
end
path() click to toggle source

Returns the path that this metric applies to, for example:

./lib/metric.rb
# File lib/metric.rb, line 30
def path
  location.path
end