Karabiner/Manipulator/Actions/To_delayed_if_invoked.pm

filter: Statementstmt 93.3% 28 / 30 Branchbran 50.0% 2 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 100% 1 / 1 totaltotal 90.2% 37 / 41 CC 3 SCAR 5.8
CC
3
Cov
88%
new
3.1
BEGIN
1.0
BEGIN
1.0
CRAP 1.8
« Karabiner/Manipulator/Conditions/Event_changed_if.pm ↑ Summary Karabiner/Rule.pm »
1 package JSON::Karabiner::Manipulator::Actions::To_delayed_if_invoked ;
2 3 $JSON::Karabiner::Manipulator::Actions::To_delayed_if_invoked::VERSION = '0.018';
3 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 3 ▶use JSON;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 3 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 3 ▶use parent 'JSON::Karabiner::Manipulator::Actions::To';
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 5 ▶sub new {
Subroutine new: called CC=3 SCAR=11.4
Pod documented
10 5 my $class = shift;
11 5 my ($type, $value) = @_;
12 5 my $obj;
13 5 ▶ if ($main::has_delayed_action) {
Branch: 1 branch
BranchTrueFalseTotal
if ($main::has_delayed_action) { } 0 5 5
14 0 $obj = $main::has_delayed_action;
15 } else {
16 5 $obj = $class->SUPER::new('to_delayed_action', $value);
17 5 $obj->{data} = {};
18 }
19 5 $obj->{delayed_type} = 'invoked';
20 5 ▶ if ($value) {
Branch: 1 branch
BranchTrueFalseTotal
if ($value) { } 0 5 5
21 0 $obj->{data} = $value,
22 } else {
23 5 $obj->{data}{to_if_invoked} = [];
24  
25 # $obj->{data}{to_delayed_action}{to_if_invoked} = [];
26 }
27 5 $main::has_delayed_action = $obj;
28 5 return $obj;
29 }
30  
31 # ABSTRACT: to_delayed_if_invoked action
32  
33 3 1;
34  
35 __END__
« Karabiner/Manipulator/Conditions/Event_changed_if.pm ↑ Summary Karabiner/Rule.pm »