File Coverage

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   945 use strict;
  3         8  
  3         89  
3 3     3   15 use warnings;
  3         7  
  3         293  
4              
5       18 0   sub init { }
6              
7             sub measure {
8 18     18 0 55 my ( $class, $context, $file ) = @_;
9 18         76 my $sub_elements = $file->find('PPI::Statement::Sub');
10 18 100       46985 return 0 unless $sub_elements;
11 8         21 my $number_of_subs = scalar @{$sub_elements};
  8         27  
12 8         33 return $number_of_subs;
13             }
14              
15             1;