isProblematicSite method

bool isProblematicSite(
  1. String url
)

Checks if a site is problematic based on its reputation

Implementation

bool isProblematicSite(String url) {
  final domain = _extractDomain(url);
  if (domain == null) return false;

  // If we have reputation data, use it
  if (_siteReputations.containsKey(domain)) {
    final reputation = _siteReputations[domain]!;

    // Sites with low success rates are problematic
    if (reputation.successRate < 0.5 && reputation.totalAttempts >= 3) {
      return true;
    }

    // Sites with specific error patterns are problematic
    if (reputation.hasProblematicErrors) {
      return true;
    }
  }

  // Check for known problematic patterns in the URL
  if (url.contains('443') || url.contains(':443')) {
    return true; // Port 443 often has issues
  }

  return false;
}