message: Clean up code smells from nested loops and numerous return statements
diff: @@ -197,6 +197,11 @@ export class ScoreBoardComponent implements OnInit {
  calculateGradientOffsets (challenges: Challenge[]) {
  for (let difficulty = 1; difficulty <= 6; difficulty++) {
  + this.offsetValue[difficulty - 1] = this.calculateGradientOffset(challenges, difficulty)
  + }
  + }
  +
  + calculateGradientOffset (challenges: Challenge[], difficulty: number) {
  let solved = 0
  let total = 0
  @@ -211,9 +216,7 @@ export class ScoreBoardComponent implements OnInit {
  let offset: any = Math.round(solved * 100 / total)
  offset = 100 - offset
  - offset = +offset + '%'
  - this.offsetValue[difficulty - 1] = offset
  - }
  + return +offset + '%'
  }
  toggleDifficulty (difficulty: number) {
  @@ -298,8 +301,7 @@ export class ScoreBoardComponent implements OnInit {
  if (!this.displayedChallengeCategories.includes(challenge.category)) return false
  if (!this.showSolvedChallenges && challenge.solved) return false
  if (!this.showDisabledChallenges && challenge.disabledEnv) return false
  - if (this.showOnlyTutorialChallenges && !challenge.hasTutorial) return false
  - return true
  + return !(this.showOnlyTutorialChallenges && !challenge.hasTutorial)
  })
  let dataSource = new MatTableDataSource()
  