not/ENV.pm

filter: Statementstmt 100% 35 / 35 Branchbran 75.0% 3 / 4 Conditioncond 66.6% 2 / 3 MC/DCmcdc 50.0% 1 / 2 Subroutinesub 100% 8 / 8 Podpod n/a totaltotal 94.2% 49 / 52 CC 4 SCAR 5.5
CC
4
Cov
95%
__ANON__
3.0
__ANON__
2.0
BEGIN
1.0
CRAP 1.7
↑ Summary ENV.pm »
1 3 ▶use 5.006; # our
Subroutine BEGIN: called CC=1 SCAR=0.0
2 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 package Dist::Zilla::Plugin::if::not::ENV;
6  
7 3 our $VERSION = '0.001001';
8  
9 # ABSTRACT: Load a plugin when an ENV key is NOT true.
10  
11 3 our $AUTHORITY = 'cpan:KENTNL'; # AUTHORITY
12  
13 3 ▶use Moose qw( has around with );
Subroutine BEGIN: called CC=1 SCAR=0.0
14 3 ▶use Dist::Zilla::Util qw();
Subroutine BEGIN: called CC=1 SCAR=0.0
15 3 with 'Dist::Zilla::Role::PluginLoader::Configurable';
16  
17 3 has key => ( is => ro =>, required => 1 );
18  
19 2 ▶around dump_config => sub {
Subroutine __ANON__: called CC=2 SCAR=7.0
20 2 my ( $orig, $self, @args ) = @_;
21 2 my $config = $self->$orig(@args);
22 2 my $localconf = $config->{ +__PACKAGE__ } = {};
23  
24 2 $localconf->{key} = $self->key;
25  
26 2 ▶ $localconf->{ q[$] . __PACKAGE__ . '::VERSION' } = $VERSION
Branch: 1 branch
BranchTrueFalseTotal
unless __PACKAGE__ eq ref $self 0 2 2
27 unless __PACKAGE__ eq ref $self;
28  
29 2 return $config;
30 3 };
31  
32 2 ▶around load_plugins => sub {
Subroutine __ANON__: called CC=3 SCAR=11.0
33 2 my ( $orig, $self, $loader ) = @_;
34 2 my $key = $self->key;
35 2 ▶ return if exists $ENV{$key} and $ENV{$key};
Branch: 1 branch
BranchTrueFalseTotal
if exists $ENV{$key} and $ENV{$key} 1 1 2
Condition66%2/3
exists $ENV{$key} and $ENV{$key}
!ll&&!rl&&r
011
MC/DC50%1/2
exists $ENV{$key} and $ENV{$key}
exists $ENV{$key} $ENV{$key}
Truth table66%2/3
A and B
A= exists $ENV{$key}B= $ENV{$key}
ABresult
0X0
100
111
36 1 return $self->$orig($loader);
37 3 };
38  
39 3 __PACKAGE__->meta->make_immutable;
40 3 ▶no Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
41  
42 3 1;
43  
44 __END__
↑ Summary ENV.pm »