Code Duplication    Length = 9-9 lines in 2 locations

lib/private/legacy/helper.php 2 locations

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