blib/lib/Ukigumo/Server/API.pm

filter: Statementstmt 81.8% 18 / 22 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 71.4% 5 / 7 Podpod 100% 1 / 1 totaltotal 80.0% 24 / 30 CC 1 SCAR 2.5
CC
1
Cov
82%
dispatch
2.0
__ANON__
2.0
BEGIN
1.0
CRAP 1.3
« _build/lib/MyBuilder.pm ↑ Summary blib/lib/Ukigumo/Server/L10N.pm »
1 package Ukigumo::Server::API;
2 11 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 11 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 11 ▶use parent qw/Ukigumo::Server Amon2::Web/;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 11 ▶use File::Spec;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 # dispatcher
8 11 ▶use Ukigumo::Server::API::Dispatcher;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 sub dispatch {
11 0 ▶ my $c = shift;
Subroutine dispatch: not called CC=1 SCAR=6.9
Pod documented
12 0 return Ukigumo::Server::API::Dispatcher->dispatch($c) or die "response is not generated";
13 }
14  
15 11 __PACKAGE__->load_plugins( 'Web::JSON' );
16  
17 # for your security
18 __PACKAGE__->add_trigger(
19 AFTER_DISPATCH => sub {
20 0 ▶ my ( $c, $res ) = @_;
Subroutine __ANON__: not called CC=1 SCAR=6.9
21 0 $res->header( 'X-Content-Type-Options' => 'nosniff' );
22 },
23 11 );
24  
25 11 1;
« _build/lib/MyBuilder.pm ↑ Summary blib/lib/Ukigumo/Server/L10N.pm »