blib/lib/Role/TinyCommons/TermAttr/Color.pm

filter: Statementstmt 36.3% 8 / 22 Branchbran n/a Conditioncond 0.0% 0 / 4 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 33.3% 1 / 3 Podpod 100% 2 / 2 totaltotal 33.3% 11 / 33 CC 5 SCAR 23.4
CC
5
Cov
31%
termattr_use_color
12.0
termattr_color_depth
12.0
BEGIN
1.0
CRAP 10.4
↑ Summary
1 package Role::TinyCommons::TermAttr::Color;
2  
3 1 our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
4 1 our $DATE = '2020-06-06'; # DATE
5 1 our $DIST = 'Role-TinyCommons-TermAttr-Color'; # DIST
6 1 our $VERSION = '0.002'; # VERSION
7  
8 1 ▶use Role::Tiny;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 0 ▶sub termattr_use_color {
Subroutine termattr_use_color: not called CC=3 SCAR=24.8
Pod documented
11 0 require Term::App::Util::Color;
12  
13 0 my $self = shift;
14  
15 0 my $res = Term::App::Util::Color::term_app_should_use_color();
16 0 ▶ $self->{_termattr_debug_info} //= {};
Condition0%0/2
$self->{"_termattr_debug_info"} //= {}
l!l
00
MC/DC0%0/1
$self->{"_termattr_debug_info"} //= {}
$self->{"_termattr_debug_info"}
Truth table0%0/2
A
A= $self->{"_termattr_debug_info"}
Aresult
11
00
17 $self->{_termattr_debug_info}{$_} = $res->[3]{'func.debug_info'}{$_}
18 0 for keys %{ $res->[3]{'func.debug_info'} };
19 0 $res->[2];
20 }
21  
22 0 ▶sub termattr_color_depth {
Subroutine termattr_color_depth: not called CC=3 SCAR=24.8
Pod documented
23 0 require Term::App::Util::Color;
24  
25 0 my $self = shift;
26  
27 0 my $res = Term::App::Util::Color::term_app_color_depth();
28 0 ▶ $self->{_termattr_debug_info} //= {};
Condition0%0/2
$self->{"_termattr_debug_info"} //= {}
l!l
00
MC/DC0%0/1
$self->{"_termattr_debug_info"} //= {}
$self->{"_termattr_debug_info"}
Truth table0%0/2
A
A= $self->{"_termattr_debug_info"}
Aresult
11
00
29 $self->{_termattr_debug_info}{$_} = $res->[3]{'func.debug_info'}{$_}
30 0 for keys %{ $res->[3]{'func.debug_info'} };
31 0 $res->[2];
32 }
33  
34 1 1;
35 # ABSTRACT: Determine color depth and whether to use color or not
36  
37 __END__
↑ Summary