blib/lib/App/Netdisco/Web/Plugin/Report/VrfInconsistency.pm untested

filter: Statementstmt 0.0% 0 / 23 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 4 Podpod n/a totaltotal 0.0% 0 / 31 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 package App::Netdisco::Web::Plugin::Report::VrfInconsistency;
2  
3 use Dancer ':syntax';
4 use Dancer::Plugin::DBIC;
5 use Dancer::Plugin::Auth::Extensible;
6  
7 use App::Netdisco::Web::Plugin;
8  
9 register_report(
10 { category => 'IP',
11 tag => 'vrfinconsistency',
12 label => 'VRF Naming Inconsistencies',
13 provides_csv => 1,
14 api_endpoint => 1,
15 }
16 );
17  
18 get '/ajax/content/report/vrfinconsistency' => require_login sub {
19 my @results = schema(vars->{'tenant'})->resultset('Virtual::VrfInconsistency')
20 ->search( undef, { order_by => [qw/ finding domain vrfs /] } )->hri->all;
21  
22 return unless scalar @results;
23  
24 if ( request->is_ajax ) {
25 template 'ajax/report/vrfinconsistency.tt', { results => to_json(\@results) }, { layout => 'noop' };
26 }
27 else {
28 header( 'Content-Type' => 'text/comma-separated-values' );
29 template 'ajax/report/vrfinconsistency_csv.tt', { results => \@results }, { layout => 'noop' };
30 }
31 };
32  
33 true;