Gnats/Command/UNDB.pm

filter: Statementstmt 100% 23 / 23 Branchbran 75.0% 3 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 8 / 8 Podpod 66.6% 2 / 3 totaltotal 94.7% 36 / 38 CC 3 SCAR 4.7
CC
3
Cov
96%
is_ok
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.6
« Gnats/Command.pm ↑ Summary Gnats/Schema.pm »
1 package Net::Gnats::Command::UNDB;
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::UNDB::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_OK CODE_GNATS_NOT_LOCKED CODE_CMD_ERROR);
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 =head1 NAME
12  
13 Net::Gnats::Command::UNDB
14  
15 =head1 DESCRIPTION
16  
17 Unlocks the database. Any session may steal a database lock; no
18 checking of any sort is done.
19  
20 =head1 PROTOCOL
21  
22 UNDB
23  
24 =head1 RESPONSES
25  
26 The possible responses are:
27  
28 200 (CODE_OK) The lock has been removed.
29  
30 432 (CODE_GNATS_NOT_LOCKED) The database was not locked.
31  
32 440 (CODE_CMD_ERROR) One or more arguments were supplied to the
33 command.
34  
35 6xx (internal error) The database lock could not be removed, usually
36 because of permissions or other filesystem-related issues.
37  
38 =cut
39  
40 40 my $c = 'UNDB';
41  
42 1 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
Pod documented
43 1 my ( $class ) = @_;
44  
45 1 my $self = bless {}, $class;
46 1 return $self;
47 }
48  
49 8 ▶sub as_string {
Subroutine as_string: called CC=1 SCAR=0.0
Pod documented
50 8 return $c;
51 }
52  
53 4 ▶sub is_ok {
Subroutine is_ok: called CC=3 SCAR=11.0
Pod undocumented
54 4 my $self = shift;
55 4 ▶ return 0 if not defined $self->response;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $self->response 0 4 4
56 4 ▶ return 1 if $self->response->code == CODE_OK;
Branch: 1 branch
BranchTrueFalseTotal
if $self->response->code == 210 1 3 4
57 3 return 0;
58 }
59  
60 40 1;
« Gnats/Command.pm ↑ Summary Gnats/Schema.pm »