Code Duplication    Length = 9-9 lines in 2 locations

lib/private/legacy/helper.php 2 locations

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