Gnats/Command/DBDESC.pm

filter: Statementstmt 91.6% 22 / 24 Branchbran 100% 2 / 2 Conditioncond 100% 2 / 2 MC/DCmcdc 100% 1 / 1 Subroutinesub 87.5% 7 / 8 Podpod 33.3% 1 / 3 totaltotal 87.5% 35 / 40 CC 3 SCAR 4.1
CC
3
Cov
93%
new
2.0
to_string
2.0
is_ok
2.0
CRAP 1.5
« Gnats/Command/QUER.pm ↑ Summary Gnats/Command/DBLS.pm »
1 package Net::Gnats::Command::DBDESC;
2 40 ▶use parent 'Net::Gnats::Command';
Subroutine BEGIN: called CC=1 SCAR=0.0
3 40 ▶use strictures;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 40 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.0
5 40 $Net::Gnats::Command::DBDESC::VERSION = '0.22';
6 }
7 40 ▶use vars qw($VERSION);
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 40 ▶use Net::Gnats::Constants qw(CODE_INFORMATION CODE_INVALID_DATABASE CODE_CMD_ERROR);
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 =head1 NAME
12  
13 Net::Gnats::Command::DEDESC
14  
15 =head1 DESCRIPTION
16  
17 Returns a human-readable description of the specified database.
18  
19 =head1 PROTOCOL
20  
21 DBDESC [database]
22  
23 =head1 RESPONSES
24  
25 Responses include:
26  
27 6xx (internal error) An internal error was encountered while trying
28 to read the list of available databases, usually due to lack of
29 permissions or other filesystem-related problems, or the list of
30 databases is empty.
31  
32 350 (CODE_INFORMATION) The normal response; the supplied text is the
33 database description.
34  
35 417 (CODE_INVALID_DATABASE) The specified database name does not
36 have an entry.
37  
38 440 (CODE_CMD_ERROR) Required parameter not passed.
39  
40 =cut
41  
42 40 my $c = 'DBDESC';
43  
44 3 ▶sub new {
Subroutine new: called CC=2 SCAR=6.9
Pod documented
45 3 my ( $class, %options ) = @_;
46  
47 3 my $self = bless \%options, $class;
48 3 ▶ $self->{name} = $self->{name} || '';
Condition100%2/2
$self->{'name'} || ''
l!l
21
MC/DC100%1/1
$self->{'name'} || ''
$self->{'name'}
Truth table100%2/2
A
A= $self->{'name'}
Aresult
11
00
49 3 return $self;
50 }
51  
52 0 ▶sub to_string {
Subroutine to_string: not called CC=1 SCAR=6.9
Pod undocumented
53 0 my ($self) = @_;
54 0 return $c . ' ' . $self->{name};
55 }
56  
57 3 ▶sub is_ok {
Subroutine is_ok: called CC=2 SCAR=6.9
Pod undocumented
58 3 my $self = shift;
59 3 ▶ return 1 if $self->response->code == CODE_INFORMATION;
Branch: 1 branch
BranchTrueFalseTotal
if $self->response->code == 350 1 2 3
60 2 return 0;
61 }
62  
63 40 1;
« Gnats/Command/QUER.pm ↑ Summary Gnats/Command/DBLS.pm »