Code Duplication    Length = 9-9 lines in 2 locations

lib/private/helper.php 2 locations

@@ 956-964 (lines=9) @@
953
		} else {
954
			$total = $free; //either unknown or unlimited
955
		}
956
		if ($total > 0) {
957
			if ($quota > 0 && $total > $quota) {
958
				$total = $quota;
959
			}
960
			// prevent division by zero or error codes (negative values)
961
			$relative = round(($used / $total) * 10000) / 100;
962
		} else {
963
			$relative = 0;
964
		}
965
966
		return array('free' => $free, 'used' => $used, 'total' => $total, 'relative' => $relative);
967
	}
@@ 986-994 (lines=9) @@
983
		$total = $quota;
984
		$free = $quota - $used;
985
986
		if ($total > 0) {
987
			if ($quota > 0 && $total > $quota) {
988
				$total = $quota;
989
			}
990
			// prevent division by zero or error codes (negative values)
991
			$relative = round(($used / $total) * 10000) / 100;
992
		} else {
993
			$relative = 0;
994
		}
995
996
		return array('free' => $free, 'used' => $used, 'total' => $total, 'relative' => $relative);
997