• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Freegle / Iznik / 11342

08 May 2026 02:47PM UTC coverage: 68.97% (-3.8%) from 72.761%
11342

push

circleci

web-flow
Merge pull request #403 from Freegle/feature/exports-migration

feat(batch): migrate exports.php to users:process-exports

9127 of 10554 branches covered (86.48%)

Branch coverage included in aggregate %.

400 of 452 new or added lines in 2 files covered. (88.5%)

12172 existing lines in 167 files now uncovered.

100855 of 148909 relevant lines covered (67.73%)

19.62 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

27.78
/iznik-batch/app/Console/Commands/Group/UpdateStatsCommand.php
1
<?php
2

3
namespace App\Console\Commands\Group;
4

5
use App\Services\GroupStatsService;
6
use Illuminate\Console\Command;
7
use Illuminate\Support\Facades\Log;
8

9
class UpdateStatsCommand extends Command
10
{
11
    protected $signature = 'groups:update-stats
12
                            {--dry-run : Show what would be updated without making changes}';
13

14
    protected $description = 'Update group stats: repost settings, polyindex, activity/funding, moderation counts, and stats_outcomes';
15

16
    public function handle(GroupStatsService $service): int
1✔
17
    {
18
        $dryRun = (bool) $this->option('dry-run');
1✔
19

20
        if ($dryRun) {
1✔
21
            $this->info('Dry run — scanning groups but not writing.');
1✔
22
        } else {
23
            Log::info('Starting group stats update');
×
24
        }
25

26
        $result = $service->updateGroupStats($dryRun);
1✔
27

28
        $verb = $dryRun ? 'Would update' : 'Updated';
×
UNCOV
29
        $this->info("{$verb}:");
×
30
        $this->line(sprintf('  reposts_fixed:            %d', $result['reposts_fixed']));
×
UNCOV
31
        $this->line(sprintf('  polyindex_fixed:          %d', $result['polyindex_fixed']));
×
UNCOV
32
        $this->line(sprintf('  activity_updated:         %d (groups)', $result['activity_updated']));
×
UNCOV
33
        $this->line(sprintf('  last_moderated_updated:   %d (groups)', $result['last_moderated_updated']));
×
UNCOV
34
        $this->line(sprintf('  last_autoapprove_updated: %d (groups, only those with logs)', $result['last_autoapprove_updated']));
×
UNCOV
35
        $this->line(sprintf('  mod_counts_updated:       %d (groups)', $result['mod_counts_updated']));
×
UNCOV
36
        $this->line(sprintf('  stats_outcomes_updated:   %d', $result['stats_outcomes_updated']));
×
37

UNCOV
38
        if (!$dryRun) {
×
UNCOV
39
            Log::info('Group stats update complete', $result);
×
40
        }
41

UNCOV
42
        return Command::SUCCESS;
×
43
    }
44
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc