pixelfed/pixelfed

View on GitHub
app/Http/Controllers/Admin/AdminAutospamController.php

Summary

Maintainability
A
2 hrs
Test Coverage

Method getAutospamConfigApi has 61 lines of code (exceeds 25 allowed). Consider refactoring.
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();
        });
Severity: Major
Found in app/Http/Controllers/Admin/AdminAutospamController.php - About 2 hrs to fix

    Avoid too many return statements within this method.
    Open

            return [
                'autospam_enabled' => (bool) config_cache('pixelfed.bouncer.enabled') ?? false,
                'nlp_enabled' => (bool) AutospamService::active(),
                'files' => $files,
                'open' => $open,
    Severity: Major
    Found in app/Http/Controllers/Admin/AdminAutospamController.php - About 30 mins to fix

      There are no issues that match your filters.

      Category
      Status