Bencher/Formatter/DeleteNotesFieldIfEmpty.pm

filter: Statementstmt 80.7% 21 / 26 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 83.3% 5 / 6 Podpod 0.0% 0 / 1 totaltotal 74.2% 26 / 35 CC 3 SCAR 16.3
CC
3
Cov
75%
munge_result
12.0
BEGIN
1.0
BEGIN
1.0
CRAP 5.1
« Bencher/Formatter/ShowEnv.pm ↑ Summary Bencher/Formatter/RenderAsTextTable.pm »
1 package Bencher::Formatter::DeleteNotesFieldIfEmpty;
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 for my $row (@{$envres->[2]}) {
23 0 ▶ return if $row->{notes};
Branch: 1 branch
BranchTrueFalseTotal
if $row->{"notes"} 0 0 0
24 }
25  
26 $self->delete_fields(
27 0 $envres,
28 'notes'
29 );
30 }
31  
32 1 1;
33 # ABSTRACT: Delete notes field if there are no notes
34  
35 __END__
« Bencher/Formatter/ShowEnv.pm ↑ Summary Bencher/Formatter/RenderAsTextTable.pm »