Concierge/Desk/Component.pm

filter: Statementstmt 100% 10 / 10 Branchbran 100% 4 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 2 / 2 Podpod 100% 1 / 1 totaltotal 100% 17 / 17 CC 3 SCAR 9.2
CC
3
Cov
100%
probe_component
3.0
BEGIN
1.0
CRAP 2.5
« Concierge/Desk/DeferredComponent.pm ↑ Summary
1 package Concierge::Desk::Component v0.13.0;
2 9 ▶use v5.36;
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 9 our $VERSION = 'v0.13.0';
5  
6 # ABSTRACT: Contract documentation for additional Concierge desk components
7  
8 # probe_component($class, $payload) -- the one functional sub this module
9 # contains (see POD, "This module is B<pure documentation>" below for the
10 # single exception this carves out). Shared by Concierge::Desk::Setup's
11 # build_desk() (tier 1b) and Concierge's open_desk() (tier 2) for 'defer'
12 # components, so the two call sites can never drift out of sync. Plain
13 # package-qualified function, not a method -- Component.pm is never
14 # instantiated and nothing inherits from it.
15 17 ▶sub probe_component ($class, $payload) {
Subroutine probe_component: called CC=3 SCAR=11.0
Pod documented
16 17 ▶ return $class->probe($payload) if $class->can('probe');
Branch: 1 branch
BranchTrueFalseTotal
if $class->can("probe") 11 6 17
17 6 my $ok = eval {
18 6 (my $file = $class) =~ s{::}{/}g;
19 6 require "$file.pm";
20 5 1;
21 };
22 6 ▶ return $ok ? { success => 1 } : { success => 0, message => $@ };
Branch: 1 branch
BranchTrueFalseTotal
$ok ? : 5 1 6
23 }
24  
25 9 1;
26  
27 __END__
« Concierge/Desk/DeferredComponent.pm ↑ Summary