Code Duplication    Length = 9-9 lines in 2 locations

lib/private/legacy/helper.php 2 locations

@@ 621-629 (lines=9) @@
618
		} else {
619
			$total = $free; //either unknown or unlimited
620
		}
621
		if ($total > 0) {
622
			if ($quota > 0 && $total > $quota) {
623
				$total = $quota;
624
			}
625
			// prevent division by zero or error codes (negative values)
626
			$relative = round(($used / $total) * 10000) / 100;
627
		} else {
628
			$relative = 0;
629
		}
630
631
		$ownerId = $storage->getOwner($path);
632
		$ownerDisplayName = '';
@@ 666-674 (lines=9) @@
663
		$total = $quota;
664
		$free = $quota - $used;
665
666
		if ($total > 0) {
667
			if ($quota > 0 && $total > $quota) {
668
				$total = $quota;
669
			}
670
			// prevent division by zero or error codes (negative values)
671
			$relative = round(($used / $total) * 10000) / 100;
672
		} else {
673
			$relative = 0;
674
		}
675
676
		return array('free' => $free, 'used' => $used, 'total' => $total, 'relative' => $relative);
677