Code Duplication    Length = 16-16 lines in 4 locations

app/library/Classes/Statistics/LeagueStatisticsEloquent.php 4 locations

@@ 382-397 (lines=16) @@
379
380
		return $cumulativeNetScores;
381
	}
382
	public function netCumulativeByPlayer($playerId)
383
	{
384
		$netScores = $this->netScoresByPlayer($playerId);
385
		$cumulativeNet= new \Illuminate\Support\Collection();
386
387
		if($netScores->count() > 0){
388
			$netScore = $netScores->first();
389
390
			$totalNetScore = $netScores->sum('netScore');
391
			$cumulativeNet->put('player', $netScore->player->name);
392
			$cumulativeNet->put('score', $totalNetScore);
393
			$cumulativeNet->put('rounds', $netScores->count());
394
		}
395
396
		return $cumulativeNet;
397
	}
398
	public function netCumulativeByPlayerTop($playerId, $top)
399
	{
400
		$netScores = $this->netScoresByPlayerTop($playerId, $top);
@@ 398-413 (lines=16) @@
395
396
		return $cumulativeNet;
397
	}
398
	public function netCumulativeByPlayerTop($playerId, $top)
399
	{
400
		$netScores = $this->netScoresByPlayerTop($playerId, $top);
401
		$cumulativeNet= new \Illuminate\Support\Collection();
402
403
		if($netScores->count() > 0){
404
			$netScore = $netScores->first();
405
406
			$totalNetScore = $netScores->sum('netScore');
407
			$cumulativeNet->put('player', $netScore->player->name);
408
			$cumulativeNet->put('score', $totalNetScore);
409
			$cumulativeNet->put('rounds', $netScores->count());
410
		}
411
412
		return $cumulativeNet;
413
	}
414
	public function netCumulativeYear($year)
415
	{
416
		//get players
@@ 440-455 (lines=16) @@
437
438
		return $cumulativeNetScores;
439
	}
440
	public function netCumulativeByPlayerYear($playerId,$year)
441
	{
442
		$netScores = $this->netScoresByPlayerYear($playerId, $year);
443
		$cumulativeNet= new \Illuminate\Support\Collection();
444
445
		if($netScores->count() > 0){
446
			$netScore = $netScores->first();
447
448
			$totalNetScore = $netScores->sum('netScore');
449
			$cumulativeNet->put('player', $netScore->player->name);
450
			$cumulativeNet->put('score', $totalNetScore);
451
			$cumulativeNet->put('rounds', $netScores->count());
452
		}
453
454
		return $cumulativeNet;
455
	}
456
	public function netCumulativeByPlayerTopYear($playerId,$top,$year)
457
	{
458
		$netScores = $this->netScoresByPlayerTopYear($playerId, $top, $year);
@@ 456-471 (lines=16) @@
453
454
		return $cumulativeNet;
455
	}
456
	public function netCumulativeByPlayerTopYear($playerId,$top,$year)
457
	{
458
		$netScores = $this->netScoresByPlayerTopYear($playerId, $top, $year);
459
		$cumulativeNet= new \Illuminate\Support\Collection();
460
461
		if($netScores->count() > 0){
462
			$netScore = $netScores->first();
463
464
			$totalNetScore = $netScores->sum('netScore');
465
			$cumulativeNet->put('player', $netScore->player->name);
466
			$cumulativeNet->put('score', $totalNetScore);
467
			$cumulativeNet->put('rounds', $netScores->count());
468
		}
469
470
		return $cumulativeNet;
471
	}
472
473
474
}