File: ConditionalImplicitReturn.run

package info (click to toggle)
libperl-critic-community-perl 1.0.4-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 428 kB
  • sloc: perl: 1,100; makefile: 2
file content (29 lines) | stat: -rw-r--r-- 502 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
## name ImplicitConditional
## failures 1
## cut

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

## name ImplicitConditionalNoReturn
## failures 0
## cut

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

## name NotLastStatement
## failures 0
## cut

sub foo { if ($foo) { return 1 } return 0 }

## name ConditionalWithElsif
## failures 1
## cut

sub foo { if ($foo) { return 1 } elsif ($bar) { return 0 } }

## name ConditionalWithElse
## failures 0
## cut

sub foo { if ($foo) { return 1 } else { return 0 } }