Code Duplication    Length = 9-9 lines in 2 locations

lib/private/legacy/helper.php 2 locations

@@ 559-567 (lines=9) @@
556
		} else {
557
			$total = $free; //either unknown or unlimited
558
		}
559
		if ($total > 0) {
560
			if ($quota > 0 && $total > $quota) {
561
				$total = $quota;
562
			}
563
			// prevent division by zero or error codes (negative values)
564
			$relative = round(($used / $total) * 10000) / 100;
565
		} else {
566
			$relative = 0;
567
		}
568
569
		$ownerId = $storage->getOwner($path);
570
		$ownerDisplayName = '';
@@ 604-612 (lines=9) @@
601
		$total = $quota;
602
		$free = $quota - $used;
603
604
		if ($total > 0) {
605
			if ($quota > 0 && $total > $quota) {
606
				$total = $quota;
607
			}
608
			// prevent division by zero or error codes (negative values)
609
			$relative = round(($used / $total) * 10000) / 100;
610
		} else {
611
			$relative = 0;
612
		}
613
614
		return array('free' => $free, 'used' => $used, 'total' => $total, 'relative' => $relative);
615