line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
1045
|
use strict; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
45
|
|
2
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
68
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
package Code::Statistics::Metric::ccomp; |
5
|
|
|
|
|
|
|
{ |
6
|
|
|
|
|
|
|
$Code::Statistics::Metric::ccomp::VERSION = '1.112980'; |
7
|
|
|
|
|
|
|
} |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
# ABSTRACT: measures the cyclomatic complexity of a target |
10
|
|
|
|
|
|
|
|
11
|
1
|
|
|
1
|
|
6
|
use Moose; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
10
|
|
12
|
|
|
|
|
|
|
extends 'Code::Statistics::Metric'; |
13
|
|
|
|
|
|
|
|
14
|
1
|
|
|
1
|
|
16300
|
use Perl::Critic::Utils::McCabe 'calculate_mccabe_of_sub'; |
|
1
|
|
|
|
|
168380
|
|
|
1
|
|
|
|
|
27
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub measure { |
18
|
76
|
|
|
76
|
1
|
141
|
my ( $class, $target ) = @_; |
19
|
|
|
|
|
|
|
|
20
|
76
|
|
|
|
|
243
|
my $complexity = calculate_mccabe_of_sub( $target ); |
21
|
|
|
|
|
|
|
|
22
|
76
|
|
|
|
|
246410
|
return $complexity; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
1; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
__END__ |
28
|
|
|
|
|
|
|
=pod |
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.112980 |
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
|
|
|
|
|
|
|
This software is Copyright (c) 2010 by Christian Walde. |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
This is free software, licensed under: |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE, Version 2, December 2004 |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=cut |
54
|
|
|
|
|
|
|
|