Code Duplication    Length = 15-15 lines in 2 locations

code/control/DeployPlanDispatcher.php 1 location

@@ 226-240 (lines=15) @@
223
		// Add in a URL for comparing from->to code changes. Ensure that we have
224
		// two proper 40 character SHAs, otherwise we can't show the compare link.
225
		$interface = $project->getRepositoryInterface();
226
		if(
227
			!empty($interface) && !empty($interface->URL)
228
			&& !empty($data['changes']['Code version']['from'])
229
			&& strlen($data['changes']['Code version']['from']) == '40'
230
			&& !empty($data['changes']['Code version']['to'])
231
			&& strlen($data['changes']['Code version']['to']) == '40'
232
		) {
233
			$compareurl = sprintf(
234
				'%s/compare/%s...%s',
235
				$interface->URL,
236
				$data['changes']['Code version']['from'],
237
				$data['changes']['Code version']['to']
238
			);
239
			$data['changes']['Code version']['compareUrl'] = $compareurl;
240
		}
241
242
		// Append json to response
243
		$token = SecurityToken::inst();

code/control/DNRoot.php 1 location

@@ 1314-1328 (lines=15) @@
1311
		// Add in a URL for comparing from->to code changes. Ensure that we have
1312
		// two proper 40 character SHAs, otherwise we can't show the compare link.
1313
		$interface = $project->getRepositoryInterface();
1314
		if(
1315
			!empty($interface) && !empty($interface->URL)
1316
			&& !empty($data['changes']['Code version']['from'])
1317
			&& strlen($data['changes']['Code version']['from']) == '40'
1318
			&& !empty($data['changes']['Code version']['to'])
1319
			&& strlen($data['changes']['Code version']['to']) == '40'
1320
		) {
1321
			$compareurl = sprintf(
1322
				'%s/compare/%s...%s',
1323
				$interface->URL,
1324
				$data['changes']['Code version']['from'],
1325
				$data['changes']['Code version']['to']
1326
			);
1327
			$data['changes']['Code version']['compareUrl'] = $compareurl;
1328
		}
1329
1330
		// Append json to response
1331
		$token = SecurityToken::inst();