Code Duplication    Length = 9-9 lines in 2 locations

lib/private/helper.php 2 locations

@@ 639-647 (lines=9) @@
636
		} else {
637
			$total = $free; //either unknown or unlimited
638
		}
639
		if ($total > 0) {
640
			if ($quota > 0 && $total > $quota) {
641
				$total = $quota;
642
			}
643
			// prevent division by zero or error codes (negative values)
644
			$relative = round(($used / $total) * 10000) / 100;
645
		} else {
646
			$relative = 0;
647
		}
648
649
		$ownerId = $storage->getOwner($path);
650
		$ownerDisplayName = '';
@@ 684-692 (lines=9) @@
681
		$total = $quota;
682
		$free = $quota - $used;
683
684
		if ($total > 0) {
685
			if ($quota > 0 && $total > $quota) {
686
				$total = $quota;
687
			}
688
			// prevent division by zero or error codes (negative values)
689
			$relative = round(($used / $total) * 10000) / 100;
690
		} else {
691
			$relative = 0;
692
		}
693
694
		return array('free' => $free, 'used' => $used, 'total' => $total, 'relative' => $relative);
695