File Coverage: lib/Code/Statistics/Metric/lines.pm

# File Coverage

File: | lib/Code/Statistics/Metric/lines.pm
Coverage: | 100.0%

line | stmt | bran | cond | sub | pod | time | code
--- | --- | --- | --- | --- | --- | --- | ---
1 | 1 1 1 |  |  | 1 |  | 0 0 0 | use strict;
2 | 1 1 1 |  |  | 1 |  | 0 0 0 | use warnings;
3 |
4 |  |  |  |  |  |  | package Code::Statistics::Metric::lines;
5 |
6 |  |  |  |  |  |  | # ABSTRACT: measures the line count of a target
7 |
8 | 1 1 1 |  |  | 1 |  | 0 0 0 | use Moose;
9 |  |  |  |  |  |  | extends 'Code::Statistics::Metric';
10 |
11 - 13 |  |
    =head2 measure
        Returns the line count of the given target.
    =cut
14 |
15 |  |  |  |  |  |  | sub measure {
16 |  |  |  |  |  |  | my ( $class, $target ) = @_;
17 |  |  |  |  |  |  | my @lines = split /\n/, $target->content;
18 |  |  |  |  |  |  | return scalar @lines;
19 |  |  |  |  |  |  | }
20 |
21 |  |  |  |  |  |  | 1;