blib/lib/Perl/Metrics/Lite/Analysis/File/Plugin/NumberOfMethods.pm | |||
---|---|---|---|
Criterion | Covered | Total | % |
statement | 12 | 12 | 100.0 |
branch | 2 | 2 | 100.0 |
condition | n/a | ||
subroutine | 4 | 4 | 100.0 |
pod | 0 | 2 | 0.0 |
total | 18 | 20 | 90.0 |
line | stmt | bran | cond | sub | pod | time | code |
---|---|---|---|---|---|---|---|
1 | package Perl::Metrics::Lite::Analysis::File::Plugin::NumberOfMethods; | ||||||
2 | 3 | 3 | 2250 | use strict; | |||
3 | 12 | ||||||
3 | 87 | ||||||
3 | 3 | 3 | 16 | use warnings; | |||
3 | 9 | ||||||
3 | 311 | ||||||
4 | |||||||
5 | 18 | 0 | sub init { } | ||||
6 | |||||||
7 | sub measure { | ||||||
8 | 18 | 18 | 0 | 56 | my ( $class, $context, $file ) = @_; | ||
9 | 18 | 67 | my $sub_elements = $file->find('PPI::Statement::Sub'); | ||||
10 | 18 | 100 | 47581 | return 0 unless $sub_elements; | |||
11 | 8 | 19 | my $number_of_subs = scalar @{$sub_elements}; | ||||
8 | 24 | ||||||
12 | 8 | 28 | return $number_of_subs; | ||||
13 | } | ||||||
14 | |||||||
15 | 1; |