File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # Missing copyright notice at the top of the file. (CPY rule violation)
2+
3+ import sys
4+ import os
5+
6+ def perform_calculations ( name ,age ):
7+ unused_variable = 100
8+
9+ # SIM (flake8-simplify) violation: Can directly 'return age >= 18'
10+ if age >= 18 :
11+ is_adult = True
12+ else :
13+ is_adult = False
14+
15+ # UP031 (printf-string-formatting) violation: Uses '%' formatting
16+ old_style_message = "Hello %s" % name
17+
18+ # UP032 (f-string) violation: Uses '.format()'
19+ format_method_message = "Your age: {}" .format (age )
20+
21+ # FLY (flynt) violation: Uses join() to concatenate static variables
22+ # Should use an f-string instead: f"{old_style_message} - {format_method_message}"
23+ result = " - " .join ([old_style_message , format_method_message ])
24+
25+ return result
You can’t perform that action at this time.
0 commit comments