BackpackTF/Item.pm

filter: Statementstmt 47.6% 10 / 21 Branchbran 0.0% 0 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 42.8% 3 / 7 Podpod 75.0% 3 / 4 totaltotal 40.0% 16 / 40 SCAR 24.9
CC
5
Cov
34%
price
20.0
defindex
6.0
new
2.0
CRAP 12.0
« BackpackTF/User.pm ↑ Summary BackpackTF.pm »
1 package WWW::BackpackTF::Item;
2  
3 2 ▶use 5.014000;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 our $VERSION = '0.002';
7  
8 sub new{
9 0 ▶ my ($class, $name, $content) = @_;
Subroutine new: not called CC=1 SCAR=6.9
Pod undocumented
10 0 $content->{name} = $name;
11 0 bless $content, $class
12 }
13  
14 0 ▶sub name { shift->{name} }
Subroutine name: not called CC=1 SCAR=6.9
Pod documented
15 0 ▶sub defindex { wantarray ? @{shift->{defindex}} : shift->{defindex}->[0] }
Subroutine defindex: not called CC=2 SCAR=17.9
Pod documented
Branch: 1 branch
BranchTrueFalseTotal
wantarray ? : 0 0 0
16 sub price {
17 0 ▶ my ($self, $quality, $tradable, $craftable, $priceindex) = (@_, 6, 1, 1);
Subroutine price: not called CC=4 SCAR=30.0
Pod documented
18 0 ▶ $tradable = $tradable ? 'Tradable' : 'Non-Tradable';
Branch: 1 branch
BranchTrueFalseTotal
$tradable ? : 0 0 0
19 0 ▶ $craftable = $craftable ? 'Craftable' : 'Non-Craftable';
Branch: 1 branch
BranchTrueFalseTotal
$craftable ? : 0 0 0
20 0 my $price = shift->{prices}->{$quality}->{$tradable}->{$craftable};
21 0 ▶ defined $priceindex ? $price->{$priceindex} : $price->[0]
Branch: 1 branch
BranchTrueFalseTotal
defined $priceindex ? : 0 0 0
22 }
23  
24 2 1;
25 __END__
« BackpackTF/User.pm ↑ Summary BackpackTF.pm »