Code Duplication    Length = 21-21 lines in 2 locations

apps/federatedfilesharing/lib/FederatedShareProvider.php 2 locations

@@ 589-609 (lines=21) @@
586
			/**
587
			 * Reshares for this user are shares where they are the owner.
588
			 */
589
			if ($reshares === false) {
590
				//Special case for old shares created via the web UI
591
				$or1 = $qb->expr()->andX(
592
					$qb->expr()->eq('uid_owner', $qb->createNamedParameter($userId)),
593
					$qb->expr()->isNull('uid_initiator')
594
				);
595
596
				$qb->andWhere(
597
					$qb->expr()->orX(
598
						$qb->expr()->eq('uid_initiator', $qb->createNamedParameter($userId)),
599
						$or1
600
					)
601
				);
602
			} else {
603
				$qb->andWhere(
604
					$qb->expr()->orX(
605
						$qb->expr()->eq('uid_owner', $qb->createNamedParameter($userId)),
606
						$qb->expr()->eq('uid_initiator', $qb->createNamedParameter($userId))
607
					)
608
				);
609
			}
610
611
			$qb->andWhere($qb->expr()->in('file_source', $qb->createParameter('file_source_ids')));
612
			$qb->setParameter('file_source_ids', $nodeIdsChunk, IQueryBuilder::PARAM_INT_ARRAY);
@@ 639-659 (lines=21) @@
636
		/**
637
		 * Reshares for this user are shares where they are the owner.
638
		 */
639
		if ($reshares === false) {
640
			//Special case for old shares created via the web UI
641
			$or1 = $qb->expr()->andX(
642
				$qb->expr()->eq('uid_owner', $qb->createNamedParameter($userId)),
643
				$qb->expr()->isNull('uid_initiator')
644
			);
645
646
			$qb->andWhere(
647
				$qb->expr()->orX(
648
					$qb->expr()->eq('uid_initiator', $qb->createNamedParameter($userId)),
649
					$or1
650
				)
651
			);
652
		} else {
653
			$qb->andWhere(
654
				$qb->expr()->orX(
655
					$qb->expr()->eq('uid_owner', $qb->createNamedParameter($userId)),
656
					$qb->expr()->eq('uid_initiator', $qb->createNamedParameter($userId))
657
				)
658
			);
659
		}
660
661
		if ($node !== null) {
662
			$qb->andWhere($qb->expr()->eq('file_source', $qb->createNamedParameter($node->getId())));