You can customize the number of AI-generated suggestions for your pull requests by adjusting the threshold setting.

Setting the Threshold

Navigate to Settings -> AI Code Review -> PR Suggestions threshold to configure how many suggestions you receive. You can access this setting directly at: https://app.codeant.ai/settings/prconfsettings PR Suggestions Threshold Setting

How Threshold Affects Suggestions

  • Lower threshold: More suggestions, including minor improvements and style recommendations
  • Higher threshold: Fewer suggestions, focusing only on critical issues

Suppressed Suggestions at Higher Thresholds

When you set a higher threshold, the following types of suggestions will be suppressed:
  • Minor style and formatting improvements
  • Non-critical code optimizations
  • Subjective refactoring recommendations
  • Documentation suggestions for obvious code
  • Variable naming improvements for clear names
  • Minor performance enhancements with negligible impact
Only high-priority suggestions like security vulnerabilities, logical errors, and significant bugs will be shown at higher threshold levels.

Example Code Suggestions

High Priority (Shown at Higher Thresholds)

Security vulnerability - SQL injection risk:
# Problematic code
def get_user(user_id):
    query = f"SELECT * FROM users WHERE id = {user_id}"
    return execute_query(query)

# Suggested fix
def get_user(user_id):
    query = "SELECT * FROM users WHERE id = %s"
    return execute_query(query, (user_id,))

Low Priority (Suppressed at Higher Thresholds)

Minor style improvement:
# Current code
def calculate_total(items):
    total = 0
    for item in items:
        total += item.price
    return total

# Suggested improvement
def calculate_total(items):
    return sum(item.price for item in items)