Code Duplication    Length = 9-9 lines in 2 locations

lib/private/legacy/helper.php 2 locations

@@ 606-614 (lines=9) @@
603
		} else {
604
			$total = $free; //either unknown or unlimited
605
		}
606
		if ($total > 0) {
607
			if ($quota > 0 && $total > $quota) {
608
				$total = $quota;
609
			}
610
			// prevent division by zero or error codes (negative values)
611
			$relative = round(($used / $total) * 10000) / 100;
612
		} else {
613
			$relative = 0;
614
		}
615
616
		$ownerId = $storage->getOwner($path);
617
		$ownerDisplayName = '';
@@ 651-659 (lines=9) @@
648
		$total = $quota;
649
		$free = $quota - $used;
650
651
		if ($total > 0) {
652
			if ($quota > 0 && $total > $quota) {
653
				$total = $quota;
654
			}
655
			// prevent division by zero or error codes (negative values)
656
			$relative = round(($used / $total) * 10000) / 100;
657
		} else {
658
			$relative = 0;
659
		}
660
661
		return array('free' => $free, 'used' => $used, 'total' => $total, 'relative' => $relative);
662