| File: | lib/Code/Statistics/Metric/line.pm |
| Coverage: | 100.0% |
| line | stmt | bran | cond | sub | pod | time | code |
|---|---|---|---|---|---|---|---|
| 1 | 1 1 1 | 0 0 0 | use strict; | ||||
| 2 | 1 1 1 | 0 0 0 | use warnings; | ||||
| 3 | |||||||
| 4 | package Code::Statistics::Metric::line; | ||||||
| 5 | |||||||
| 6 | # ABSTRACT: measures the line number of a target | ||||||
| 7 | |||||||
| 8 | 1 1 1 | 0 0 0 | use Moose; | ||||
| 9 | extends 'Code::Statistics::Metric'; | ||||||
| 10 | |||||||
| 11 - 13 | =head2 measure
Returns the line number of the given target.
=cut | ||||||
| 14 | |||||||
| 15 | sub measure { | ||||||
| 16 | my ( $class, $target ) = @_; | ||||||
| 17 | my $line = $target->location->[0]; | ||||||
| 18 | return $line; | ||||||
| 19 | } | ||||||
| 20 | |||||||
| 21 - 26 | =head2 is_insignificant
Returns true if the metric is considered statistically insignificant.
Returns false for this class, since it only identifies the location of a
target.
=cut | ||||||
| 27 | |||||||
| 28 | sub is_insignificant { | ||||||
| 29 | my ( $class ) = @_; | ||||||
| 30 | return 1; | ||||||
| 31 | } | ||||||
| 32 | |||||||
| 33 | 1; | ||||||