Formula/Config.pm

filter: Statementstmt 60.7% 17 / 28 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 45.4% 5 / 11 Podpod 83.3% 5 / 6 totaltotal 55.1% 27 / 49 SCAR 13.7
CC
3
Cov
53%
init
12.0
new
2.0
directory
2.0
CRAP 3.9
« Formula/Token.pm ↑ Summary
1 # Copyrights 2023 by [Mark Overmeer <markov@cpan.org>].
2 # For other contributors see ChangeLog.
3 # See the manual pages for details on the licensing terms.
4 # Pod stripped from pm file by OODoc 2.03.
5 package Math::Formula::Config;
6 1 ▶use vars '$VERSION';
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 $VERSION = '0.16';
8  
9  
10 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
12
13 1 ▶use File::Spec ();
Subroutine BEGIN: called CC=1 SCAR=0.0
14 1 ▶use Log::Report 'math-formula';
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16  
17 0 ▶sub new(%) { my $class = shift; (bless {}, $class)->init({@_}) }
Subroutine new: not called CC=1 SCAR=6.9
Pod documented
18  
19 sub init($)
20 0 ▶{ my ($self, $args) = @_;
Subroutine init: not called CC=3 SCAR=24.8
Pod undocumented
21 my $dir = $self->{MFC_dir} = $args->{directory}
22 0 ▶ or error __x"Save directory required";
Branch: 1 branch
BranchTrueFalseTotal
my $dir = $self->{"MFC_dir"} = $args->{"directory"} or &error(&__x("Save directory required")) 0 0 0
23  
24 0 ▶ -d $dir
Branch: 1 branch
BranchTrueFalseTotal
-d $dir or &error(&__x("Save directory '{dir}' does not exist", "dir", $dir)) 0 0 0
25 or error __x"Save directory '{dir}' does not exist", dir => $dir;
26  
27 0 $self;
28 }
29  
30 #----------------------
31  
32 0 ▶sub directory { $_[0]->{MFC_dir} }
Subroutine directory: not called CC=1 SCAR=6.9
Pod documented
33  
34  
35 sub path_for($$)
36 0 ▶{ my ($self, $file) = @_;
Subroutine path_for: not called CC=1 SCAR=6.9
Pod documented
37 0 File::Spec->catfile($self->directory, $file);
38 }
39  
40 #----------------------
41  
42 0 ▶sub save($%) { die "Save under construction" }
Subroutine save: not called CC=1 SCAR=6.9
Pod documented
43  
44  
45 0 ▶sub load($%) { die "Load under construction" }
Subroutine load: not called CC=1 SCAR=6.9
Pod documented
46  
47 1 1;
« Formula/Token.pm ↑ Summary