Maker/CircularLadder.pm

filter: Statementstmt 100% 33 / 33 Branchbran 83.3% 5 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 8 / 8 Podpod 0.0% 0 / 1 totaltotal 95.8% 46 / 48 CC 4 SCAR 7.4
CC
4
Cov
97%
init
4.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.1
« Maker/Disconnected.pm ↑ Summary Maker/Hypercube.pm »
1 package Graph::Maker::CircularLadder;
2
3 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use Carp qw/croak/;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 ▶use base qw/Graph::Maker/;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 2 ▶use Graph;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 2 ▶use Graph::Maker;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 2 ▶use Graph::Maker::Ladder;
Subroutine BEGIN: called CC=1 SCAR=0.0
10
11 2 our $VERSION = '0.01';
12
13 sub init
14 2 ▶{
Subroutine init: called CC=4 SCAR=13.9
Pod undocumented
15 2 my ($self, %params) = @_;
16
17 2 my $r = $params{rungs};
18
19 2 my $g = new Graph::Maker('ladder', %params);
20
21 2 ▶ return if $r == 0;
Branch: 1 branch
BranchTrueFalseTotal
if $r == 0 0 2 2
22
23 2 $g->add_edge(1, $r);
24 2 ▶ $g->add_edge($r, 1) unless $g->is_undirected();
Branch: 1 branch
BranchTrueFalseTotal
unless $g->is_undirected 1 1 2
25 2 $g->add_edge($r+1, 2*$r);
26 2 ▶ $g->add_edge(2*$r, $r+1) unless $g->is_undirected();
Branch: 1 branch
BranchTrueFalseTotal
unless $g->is_undirected 1 1 2
27
28 2 return $g;
29 }
30
31 2 Graph::Maker->add_factory_type( 'circular_ladder' => __PACKAGE__ );
32
33 2 1;
34
35 __DATA__
« Maker/Disconnected.pm ↑ Summary Maker/Hypercube.pm »