Code Duplication    Length = 10-15 lines in 2 locations

includes/specials/pagers/ContribsPager.php 1 location

@@ 216-225 (lines=10) @@
213
			# ignore local groups with the bot right
214
			# @todo FIXME: Global groups may have 'bot' rights
215
			$groupsWithBotPermission = User::getGroupsWithPermission( 'bot' );
216
			if ( count( $groupsWithBotPermission ) ) {
217
				$tables[] = 'user_groups';
218
				$condition[] = 'ug_group IS NULL';
219
				$join_conds['user_groups'] = [
220
					'LEFT JOIN', [
221
						'ug_user = rev_user',
222
						'ug_group' => $groupsWithBotPermission
223
					]
224
				];
225
			}
226
		} else {
227
			$uid = User::idFromName( $this->target );
228
			if ( $uid ) {

includes/specials/pagers/NewFilesPager.php 1 location

@@ 59-73 (lines=15) @@
56
		$fields = [ 'img_name', 'img_user', 'img_timestamp' ];
57
		$options = [];
58
59
		if ( !$this->showBots ) {
60
			$groupsWithBotPermission = User::getGroupsWithPermission( 'bot' );
61
62
			if ( count( $groupsWithBotPermission ) ) {
63
				$tables[] = 'user_groups';
64
				$conds[] = 'ug_group IS NULL';
65
				$jconds['user_groups'] = [
66
					'LEFT JOIN',
67
					[
68
						'ug_group' => $groupsWithBotPermission,
69
						'ug_user = img_user'
70
					]
71
				];
72
			}
73
		}
74
75
		if ( $this->hidePatrolled ) {
76
			$tables[] = 'recentchanges';