API/Analysis.pm

filter: Statementstmt 100% 52 / 52 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod 100% 1 / 1 totaltotal 98.3% 61 / 62 CC 3 SCAR 3.7
CC
3
Cov
98%
_init
2.0
as_xml
2.0
BEGIN
1.0
CRAP 1.4
« API/SizeFact.pm ↑ Summary API/Message/Tag.pm »
1 package WWW::Ohloh::API::Analysis;
2 30 our $AUTHORITY = 'cpan:YANICK';
3  
4 30 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 30 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 30 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 30 ▶use Object::InsideOut;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 30 our $VERSION = '1.0_1';
11  
12 30 my @request_url_of : Field : Arg(request_url) : Get( request_url );
13 30 my @xml_of : Field : Arg(xml);
14  
15 30 my @id_of : Field : Get(id) : Set(_set_id);
16 30 my @project_id_of : Field : Get(project_id) : Set(_set_project_id);
17 30 my @updated_at_of : Field : Get(updated_at) : Set(_set_updated_at);
18 30 my @logged_at_of : Field : Get(logged_at) : Set(_set_logged_at);
19 30 my @min_month_of : Field : Get(min_month) : Set(_set_min_month);
20 30 my @max_month_of : Field : Get(max_month) : Set(_set_max_month);
21 30 my @twelve_month_contributor_count_of : Field :
22 Get(twelve_month_contributor_count) :
23 Set(_set_twelve_month_contributor_count);
24 30 my @total_code_lines_of : Field : Get(total_code_lines) :
25 Set(_set_total_code_lines);
26 30 my @main_language_id_of : Field : Get(main_language_id) :
27 Set(_set_main_language_id);
28 30 my @main_language_name_of : Field : Get(main_language_name) :
29 Set(_set_main_language_name);
30  
31 2 ▶sub _init : Init {
Subroutine _init: called CC=2 SCAR=6.9
32 2 my $self = shift;
33  
34 2 ▶ my $dom = $xml_of[$$self] or return;
Branch: 1 branch
BranchTrueFalseTotal
my $dom = $xml_of[$$self] or return 2 0 2
35  
36 2 $self->_set_id( $dom->findvalue('id/text()') );
37 2 $self->_set_project_id( $dom->findvalue('project_id/text()') );
38 2 $self->_set_updated_at( $dom->findvalue('updated_at/text()') );
39 2 $self->_set_logged_at( $dom->findvalue('logged_at/text()') );
40 2 $self->_set_min_month( $dom->findvalue('min_month/text()') );
41 2 $self->_set_max_month( $dom->findvalue('max_month/text()') );
42 2 $self->_set_twelve_month_contributor_count(
43 $dom->findvalue('twelve_month_contributor_count/text()') );
44 2 $self->_set_total_code_lines(
45 $dom->findvalue('total_code_lines/text()') );
46 2 $self->_set_main_language_id(
47 $dom->findvalue('main_language_id/text()') );
48 2 $self->_set_main_language_name(
49 $dom->findvalue('main_language_name/text()') );
50  
51 2 return;
52 30 ▶}
Subroutine BEGIN: called CC=1 SCAR=0.0
53  
54 1 ▶sub as_xml {
Subroutine as_xml: called CC=2 SCAR=6.9
Pod documented
55 1 my $self = shift;
56 1 my $xml;
57 1 my $w = XML::Writer->new( OUTPUT => \$xml );
58  
59 1 $w->startTag('analysis');
60 1 for my $attr (
61 qw/ id project_id
62 updated_at logged_at min_month
63 max_month twelve_month_contributor_count
64 total_code_lines
65 main_language_name
66 main_language_id
67 /
68 ) {
69 10 $w->dataElement( $attr, $self->$attr );
70 }
71  
72 1 $w->endTag;
73  
74 1 return $xml;
75 }
76  
77 30 *language = *main_language = *main_language_name;
78  
79 30 'end of WWW::Ohloh::API::Analysis';
80  
81 __END__
« API/SizeFact.pm ↑ Summary API/Message/Tag.pm »