Database/Model/FileHashes.pm

filter: Statementstmt 50.0% 5 / 10 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 33.3% 1 / 3 Podpod 100% 2 / 2 totaltotal 36.3% 8 / 22 CC 3 SCAR 20.5
CC
3
Cov
33%
load_hash
12.0
save_hash
2.0
BEGIN
1.0
CRAP 7.8
↑ Summary Activity.pm »
1 package Daje::Workflow::FileChanged::Database::Model::FileHashes;
2 1 ▶use Mojo::Base -base, -signatures;
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4  
5 1 has 'db';
6  
7  
8 0 ▶sub save_hash($self, $file, $hash) {
Subroutine save_hash: not called CC=1 SCAR=6.9
Pod documented
9  
10 0 $self->db->insert(
11 'file_hashes',
12 {
13 file => $file, hash => $hash, moddatetime => 'NOW()'
14 },
15 {
16 on_conflict => [
17 file => {
18 hash => $hash
19 }
20 ]
21 }
22 );
23 }
24  
25 0 ▶sub load_hash($self, $file_path_name) {
Subroutine load_hash: not called CC=3 SCAR=24.8
Pod documented
26  
27 0 my $hash;
28 0 my $data = $self->db->select(
29 'file_hashes',
30 ['*'],
31 {
32 file => $file_path_name
33 }
34 );
35  
36 0 ▶ $hash = $data->hash if defined $data and $data->rows > 0;
Branch: 1 branch
BranchTrueFalseTotal
if defined $data and $data->rows > 0 0 0 0
Condition0%0/3
defined $data and $data->rows > 0
!ll&&!rl&&r
000
MC/DC0%0/2
defined $data and $data->rows > 0
defined $data $data->rows > 0
Truth table0%0/3
A and B
A= defined $dataB= $data->rows > 0
ABresult
0X0
100
111
37  
38 0 return $hash;
39 }
40 1 1;
41 #################### pod generated by Pod::Autopod - keep this line to make pod updates possible ####################
42  
43 =head1 NAME
44  
45 Daje::Workflow::FileChanged::Database::Model::FileHashes
46  
47  
48 =head1 REQUIRES
49  
50 L<Mojo::Base>
51  
52  
53 =head1 METHODS
54  
55 =head2 load_hash($self,
56  
57 load_hash($self,();
58  
59 =head2 save_hash($self,
60  
61 save_hash($self,();
62  
63  
64 =cut
65  
↑ Summary Activity.pm »