Qgoda/Asset.pm

filter: Statementstmt 72.0% 18 / 25 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 71.4% 5 / 7 Podpod 0.0% 0 / 5 totaltotal 58.9% 23 / 39 CC 2 SCAR 8.6
CC
2
Cov
67%
getOrigin
6.0
dump
2.0
BEGIN
1.0
CRAP 2.4
« Qgoda/Util/Date.pm ↑ Summary Qgoda/Command/Config.pm »
1 #! /bin/false
2  
3 # Copyright (C) 2016-2018 Guido Flohr <guido.flohr@cantanea.com>,
4 # all rights reserved.
5  
6 # This program is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3 of the License, or
9 # (at your option) any later version.
10  
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15  
16 # You should have received a copy of the GNU General Public License
17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
18  
19 package Qgoda::Asset;
20 6 $Qgoda::Asset::VERSION = 'v0.9.2';
21 6 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
22  
23 6 ▶use Qgoda::Util qw(merge_data);
Subroutine BEGIN: called CC=1 SCAR=0.0
24  
25 sub new {
26 3 ▶ my ($class, $path, $relpath) = @_;
Subroutine new: called CC=1 SCAR=0.0
Pod undocumented
27  
28 3 my $self = {};
29  
30 # Overwrite these two keys unconditionally.
31 3 $self->{path} = $path;
32 3 $self->{relpath} = $relpath;
33  
34 3 my $reldir = $relpath;
35 3 $reldir =~ s{/[^/]+$}{};
36 3 $self->{reldir} = $reldir;
37  
38 3 bless $self, $class;
39 }
40  
41 sub getPath {
42 11 ▶ shift->{path};
Subroutine getPath: called CC=1 SCAR=0.0
Pod undocumented
43 }
44  
45 sub getRelpath {
46 27 ▶ shift->{relpath};
Subroutine getRelpath: called CC=1 SCAR=0.0
Pod undocumented
47 }
48  
49 sub getOrigin {
50 0 ▶ my ($self) = @_;
Subroutine getOrigin: not called CC=2 SCAR=17.9
Pod undocumented
51  
52 0 ▶ if (exists $self->{origin}) {
Branch: 1 branch
BranchTrueFalseTotal
if (exists $self->{'origin'}) { } 0 0 0
53 0 return $self->{origin};
54 } else {
55 0 return $self->getPath;
56 }
57 }
58  
59 sub dump {
60 0 ▶ my ($self) = @_;
Subroutine dump: not called CC=1 SCAR=6.9
Pod undocumented
61  
62 0 %{$self};
63 }
64  
65 6 1;
« Qgoda/Util/Date.pm ↑ Summary Qgoda/Command/Config.pm »