nopaste/Service/mathbin.pm

filter: Statementstmt 35.7% 5 / 14 Branchbran 0.0% 0 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 1 / 2 Podpod 0.0% 0 / 1 totaltotal 24.0% 6 / 25 CC 5 SCAR 32.3
CC
5
Cov
23%
paste
30.0
BEGIN
1.0
CRAP 25.2
« nopaste/Service/fpaste.pm ↑ Summary nopaste/Service.pm »
1 package Mojolicious::Command::nopaste::Service::mathbin;
2 1 ▶use Mojo::Base 'Mojolicious::Command::nopaste::Service';
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 1 has description => "Post to mathb.in\n";
5  
6 0 ▶sub paste {
Subroutine paste: not called CC=5 SCAR=34.0
Pod undocumented
7 0 my $self = shift;
8  
9 0 my $name = $self->name;
10 0 my $title = $self->desc;
11  
12 0 ▶ my $tx = $self->ua->post( 'http://mathb.in' => form => {
Branch: 3 branches
BranchTrueFalseTotal
$name ? : 0 0 0
$self->private ? : 0 0 0
$title ? : 0 0 0
13 code => $self->text,
14 ( $name ? ( name => $name ) : () ),
15 secrecy => $self->private ? 'yes' : '',
16 ( $title ? ( title => $title ) : () ),
17 });
18  
19 0 ▶ unless ($tx->res->is_success) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($tx->res->is_success) 0 0 0
20 0 say $tx->res->message;
21 0 say $tx->res->body;
22 0 exit 1;
23 }
24  
25 0 return $tx->req->url;
26 }
27  
28 1 1;
29  
« nopaste/Service/fpaste.pm ↑ Summary nopaste/Service.pm »