App/Command/config.pm

filter: Statementstmt 54.1% 13 / 24 Branchbran 0.0% 0 / 10 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 66.6% 4 / 6 Podpod 100% 2 / 2 totaltotal 40.4% 19 / 47 CC 7 SCAR 35.0
CC
7
Cov
35%
validate_args
56.0
execute
2.0
BEGIN
1.0
CRAP 33.2
« App/DocumentExportApi.pm ↑ Summary App/ProjectApi.pm »
1 # ABSTRACT: show/edit config file
2 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 package Smartcat::App::Command::config;
6 2 ▶use Smartcat::App -command;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 2 ▶use File::Basename;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 0 ▶sub validate_args {
Subroutine validate_args: not called CC=7 SCAR=40.3
Pod documented
11 0 my ( $self, $opt, $args ) = @_;
12  
13 0 my $app = $self->app;
14  
15 0 ▶ $app->{config}->{username} = $opt->{token_id} if defined $opt->{token_id};
Branch: 1 branch
BranchTrueFalseTotal
if defined $opt->{"token_id"} 0 0 0
16 0 ▶ $app->{config}->{password} = $opt->{token} if defined $opt->{token};
Branch: 1 branch
BranchTrueFalseTotal
if defined $opt->{"token"} 0 0 0
17 0 ▶ $app->{config}->{base_url} = $opt->{base_url} if defined $opt->{base_url};
Branch: 1 branch
BranchTrueFalseTotal
if defined $opt->{"base_url"} 0 0 0
18  
19 0 ▶ if ( defined $opt->{log} ) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $opt->{"log"}) 0 0 0
20 $self->usage_error(
21 "directory of 'log', which is set to '$opt->{log}', does not point to a valid directory"
22 0 ▶ ) unless -d dirname( $opt->{log} ) && -w _;
Branch: 1 branch
BranchTrueFalseTotal
unless -d dirname($opt->{"log"}) and -w _ 0 0 0
Condition0%0/3
-d dirname($opt->{"log"}) and -w _
!ll&&!rl&&r
000
MC/DC0%0/2
-d dirname($opt->{"log"}) and -w _
-d dirname($opt->{"log"}) -w _
Truth table0%0/3
A and B
A= -d dirname($opt->{"log"})B= -w _
ABresult
0X0
100
111
23 0 $app->{config}->{log} = $opt->{log};
24 }
25  
26 0 $app->{config}->save;
27 }
28  
29 0 ▶sub execute {
Subroutine execute: not called CC=1 SCAR=6.9
Pod documented
30 0 my ( $self, $opt, $args ) = @_;
31  
32 0 my $app = $self->app->{config}->cat;
33 }
34  
35 2 1;
« App/DocumentExportApi.pm ↑ Summary App/ProjectApi.pm »