Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -60,9 +60,9 @@ class CodeCopilot:
|
|
| 60 |
def generate_suggestions(self, patterns):
|
| 61 |
"""Generate suggestions based on detected patterns"""
|
| 62 |
suggestions = []
|
| 63 |
-
if patterns['function_def']
|
| 64 |
suggestions.append("๐ Consider breaking down into smaller functions or using a class structure.")
|
| 65 |
-
if patterns['loop']
|
| 66 |
suggestions.append("๐ You might benefit from list comprehensions or map/filter functions.")
|
| 67 |
if patterns['conditional'] > 3:
|
| 68 |
suggestions.append("โ Complex conditionals might be simplified using polymorphism or strategy pattern.")
|
|
|
|
| 60 |
def generate_suggestions(self, patterns):
|
| 61 |
"""Generate suggestions based on detected patterns"""
|
| 62 |
suggestions = []
|
| 63 |
+
if patterns['function_def'] >= 1:
|
| 64 |
suggestions.append("๐ Consider breaking down into smaller functions or using a class structure.")
|
| 65 |
+
if patterns['loop'] >= 2:
|
| 66 |
suggestions.append("๐ You might benefit from list comprehensions or map/filter functions.")
|
| 67 |
if patterns['conditional'] > 3:
|
| 68 |
suggestions.append("โ Complex conditionals might be simplified using polymorphism or strategy pattern.")
|