---
source: crates/ruff_linter/src/rules/flake8_simplify/mod.rs
---
SIM116.py:5:1: SIM116 Use a dictionary instead of consecutive `if` statements
   |
 4 |   # SIM116
 5 | / if a == "foo":
 6 | |     return "bar"
 7 | | elif a == "bar":
 8 | |     return "baz"
 9 | | elif a == "boo":
10 | |     return "ooh"
11 | | else:
12 | |     return 42
   | |_____________^ SIM116
13 |   
14 |   # SIM116
   |

SIM116.py:15:1: SIM116 Use a dictionary instead of consecutive `if` statements
   |
14 |   # SIM116
15 | / if a == 1:
16 | |     return (1, 2, 3)
17 | | elif a == 2:
18 | |     return (4, 5, 6)
19 | | elif a == 3:
20 | |     return (7, 8, 9)
21 | | else:
22 | |     return (10, 11, 12)
   | |_______________________^ SIM116
23 |   
24 |   # SIM116
   |

SIM116.py:25:1: SIM116 Use a dictionary instead of consecutive `if` statements
   |
24 |   # SIM116
25 | / if a == 1:
26 | |     return (1, 2, 3)
27 | | elif a == 2:
28 | |     return (4, 5, 6)
29 | | elif a == 3:
30 | |     return (7, 8, 9)
   | |____________________^ SIM116
31 |   
32 |   # SIM116
   |

SIM116.py:33:1: SIM116 Use a dictionary instead of consecutive `if` statements
   |
32 |   # SIM116
33 | / if a == "hello 'sir'":
34 | |     return (1, 2, 3)
35 | | elif a == 'goodbye "mam"':
36 | |     return (4, 5, 6)
37 | | elif a == """Fairwell 'mister'""":
38 | |     return (7, 8, 9)
39 | | else:
40 | |     return (10, 11, 12)
   | |_______________________^ SIM116
41 |   
42 |   # SIM116
   |

SIM116.py:43:1: SIM116 Use a dictionary instead of consecutive `if` statements
   |
42 |   # SIM116
43 | / if a == b"one":
44 | |     return 1
45 | | elif a == b"two":
46 | |     return 2
47 | | elif a == b"three":
48 | |     return 3
   | |____________^ SIM116
49 |   
50 |   # SIM116
   |

SIM116.py:51:1: SIM116 Use a dictionary instead of consecutive `if` statements
   |
50 |   # SIM116
51 | / if a == "hello 'sir'":
52 | |     return ("hello'", 'hi"', 3)
53 | | elif a == 'goodbye "mam"':
54 | |     return (4, 5, 6)
55 | | elif a == """Fairwell 'mister'""":
56 | |     return (7, 8, 9)
57 | | else:
58 | |     return (10, 11, 12)
   | |_______________________^ SIM116
59 |   
60 |   # OK
   |

SIM116.py:79:1: SIM116 Use a dictionary instead of consecutive `if` statements
   |
78 |   # SIM116
79 | / if func_name == "create":
80 | |     return "A"
81 | | elif func_name == "modify":
82 | |     return "M"
83 | | elif func_name == "remove":
84 | |     return "D"
85 | | elif func_name == "move":
86 | |     return "MV"
   | |_______________^ SIM116
87 |   
88 |   # OK
   |


