Spaces:
Build error
Build error
Upload test_example.py
Browse files- test_example.py +29 -0
test_example.py
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# This function is long and has too many parameters
|
| 2 |
+
def too_many_params_and_long(a, b, c, d, e, f, g):
|
| 3 |
+
x = a + b
|
| 4 |
+
y = c + d
|
| 5 |
+
z = e + f
|
| 6 |
+
total = x + y + z + g
|
| 7 |
+
print("Step 1")
|
| 8 |
+
print("Step 2")
|
| 9 |
+
print("Step 3")
|
| 10 |
+
print("Step 4")
|
| 11 |
+
print("Step 5")
|
| 12 |
+
print("Step 6")
|
| 13 |
+
print("Step 7")
|
| 14 |
+
return total
|
| 15 |
+
|
| 16 |
+
# A small, clean function (should be fine)
|
| 17 |
+
def add(a, b):
|
| 18 |
+
return a + b
|
| 19 |
+
|
| 20 |
+
# Duplicated code block starts here
|
| 21 |
+
def example_one():
|
| 22 |
+
print("Loading data...")
|
| 23 |
+
print("Processing data...")
|
| 24 |
+
print("Saving results...")
|
| 25 |
+
|
| 26 |
+
def example_two():
|
| 27 |
+
print("Loading data...")
|
| 28 |
+
print("Processing data...")
|
| 29 |
+
print("Saving results...")
|