app/Http/Controllers/Admin/AdminAutospamController.php
Method getAutospamConfigApi
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getAutospamConfigApi(Request $request)
{
$open = Cache::remember('admin-dash:reports:spam-count', 3600, function() {
return AccountInterstitial::whereType('post.autospam')->whereNull('appeal_handled_at')->count();
});
Avoid too many return
statements within this method. Open
Open
return [
'autospam_enabled' => (bool) config_cache('pixelfed.bouncer.enabled') ?? false,
'nlp_enabled' => (bool) AutospamService::active(),
'files' => $files,
'open' => $open,