Code Duplication    Length = 5-5 lines in 2 locations

lib/private/Settings/Personal/PersonalInfo.php 1 location

@@ 103-107 (lines=5) @@
100
		$userData = $this->accountManager->getUser($user);
101
102
		$storageInfo = \OC_Helper::getStorageInfo('/');
103
		if ($storageInfo['quota'] === FileInfo::SPACE_UNLIMITED) {
104
			$totalSpace = $this->l->t('Unlimited');
105
		} else {
106
			$totalSpace = \OC_Helper::humanFileSize($storageInfo['total']);
107
		}
108
109
		$languageParameters = $this->getLanguages($user);
110
		$localeParameters = $this->getLocales($user);

apps/files/lib/Controller/ViewController.php 1 location

@@ 214-218 (lines=5) @@
211
		$nav->assign('navigationItems', $navItems);
212
213
		$nav->assign('usage', \OC_Helper::humanFileSize($storageInfo['used']));
214
		if ($storageInfo['quota'] === \OCP\Files\FileInfo::SPACE_UNLIMITED) {
215
			$totalSpace = $this->l10n->t('Unlimited');
216
		} else {
217
			$totalSpace = \OC_Helper::humanFileSize($storageInfo['total']);
218
		}
219
		$nav->assign('total_space', $totalSpace);
220
		$nav->assign('quota', $storageInfo['quota']);
221
		$nav->assign('usage_relative', $storageInfo['relative']);