| 1 | package Devel::Examine::Subs::Sub; | ||||||||||||
| 2 | 60 | ▶ | use 5.008; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 3 | 60 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 4 | 60 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 5 | |||||||||||||
| 6 | 60 | our $VERSION = '1.74'; | |||||||||||
| 7 | |||||||||||||
| 8 | 60 | ▶ | use Data::Dumper; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 9 | |||||||||||||
| 10 | 60 | ▶ | BEGIN { | ||||||||||
|
Subroutine
BEGIN: called CC=2 SCAR=7.4
| |||||||||||||
| 11 | |||||||||||||
| 12 | # we need to do some trickery for Devel::Trace::Subs due to circular | ||||||||||||
| 13 | # referencing, which broke CPAN installs. DTS does nothing if not presented, | ||||||||||||
| 14 | # per this code | ||||||||||||
| 15 | |||||||||||||
| 16 | 60 | eval { | |||||||||||
| 17 | 60 | require Devel::Trace::Subs; | |||||||||||
| 18 | 0 | import Devel::Trace::Subs qw(trace); | |||||||||||
| 19 | }; | ||||||||||||
| 20 | |||||||||||||
| 21 | 60 | ▶ | if (! defined &trace){ | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 22 | 60 | ▶ | *trace = sub {}; | ||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=0.0
| |||||||||||||
| 23 | } | ||||||||||||
| 24 | } | ||||||||||||
| 25 | |||||||||||||
| 26 | 282 | ▶ | sub new { | ||||||||||
|
Subroutine
new: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||||
| 27 | 282 | ▶ | trace() if $ENV{TRACE}; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 28 | |||||||||||||
| 29 | 281 | my ($class, $data, $name) = @_; | |||||||||||
| 30 | |||||||||||||
| 31 | 281 | my $self = bless {}, $class; | |||||||||||
| 32 | |||||||||||||
| 33 | 281 | $self->{data} = $data; | |||||||||||
| 34 | 281 | ▶ | $self->{data}{name} = $name || ''; | ||||||||||
|
Condition100%2/2
$name || ''
MC/DC100%1/1
$name || ''
$name
Truth table100%2/2
A
A= $name
| |||||||||||||
| 35 | |||||||||||||
| 36 | 281 | return $self; | |||||||||||
| 37 | } | ||||||||||||
| 38 | 107 | ▶ | sub name { | ||||||||||
|
Subroutine
name: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 39 | 107 | ▶ | trace() if $ENV{TRACE}; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 40 | 106 | return $_[0]->{data}{name}; | |||||||||||
| 41 | } | ||||||||||||
| 42 | 122 | ▶ | sub start { | ||||||||||
|
Subroutine
start: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 43 | 122 | ▶ | trace() if $ENV{TRACE}; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 44 | 121 | return $_[0]->{data}{start}; | |||||||||||
| 45 | } | ||||||||||||
| 46 | 72 | ▶ | sub end { | ||||||||||
|
Subroutine
end: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 47 | 72 | ▶ | trace() if $ENV{TRACE}; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 48 | 71 | return $_[0]->{data}{end}; | |||||||||||
| 49 | } | ||||||||||||
| 50 | 17 | ▶ | sub line_count { | ||||||||||
|
Subroutine
line_count: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 51 | 17 | ▶ | trace() if $ENV{TRACE}; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 52 | 16 | return $_[0]->{data}{num_lines}; | |||||||||||
| 53 | } | ||||||||||||
| 54 | 14 | ▶ | sub lines { | ||||||||||
|
Subroutine
lines: called CC=5 SCAR=16.1
Pod
undocumented
| |||||||||||||
| 55 | 14 | ▶ | trace() if $ENV{TRACE}; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 56 | |||||||||||||
| 57 | 13 | my ($self) = @_; | |||||||||||
| 58 | |||||||||||||
| 59 | 13 | my @line_linenum; | |||||||||||
| 60 | |||||||||||||
| 61 | 13 | ▶ | if ($self->{data}{lines_with}){ | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 62 | 1 | my $lines_with = $self->{data}{lines_with}; | |||||||||||
| 63 | |||||||||||||
| 64 | 1 | for (@$lines_with){ | |||||||||||
| 65 | 1 | for my $num (keys %$_){ | |||||||||||
| 66 | 1 | push @line_linenum, "$num: $_->{$num}"; | |||||||||||
| 67 | } | ||||||||||||
| 68 | } | ||||||||||||
| 69 | } | ||||||||||||
| 70 | |||||||||||||
| 71 | 13 | return \@line_linenum; | |||||||||||
| 72 | } | ||||||||||||
| 73 | 13 | ▶ | sub code { | ||||||||||
|
Subroutine
code: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 74 | 13 | ▶ | trace() if $ENV{TRACE}; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 75 | 12 | return $_[0]->{data}{code}; | |||||||||||
| 76 | } | ||||||||||||
| 77 | |||||||||||||
| 78 | 60 | 1; | |||||||||||