File Coverage

lib/Code/Statistics/Metric/line.pm
Criterion Covered Total %
statement 14 14 100.0
branch n/a
condition n/a
subroutine 5 5 100.0
pod 2 2 100.0
total 21 21 100.0


line stmt bran cond sub pod time code
1 1     1   1250 use strict;
  1         2  
  1         49  
2 1     1   7 use warnings;
  1         3  
  1         76  
3              
4             package Code::Statistics::Metric::line;
5             {
6             $Code::Statistics::Metric::line::VERSION = '1.112980';
7             }
8              
9             # ABSTRACT: measures the line number of a target
10              
11 1     1   8 use Moose;
  1         2  
  1         10  
12             extends 'Code::Statistics::Metric';
13              
14              
15             sub measure {
16 76     76 1 139 my ( $class, $target ) = @_;
17 76         240 my $line = $target->location->[0];
18 76         1572 return $line;
19             }
20              
21              
22             sub is_insignificant {
23 3     3 1 4 my ( $class ) = @_;
24 3         15 return 1;
25             }
26              
27             1;
28              
29             __END__
30             =pod
31              
32             =head1 NAME
33              
34             Code::Statistics::Metric::line - measures the line number of a target
35              
36             =head1 VERSION
37              
38             version 1.112980
39              
40             =head2 measure
41             Returns the line number of the given target.
42              
43             =head2 is_insignificant
44             Returns true if the metric is considered statistically insignificant.
45              
46             Returns false for this class, since it only identifies the location of a
47             target.
48              
49             =head1 AUTHOR
50              
51             Christian Walde <mithaldu@yahoo.de>
52              
53             =head1 COPYRIGHT AND LICENSE
54              
55             This software is Copyright (c) 2010 by Christian Walde.
56              
57             This is free software, licensed under:
58              
59             DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE, Version 2, December 2004
60              
61             =cut
62