TinyERP.pm

filter: Statementstmt 96.4% 27 / 28 Branchbran 62.5% 5 / 8 Conditioncond 75.0% 3 / 4 MC/DCmcdc 50.0% 1 / 2 Subroutinesub 100% 7 / 7 Podpod 66.6% 2 / 3 totaltotal 86.5% 45 / 52 CC 7 SCAR 10.8
CC
7
Cov
88%
new
5.2
nota_fiscal
2.0
nota_servicos
2.0
CRAP 2.9
« TinyERP/NotaFiscalServicos.pm ↑ Summary
1 package Net::TinyERP;
2 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶use Net::TinyERP::NotaFiscal;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 3 ▶use Net::TinyERP::NotaFiscalServicos;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 3 our $VERSION = '0.09';
8  
9 6 ▶sub new {
Subroutine new: called CC=5 SCAR=16.6
Pod undocumented
10 6 my ($class, @params) = @_;
11 6 ▶ die 'Net::TinyERP->new() precisa do argumento "token"' unless @params;
Branch: 1 branch
BranchTrueFalseTotal
unless @params 1 5 6
12 0 ▶ my %params = @params > 1 ? @params : %{$params[0]};
Branch: 1 branch
BranchTrueFalseTotal
@params > 1 ? : 5 0 5
13 my $self = {
14 token => $params{token} || die 'argumento "token" obrigatório',
15 5 ▶ api_version => $params{api_version} || '2.0',
Condition75%3/4
$params{'token'} || die(qq[argumento "token" obrigat\303\263rio], 'api_version', $params{'api_version'} || '2.0')
l!l
32
$params{'api_version'} || '2.0'
l!l
02
MC/DC100%1/1
$params{'token'} || die(qq[argumento "token" obrigat\303\263rio], 'api_version', $params{'api_version'} || '2.0')
$params{'token'}
MC/DC0%0/1
$params{'api_version'} || '2.0'
$params{'api_version'}
Truth table100%2/2
A
A= $params{'token'}
Aresult
11
00
Truth table50%1/2
A
A= $params{'api_version'}
Aresult
11
00
16 };
17 3 bless $self, $class;
18 }
19  
20 1 ▶sub nota_fiscal {
Subroutine nota_fiscal: called CC=2 SCAR=7.0
Pod documented
21 1 my ($self) = @_;
22 1 ▶ if (!exists $self->{_nf_obj}) {
Branch: 1 branch
BranchTrueFalseTotal
unless (exists $self->{"_nf_obj"}) 1 0 1
23 1 $self->{_nf_obj} = Net::TinyERP::NotaFiscal->new($self);
24 }
25 1 return $self->{_nf_obj};
26 }
27  
28 1 ▶sub nota_servicos {
Subroutine nota_servicos: called CC=2 SCAR=7.0
Pod documented
29 1 my ($self) = @_;
30 1 ▶ if (!exists $self->{_nfs_obj}) {
Branch: 1 branch
BranchTrueFalseTotal
unless (exists $self->{"_nfs_obj"}) 1 0 1
31 1 $self->{_nfs_obj} = Net::TinyERP::NotaFiscalServicos->new($self);
32 }
33 1 return $self->{_nfs_obj};
34 }
35  
36 3 1;
37 __END__
« TinyERP/NotaFiscalServicos.pm ↑ Summary