Code Duplication    Length = 21-21 lines in 2 locations

apps/federatedfilesharing/lib/FederatedShareProvider.php 2 locations

@@ 579-599 (lines=21) @@
576
			/**
577
			 * Reshares for this user are shares where they are the owner.
578
			 */
579
			if ($reshares === false) {
580
				//Special case for old shares created via the web UI
581
				$or1 = $qb->expr()->andX(
582
					$qb->expr()->eq('uid_owner', $qb->createNamedParameter($userId)),
583
					$qb->expr()->isNull('uid_initiator')
584
				);
585
586
				$qb->andWhere(
587
					$qb->expr()->orX(
588
						$qb->expr()->eq('uid_initiator', $qb->createNamedParameter($userId)),
589
						$or1
590
					)
591
				);
592
			} else {
593
				$qb->andWhere(
594
					$qb->expr()->orX(
595
						$qb->expr()->eq('uid_owner', $qb->createNamedParameter($userId)),
596
						$qb->expr()->eq('uid_initiator', $qb->createNamedParameter($userId))
597
					)
598
				);
599
			}
600
601
			$qb->andWhere($qb->expr()->in('file_source', $qb->createParameter('file_source_ids')));
602
			$qb->setParameter('file_source_ids', $nodeIdsChunk, IQueryBuilder::PARAM_INT_ARRAY);
@@ 629-649 (lines=21) @@
626
		/**
627
		 * Reshares for this user are shares where they are the owner.
628
		 */
629
		if ($reshares === false) {
630
			//Special case for old shares created via the web UI
631
			$or1 = $qb->expr()->andX(
632
				$qb->expr()->eq('uid_owner', $qb->createNamedParameter($userId)),
633
				$qb->expr()->isNull('uid_initiator')
634
			);
635
636
			$qb->andWhere(
637
				$qb->expr()->orX(
638
					$qb->expr()->eq('uid_initiator', $qb->createNamedParameter($userId)),
639
					$or1
640
				)
641
			);
642
		} else {
643
			$qb->andWhere(
644
				$qb->expr()->orX(
645
					$qb->expr()->eq('uid_owner', $qb->createNamedParameter($userId)),
646
					$qb->expr()->eq('uid_initiator', $qb->createNamedParameter($userId))
647
				)
648
			);
649
		}
650
651
		if ($node !== null) {
652
			$qb->andWhere($qb->expr()->eq('file_source', $qb->createNamedParameter($node->getId())));