blib/lib/SignalWire/Utils.pm

filter: Statementstmt 100% 15 / 15 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 1 totaltotal 95.6% 22 / 23 CC 2 SCAR 2.9
CC
2
Cov
100%
is_serverless_mode
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« blib/lib/SignalWire/SWML/Document.pm ↑ Summary blib/lib/SignalWire/REST/Namespaces/Base.pm »
1 package SignalWire::Utils;
2 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use Exporter qw(import);
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 ▶use SignalWire::Core::LoggingConfig ();
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 our @EXPORT_OK = qw(is_serverless_mode);
9  
10 # Cross-language SDK contract: SignalWire::Utils::is_serverless_mode
11 # mirrors signalwire.utils.is_serverless_mode in the Python reference.
12 # Returns 1 (true) when running inside any short-lived / event-driven
13 # environment (i.e. anything other than 'server'); 0 otherwise.
14 4 ▶sub is_serverless_mode {
Subroutine is_serverless_mode: called CC=2 SCAR=6.9
Pod undocumented
15 4 ▶ return SignalWire::Core::LoggingConfig::get_execution_mode() ne 'server'
Branch: 1 branch
BranchTrueFalseTotal
SignalWire::Core::LoggingConfig::get_execution_mode() ne 'server' ? : 3 1 4
16 ? 1
17 : 0;
18 }
19  
20 1 1;
« blib/lib/SignalWire/SWML/Document.pm ↑ Summary blib/lib/SignalWire/REST/Namespaces/Base.pm »