Resource/Unit.pm

filter: Statementstmt 59.6% 34 / 57 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 33.3% 10 / 30 Podpod 95.0% 19 / 20 totaltotal 57.8% 63 / 109 CC 2 SCAR 6.6
CC
2
Cov
58%
new
6.0
commented_by
2.0
commented_on
2.0
CRAP 1.9
« Exception/HTTP/NotFound.pm ↑ Summary Resource/Project.pm »
1 # Copyright (C) 2017 Koha-Suomi
2 #
3 # This file is part of Pootle-Client.
4  
5 package Pootle::Resource::Unit;
6  
7 1 ▶use Modern::Perl '2015';
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 binmode STDOUT, ':encoding(UTF-8)';
10 1 binmode STDERR, ':encoding(UTF-8)';
11 1 ▶use feature 'signatures'; no warnings "experimental::signatures";
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
12 1 ▶use Carp::Always;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 1 ▶use Try::Tiny;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 1 ▶use Scalar::Util qw(blessed);
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 =head2 Pootle::Resource::Unit
17  
18 Pootle object
19  
20 =cut
21  
22 1 ▶use base('Pootle::Resource');
Subroutine BEGIN: called CC=1 SCAR=0.0
23  
24 1 ▶use Params::Validate qw(:all);
Subroutine BEGIN: called CC=1 SCAR=0.0
25  
26 1 ▶use Pootle::Logger;
Subroutine BEGIN: called CC=1 SCAR=0.0
27 1 my $l = bless({}, 'Pootle::Logger'); #Lazy load package logger this way to avoid circular dependency issues with logger includes from many packages
28  
29 0 ▶sub new($class, @params) {
Subroutine new: not called CC=2 SCAR=17.9
Pod undocumented
30 0 ▶ $l->debug("Initializing ".__PACKAGE__." with parameters: ".$l->flatten(@params)) if $l->is_debug();
Branch: 1 branch
BranchTrueFalseTotal
if $l->is_debug 0 0 0
31 0 my %self = validate(@params, {
32 commented_by => 0, #eg. null
33 commented_on => 1, #eg. "2013-03-15T20:10:35.017844",
34 context => 1, #eg. "This is a phrase, not a verb.",
35 developer_comment => 1, #eg. "Translators: name of the option in the menu.",
36 locations => 1, #eg. "fr/firefox/chrome/global/languageNames.properties.po:62",
37 mtime => 1, #eg. 2013-05-12T17:51:49.786611",
38 resource_uri => 1, #eg. "/api/v1/units/70316/",
39 source_f => 1, #eg. "New Tab",
40 source_length => 1, #eg. 29,
41 source_wordcount => 1, #eg. 3,
42 state => 1, #eg. 0,
43 store => 1, #eg. "/api/v1/stores/76/",
44 submitted_by => 0, #eg. "/api/v1/users/3/",
45 submitted_on => 1, #eg. "2013-05-21T17:51:16.155000",
46 suggestions => { type => ARRAYREF }, #eg. ["/api/v1/suggestions/1/", ...]
47 target_f => 1, #eg. "",
48 target_length => 1, #eg. 0,
49 target_wordcount => 1, #eg. 0,
50 translator_comment => 1, #eg. ""
51 });
52 0 my $s = bless(\%self, $class);
53  
54 0 return $s;
55 }
56  
57 0 ▶sub commented_by($s) { return $s->{commented_by} }
Subroutine commented_by: not called CC=1 SCAR=6.9
Pod documented
58 0 ▶sub commented_on($s) { return $s->{commented_on} }
Subroutine commented_on: not called CC=1 SCAR=6.9
Pod documented
59 0 ▶sub context($s) { return $s->{context} }
Subroutine context: not called CC=1 SCAR=6.9
Pod documented
60 0 ▶sub developer_comment($s) { return $s->{developer_comment} }
Subroutine developer_comment: not called CC=1 SCAR=6.9
Pod documented
61 0 ▶sub locations($s) { return $s->{locations} }
Subroutine locations: not called CC=1 SCAR=6.9
Pod documented
62 0 ▶sub mtime($s) { return $s->{mtime} }
Subroutine mtime: not called CC=1 SCAR=6.9
Pod documented
63 0 ▶sub resource_uri($s) { return $s->{resource_uri} }
Subroutine resource_uri: not called CC=1 SCAR=6.9
Pod documented
64 0 ▶sub source_f($s) { return $s->{source_f} }
Subroutine source_f: not called CC=1 SCAR=6.9
Pod documented
65 0 ▶sub source_length($s) { return $s->{source_length} }
Subroutine source_length: not called CC=1 SCAR=6.9
Pod documented
66 0 ▶sub source_wordcount($s) { return $s->{source_wordcount} }
Subroutine source_wordcount: not called CC=1 SCAR=6.9
Pod documented
67 0 ▶sub state($s) { return $s->{state} }
Subroutine state: not called CC=1 SCAR=6.9
Pod documented
68 0 ▶sub store($s) { return $s->{store} }
Subroutine store: not called CC=1 SCAR=6.9
Pod documented
69 0 ▶sub submitted_by($s) { return $s->{submitted_by} }
Subroutine submitted_by: not called CC=1 SCAR=6.9
Pod documented
70 0 ▶sub submitted_on($s) { return $s->{submitted_on} }
Subroutine submitted_on: not called CC=1 SCAR=6.9
Pod documented
71 0 ▶sub suggestions($s) { return $s->{suggestions} }
Subroutine suggestions: not called CC=1 SCAR=6.9
Pod documented
72 0 ▶sub target_f($s) { return $s->{target_f} }
Subroutine target_f: not called CC=1 SCAR=6.9
Pod documented
73 0 ▶sub target_length($s) { return $s->{target_length} }
Subroutine target_length: not called CC=1 SCAR=6.9
Pod documented
74 0 ▶sub target_wordcount($s) { return $s->{target_wordcount} }
Subroutine target_wordcount: not called CC=1 SCAR=6.9
Pod documented
75 0 ▶sub translator_comment($s) { return $s->{translator_comment} }
Subroutine translator_comment: not called CC=1 SCAR=6.9
Pod documented
76  
77 =head2 Accessors
78  
79 =over 4
80  
81 =item B<commented_by>
82  
83 =item B<commented_on>
84  
85 =item B<context>
86  
87 =item B<developer_comment>
88  
89 =item B<locations>
90  
91 =item B<mtime>
92  
93 =item B<resource_uri>
94  
95 =item B<source_f>
96  
97 =item B<source_length>
98  
99 =item B<source_wordcount>
100  
101 =item B<state>
102  
103 =item B<store>
104  
105 =item B<submitted_by>
106  
107 =item B<submitted_on>
108  
109 =item B<suggestions>
110  
111 =item B<target_f>
112  
113 =item B<target_length>
114  
115 =item B<target_wordcount>
116  
117 =item B<translator_comment>
118  
119 =cut
120  
121 1 1;
« Exception/HTTP/NotFound.pm ↑ Summary Resource/Project.pm »