Class: MetricAdapter::Metric
- Inherits:
-
Object
- Object
- MetricAdapter::Metric
- Defined in:
- lib/metric.rb
Overview
A normalized representation of a code metric.
Instance Attribute Summary collapse
-
#location ⇒ Object
Location where this metric applies (see the Location class).
-
#message ⇒ Object
Message indicating the issue being reported.
-
#score ⇒ Object
Optional score for for the metric indicating severity A score is not normalized across analyzers.
-
#signature ⇒ Object
Associated class and method signature.
Instance Method Summary collapse
-
#initialize(location, signature, message) ⇒ Metric
constructor
Create an instance of Metric.
-
#line ⇒ Object
Returns the line number this metric applies to.
-
#path ⇒ Object
Returns the path that this metric applies to, for example: ./lib/metric.rb.
Constructor Details
#initialize(location, signature, message) ⇒ Metric
Create an instance of Metric. ‘location` is expected to be a `Location` instance
21 22 23 24 25 26 |
# File 'lib/metric.rb', line 21 def initialize(location, signature, ) @location = location @signature = signature @message = @score = 0 end |
Instance Attribute Details
#location ⇒ Object
Location where this metric applies (see the Location class)
7 8 9 |
# File 'lib/metric.rb', line 7 def location @location end |
#message ⇒ Object
Message indicating the issue being reported
13 14 15 |
# File 'lib/metric.rb', line 13 def @message end |
#score ⇒ Object
Optional score for for the metric indicating severity A score is not normalized across analyzers
17 18 19 |
# File 'lib/metric.rb', line 17 def score @score end |
#signature ⇒ Object
Associated class and method signature
10 11 12 |
# File 'lib/metric.rb', line 10 def signature @signature end |
Instance Method Details
#line ⇒ Object
Returns the line number this metric applies to.
35 36 37 |
# File 'lib/metric.rb', line 35 def line location.line end |
#path ⇒ Object
Returns the path that this metric applies to, for example:
./lib/metric.rb
30 31 32 |
# File 'lib/metric.rb', line 30 def path location.path end |