File: EmptyReturn.run

package info (click to toggle)
libperl-critic-freenode-perl 0.028-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 416 kB
  • sloc: perl: 986; makefile: 2
file content (65 lines) | stat: -rw-r--r-- 981 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
## name EmptyReturn
## failures 1
## cut

sub foo { return; return $foo; }

## name BareReturn
## failures 1
## cut

sub foo { return $foo; return }

## name ReturnEmptyList
## failures 0
## cut

sub foo { return (); return ($foo, $bar); }

## name ReturnScalar
## failures 0
## cut

sub foo { return undef; return $foo; }

## name ReturnList
## failures 0
## cut

sub foo { return 1, 2, 3; return $foo; }

## name ReturnModified
## failures 1
## cut

sub foo { return if bar(); return $foo; }

## name ReturnMidStatement
## failures 1
## cut

sub foo { bar() or return; return $foo; }

## name OnlyEmptyReturn
## failures 0
## cut

sub foo { return if bar(); return; }

## name ReturnInStructure
## failures 1
## cut

sub foo { return if bar(); if (1) { return $foo } }

## name OnlyEmptyReturnInStructure
## failures 0
## cut

sub foo { return if bar(); if (1) { return } }

## name ReturnInCode
## failures 0
## cut

sub foo { return if bar(); my $code = sub { return $foo }; }