| 1 | package ExtUtils::Builder::Node; | ||||||||||||||||||||||||||||||||||
| 2 | 11 | $ExtUtils::Builder::Node::VERSION = '0.020'; | |||||||||||||||||||||||||||||||||
| 3 | 11 | ▶ | use strict; | ||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||
| 4 | 11 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||||||||
| 6 | 11 | ▶ | use parent qw/ExtUtils::Builder::Action::Composite/; | ||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||||||||
| 8 | 11 | ▶ | use Carp 'croak'; | ||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||||||
| 10 | 30 | ▶ | sub new { | ||||||||||||||||||||||||||||||||
|
Subroutine
new: called CC=6 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||
| 11 | 30 | my ($class, %args) = @_; | |||||||||||||||||||||||||||||||||
| 12 | 30 | ▶ | croak('Attribute target is not defined') if not $args{target}; | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 13 | 30 | ▶ | $args{actions} = [ map { $_->flatten } @{ $args{actions} // [] } ]; | ||||||||||||||||||||||||||||||||
|
Condition100%2/2
$args{"actions"} // []
MC/DC100%1/1
$args{"actions"} // []
$args{"actions"}
Truth table100%2/2
A
A= $args{"actions"}
| |||||||||||||||||||||||||||||||||||
| 14 | 30 | ▶ | $args{dependencies} //= []; | ||||||||||||||||||||||||||||||||
|
Condition100%2/2
$args{"dependencies"} //= []
MC/DC100%1/1
$args{"dependencies"} //= []
$args{"dependencies"}
Truth table100%2/2
A
A= $args{"dependencies"}
| |||||||||||||||||||||||||||||||||||
| 15 | 30 | ▶ | $args{type} //= delete $args{phony} ? 'phony' : 'file'; | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%2/2
$args{"type"} //= delete $args{"phony"} ? "phony" : "file"
MC/DC100%1/1
$args{"type"} //= delete $args{"phony"} ? "phony" : "file"
$args{"type"}
Truth table100%2/2
A
A= $args{"type"}
| |||||||||||||||||||||||||||||||||||
| 16 | 30 | return $class->SUPER::new(%args); | |||||||||||||||||||||||||||||||||
| 17 | } | ||||||||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||||||||
| 19 | 30 | ▶ | sub flatten { | ||||||||||||||||||||||||||||||||
|
Subroutine
flatten: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||
| 20 | 30 | my $self = shift; | |||||||||||||||||||||||||||||||||
| 21 | 30 | return @{ $self->{actions} }; | |||||||||||||||||||||||||||||||||
| 22 | } | ||||||||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||||||||
| 24 | 57 | ▶ | sub target { | ||||||||||||||||||||||||||||||||
|
Subroutine
target: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||
| 25 | 57 | my $self = shift; | |||||||||||||||||||||||||||||||||
| 26 | 57 | return $self->{target}; | |||||||||||||||||||||||||||||||||
| 27 | } | ||||||||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||||||||
| 29 | 42 | ▶ | sub dependencies { | ||||||||||||||||||||||||||||||||
|
Subroutine
dependencies: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||
| 30 | 42 | my $self = shift; | |||||||||||||||||||||||||||||||||
| 31 | 42 | return @{ $self->{dependencies} }; | |||||||||||||||||||||||||||||||||
| 32 | } | ||||||||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||||||||
| 34 | 32 | ▶ | sub type { | ||||||||||||||||||||||||||||||||
|
Subroutine
type: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||
| 35 | 32 | my $self = shift; | |||||||||||||||||||||||||||||||||
| 36 | 32 | return $self->{type}; | |||||||||||||||||||||||||||||||||
| 37 | } | ||||||||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||||||||
| 39 | 15 | ▶ | sub phony { | ||||||||||||||||||||||||||||||||
|
Subroutine
phony: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||
| 40 | 15 | my $self = shift; | |||||||||||||||||||||||||||||||||
| 41 | 15 | return $self->{type} eq 'phony'; | |||||||||||||||||||||||||||||||||
| 42 | } | ||||||||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||||||||
| 44 | 0 | ▶ | sub mergeable { | ||||||||||||||||||||||||||||||||
|
Subroutine
mergeable: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||||||
| 45 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||
| 46 | 0 | ▶ | return $self->{type} eq 'phony' && !@{ $self->{actions} }; | ||||||||||||||||||||||||||||||||
|
Condition0%0/3
$self->{'type'} eq 'phony' && !@{$self->{'actions'};}
MC/DC0%0/2
$self->{'type'} eq 'phony' && !@{$self->{'actions'};}
$self->{'type'} eq 'phony'
!@{$self->{'actions'};}
Truth table0%0/3
A && not(B)
A= $self->{'type'} eq 'phony'B= !@{$self->{'actions'};}
| |||||||||||||||||||||||||||||||||||
| 47 | } | ||||||||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||||||||
| 49 | 6 | ▶ | sub newer_than { | ||||||||||||||||||||||||||||||||
|
Subroutine
newer_than: called CC=4 SCAR=14.6
Pod
undocumented
| |||||||||||||||||||||||||||||||||||
| 50 | 6 | my ($self, $mtime) = @_; | |||||||||||||||||||||||||||||||||
| 51 | 6 | ▶ | return 1 if $self->{type} eq 'phony'; | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 52 | 6 | ▶ | return -d $self->{target} || (-e _ && $mtime <= -M _); | ||||||||||||||||||||||||||||||||
|
Condition66%4/6
-d $self->{'target'} || -e _ && $mtime <= -M _
-e _ and $mtime <= -M _
MC/DC33%1/3
-d $self->{'target'} || -e _ && $mtime <= -M _
-d $self->{'target'}
-e _
$mtime <= -M _
Truth table50%2/4
A || B and C
A= -d $self->{'target'}B= -e _C= $mtime <= -M _
| |||||||||||||||||||||||||||||||||||
| 53 | } | ||||||||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||||||||
| 55 | 11 | 1; | |||||||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||||||||
| 57 | # ABSTRACT: An ExtUtils::Builder Node | ||||||||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||||||||
| 59 | __END__ | ||||||||||||||||||||||||||||||||||