TileMap/Role/Checks.pm

filter: Statementstmt 100% 20 / 20 Branchbran n/a Conditioncond 100% 9 / 9 MC/DCmcdc 100% 5 / 5 Subroutinesub 100% 6 / 6 Podpod 0.0% 0 / 2 totaltotal 95.2% 40 / 42 CC 4 SCAR 6.4
CC
4
Cov
100%
check_can_be_accessed
3.0
check_within_map
2.0
BEGIN
1.0
CRAP 1.9
« TileMap.pm ↑ Summary TileMap/Legend.pm »
1 package Game::TileMap::Role::Checks;
2 4 $Game::TileMap::Role::Checks::VERSION = '1.001';
3 4 ▶use v5.10;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 4 ▶use Mooish::Base -stardard, -role;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 4 requires qw(
10 get_tile
11 );
12  
13 sub check_within_map
14 15 ▶{
Subroutine check_within_map: called CC=2 SCAR=6.9
Pod undocumented
15 15 my ($self, $x, $y) = @_;
16  
17 15 my $obj = $self->get_tile($x, $y);
18 15 ▶ return $obj && !$obj->is_wall;
Condition100%3/3
$obj && !$obj->is_wall
!ll&&!rl&&r
636
MC/DC100%2/2
$obj && !$obj->is_wall
$obj !$obj->is_wall
Truth table100%3/3
A && not(B)
A= $objB= !$obj->is_wall
ABresult
0X0
100
111
19 }
20  
21 sub check_can_be_accessed
22 13 ▶{
Subroutine check_can_be_accessed: called CC=3 SCAR=11.0
Pod undocumented
23 13 my ($self, $x, $y) = @_;
24  
25 13 my $obj = $self->get_tile($x, $y);
26 13 ▶ return $obj && !$obj->is_wall && !$obj->is_void;
Condition100%6/6
$obj && !$obj->is_wall && !$obj->is_void
!ll&&!rl&&r
733
$obj and not $obj->is_wall
!ll&&!rl&&r
436
MC/DC100%3/3
$obj && !$obj->is_wall && !$obj->is_void
$obj not $obj->is_wall !$obj->is_void
Truth table100%4/4
A and not(B) && not(C)
A= $objB= not $obj->is_wallC= !$obj->is_void
ABCresult
0XX0
10X0
1100
1111
27 }
28  
29 4 1;
30  
« TileMap.pm ↑ Summary TileMap/Legend.pm »