Struct/User.pm

filter: Statementstmt 77.7% 7 / 9 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod n/a totaltotal 83.3% 10 / 12 CC 1 SCAR 0.9
CC
1
Cov
78%
BEGIN
1.3
BEGIN
1.0
BEGIN
1.0
CRAP 1.1
« Struct/Catalog.pm ↑ Summary Struct/YearMonth.pm »
1 package Toolforge::MixNMatch::Struct::User;
2  
3 6 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 6 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 6 ▶use Toolforge::MixNMatch::Object::User;
Subroutine BEGIN: called CC=1 SCAR=2.6
7  
8 our $VERSION = 0.02;
9  
10 sub obj2struct {
11 my $obj = shift;
12  
13 my $struct_hr = {
14 'cnt' => $obj->count,
15 'uid' => $obj->uid,
16 'username' => $obj->username,
17 };
18  
19 return $struct_hr;
20 }
21  
22 sub struct2obj {
23 my $struct_hr = shift;
24  
25 my $obj = Toolforge::MixNMatch::Object::User->new(
26 'count' => $struct_hr->{'cnt'},
27 'uid' => $struct_hr->{'uid'},
28 'username' => $struct_hr->{'username'},
29 );
30  
31 return $obj;
32 }
33  
34 1;
35  
36 __END__
« Struct/Catalog.pm ↑ Summary Struct/YearMonth.pm »