File Coverage

lib/App/Sandy/Command/Quality.pm
Criterion Covered Total %
statement 9 22 40.9
branch 0 4 0.0
condition n/a
subroutine 3 7 42.8
pod 2 3 66.6
total 14 36 38.8


line stmt bran cond sub pod time code
1             package App::Sandy::Command::Quality;
2             # ABSTRACT: quality command class. Manage quality profile database.
3              
4 1     1   620 use App::Sandy::Base 'class';
  1         3  
  1         7  
5 1     1   10 use App::Sandy::DB::Handle::Quality;
  1         2  
  1         25  
6 1     1   6 use Text::ASCIITable;
  1         2  
  1         493  
7              
8             extends 'App::Sandy::CLI::Command';
9              
10             our $VERSION = '0.22'; # VERSION
11              
12             has 'db' => (
13             is => 'ro',
14             isa => 'App::Sandy::DB::Handle::Quality',
15             builder => '_build_db',
16             lazy_build => 1,
17             handles => [qw/insertdb restoredb deletedb make_report retrievedb/]
18             );
19              
20             sub _build_db {
21 0     0     return App::Sandy::DB::Handle::Quality->new;
22             }
23              
24             override 'opt_spec' => sub {
25             super
26             };
27              
28             sub subcommand_map {
29 0     0 0   add => 'App::Sandy::Command::Quality::Add',
30             remove => 'App::Sandy::Command::Quality::Remove',
31             restore => 'App::Sandy::Command::Quality::Restore',
32             dump => 'App::Sandy::Command::Quality::Dump'
33             }
34              
35             sub validate_args {
36 0     0 1   my ($self, $args) = @_;
37 0 0         die "Too many arguments: '@$args'\n" if @$args;
38             }
39              
40             sub execute {
41 0     0 1   my ($self, $opts, $args) = @_;
42              
43 0           my $report_ref = $self->make_report;
44              
45 0 0         if (%$report_ref) {
46 0           my $t1 = Text::ASCIITable->new;
47 0           $t1->setCols('quality profile', 'mean', 'stdd', 'error', 'type', 'source', 'provider', 'date');
48              
49 0           for my $quality_profile (sort keys %$report_ref) {
50 0           my $attr = $report_ref->{$quality_profile};
51             $t1->addRow($quality_profile, $attr->{mean}, $attr->{stdd}, $attr->{error}, $attr->{type},
52 0           $attr->{source}, $attr->{provider}, $attr->{date});
53             }
54              
55 0           print $t1;
56             }
57             }
58              
59             __END__
60              
61             =pod
62              
63             =encoding UTF-8
64              
65             =head1 NAME
66              
67             App::Sandy::Command::Quality - quality command class. Manage quality profile database.
68              
69             =head1 VERSION
70              
71             version 0.22
72              
73             =head1 SYNOPSIS
74              
75             sandy quality
76             sandy quality [options]
77             sandy quality <command>
78              
79             Options:
80             -h, --help brief help message
81             -u, --man full documentation
82            
83             Commands:
84             add add a new quality profile to database
85             dump dump a quality-profle from database
86             remove remove an user quality profle from database
87             restore restore the database
88              
89             =head1 DESCRIPTION
90              
91             Manage quality profile database.
92              
93             =head1 AUTHORS
94              
95             =over 4
96              
97             =item *
98              
99             Thiago L. A. Miller <tmiller@mochsl.org.br>
100              
101             =item *
102              
103             J. Leonel Buzzo <lbuzzo@mochsl.org.br>
104              
105             =item *
106              
107             Felipe R. C. dos Santos <fsantos@mochsl.org.br>
108              
109             =item *
110              
111             Helena B. Conceição <hconceicao@mochsl.org.br>
112              
113             =item *
114              
115             Gabriela Guardia <gguardia@mochsl.org.br>
116              
117             =item *
118              
119             Fernanda Orpinelli <forpinelli@mochsl.org.br>
120              
121             =item *
122              
123             Pedro A. F. Galante <pgalante@mochsl.org.br>
124              
125             =back
126              
127             =head1 COPYRIGHT AND LICENSE
128              
129             This software is Copyright (c) 2018 by Teaching and Research Institute from Sírio-Libanês Hospital.
130              
131             This is free software, licensed under:
132              
133             The GNU General Public License, Version 3, June 2007
134              
135             =cut