Bencher/Formatter/ShowEnv.pm

filter: Statementstmt 65.6% 21 / 32 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 71.4% 5 / 7 Podpod 0.0% 0 / 1 totaltotal 59.0% 26 / 44 CC 4 SCAR 16.7
CC
4
Cov
58%
munge_result
12.0
__ANON__
6.0
BEGIN
1.0
CRAP 5.3
« Benchmark/Dumb/SimpleTime.pm ↑ Summary Bencher/Formatter/DeleteNotesFieldIfEmpty.pm »
1 package Bencher::Formatter::ShowEnv;
2  
3 1 ▶use 5.010001;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 #use Log::Any::IfLOG '$log';
7  
8 1 ▶use parent qw(Bencher::Formatter);
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 1 ▶use Role::Tiny::With;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 1 with 'Bencher::Role::FieldMunger';
12 1 with 'Bencher::Role::ResultMunger';
13  
14 1 our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
15 1 our $DATE = '2023-07-08'; # DATE
16 1 our $DIST = 'Bencher-Backend'; # DIST
17 1 our $VERSION = '1.063'; # VERSION
18  
19 0 ▶sub munge_result {
Subroutine munge_result: not called CC=3 SCAR=24.8
Pod undocumented
20 0 my ($self, $envres) = @_;
21  
22 0 ▶ return unless @{$envres->[2]};
Branch: 1 branch
BranchTrueFalseTotal
unless @{$envres->[2];} 0 0 0
23 0 ▶ return unless exists $envres->[2][0]{env_hash};
Branch: 1 branch
BranchTrueFalseTotal
unless exists $envres->[2][0]{"env_hash"} 0 0 0
24  
25 $self->add_field(
26 $envres,
27 'env',
28 {after=>'env_hash'},
29 0 ▶ sub {
Subroutine __ANON__: not called CC=2 SCAR=17.9
30 0 for my $rit (@{$envres->[2]}) {
31 0 my $env_hash = $envres->[3]{'func.scenario_env_hashes'}[ $rit->{env_hash} ];
32 0 $rit->{env} = join(" ", map {"$_=$env_hash->{$_}"} sort keys %$env_hash);
33 }
34 }
35 0 );
36 0 $self->delete_fields($envres, 'env_hash');
37 }
38  
39 1 1;
40 # ABSTRACT: Replace 'env_hash' field (numeric) with 'env' (string)
41  
42 __END__
« Benchmark/Dumb/SimpleTime.pm ↑ Summary Bencher/Formatter/DeleteNotesFieldIfEmpty.pm »