Net/SecurityCenter/API/File.pm

filter: Statementstmt 62.9% 17 / 27 Branchbran 0.0% 0 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 71.4% 5 / 7 Podpod 100% 2 / 2 totaltotal 54.5% 24 / 44 CC 5 SCAR 19.5
CC
5
Cov
49%
upload
12.0
clear
12.0
BEGIN
1.0
CRAP 7.0
« Net/SecurityCenter/API/Report.pm ↑ Summary Net/SecurityCenter/API/Credential.pm »
1 package Net::SecurityCenter::API::File;
2  
3 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 2 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 2 ▶use parent 'Net::SecurityCenter::Base';
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 2 ▶use Net::SecurityCenter::Utils qw(:all);
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 2 our $VERSION = '0.310';
13  
14 #-------------------------------------------------------------------------------
15 # METHODS
16 #-------------------------------------------------------------------------------
17  
18 sub upload {
19  
20 0 ▶ my ( $self, $file ) = @_;
Subroutine upload: not called CC=3 SCAR=24.8
Pod documented
21  
22 0 ▶ ( @_ == 2 ) or croak( 'Usage: ' . __PACKAGE__ . '->upload( $FILE )' );
Branch: 1 branch
BranchTrueFalseTotal
@_ == 2 or croak("Usage: Net::SecurityCenter::API::File->upload( \$FILE )") 0 0 0
23  
24 0 my $response = $self->client->upload($file);
25  
26 0 ▶ return if ( !$response );
Branch: 1 branch
BranchTrueFalseTotal
unless $response 0 0 0
27 0 return $response->{filename};
28  
29 }
30  
31 #-------------------------------------------------------------------------------
32  
33 sub clear {
34  
35 0 ▶ my ( $self, $file ) = @_;
Subroutine clear: not called CC=3 SCAR=24.8
Pod documented
36  
37 0 ▶ ( @_ == 2 ) or croak( 'Usage: ' . __PACKAGE__ . '->clear( $FILE )' );
Branch: 1 branch
BranchTrueFalseTotal
@_ == 2 or croak("Usage: Net::SecurityCenter::API::File->clear( \$FILE )") 0 0 0
38  
39 0 my $response = $self->client->post( '/file/clear', { filename => $file } );
40  
41 0 ▶ return if ( !$response );
Branch: 1 branch
BranchTrueFalseTotal
unless $response 0 0 0
42 0 return 1;
43  
44 }
45  
46 #-------------------------------------------------------------------------------
47  
48 2 1;
49  
50 __END__
« Net/SecurityCenter/API/Report.pm ↑ Summary Net/SecurityCenter/API/Credential.pm »