File Coverage

lib/Code/Statistics/Metric/ccomp.pm
Criterion Covered Total %
statement 15 15 100.0
branch n/a
condition n/a
subroutine 5 5 100.0
pod 1 1 100.0
total 21 21 100.0


line stmt bran cond sub pod time code
1 1     1   744 use strict;
  1         2  
  1         30  
2 1     1   5 use warnings;
  1         2  
  1         68  
3              
4             package Code::Statistics::Metric::ccomp;
5             $Code::Statistics::Metric::ccomp::VERSION = '1.190680';
6             # ABSTRACT: measures the cyclomatic complexity of a target
7              
8 1     1   6 use Moose;
  1         2  
  1         6  
9             extends 'Code::Statistics::Metric';
10              
11 1     1   5984 use Perl::Critic::Utils::McCabe 'calculate_mccabe_of_sub';
  1         110623  
  1         19  
12              
13              
14             sub measure {
15 76     76 1 117 my ( $class, $target ) = @_;
16              
17 76         203 my $complexity = calculate_mccabe_of_sub( $target );
18              
19 76         160011 return $complexity;
20             }
21              
22             1;
23              
24             __END__
25              
26             =pod
27              
28             =encoding UTF-8
29              
30             =head1 NAME
31              
32             Code::Statistics::Metric::ccomp - measures the cyclomatic complexity of a target
33              
34             =head1 VERSION
35              
36             version 1.190680
37              
38             =head2 measure
39             Returns the cyclomatic complexity of the given target.
40              
41             =head1 AUTHOR
42              
43             Christian Walde <mithaldu@yahoo.de>
44              
45             =head1 COPYRIGHT AND LICENSE
46              
47              
48             Christian Walde has dedicated the work to the Commons by waiving all of his
49             or her rights to the work worldwide under copyright law and all related or
50             neighboring legal rights he or she had in the work, to the extent allowable by
51             law.
52              
53             Works under CC0 do not require attribution. When citing the work, you should
54             not imply endorsement by the author.
55              
56             =cut