Cloud-CV/EvalAI

View on GitHub
frontend_v2/src/app/components/challenge/challengesettings/challengesettings.component.ts

Summary

Maintainability
F
3 wks
Test Coverage

File challengesettings.component.ts has 1176 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { Component, OnInit, OnDestroy, QueryList, ViewChildren } from '@angular/core';
import { COMMA, ENTER } from '@angular/cdk/keycodes';
import { MatChipInputEvent } from '@angular/material/chips';
import { Router } from '@angular/router';
import { NGXLogger } from 'ngx-logger';

    ChallengesettingsComponent has 36 functions (exceeds 20 allowed). Consider refactoring.
    Open

    @Component({
      selector: 'app-challengesettings',
      templateUrl: './challengesettings.component.html',
      styleUrls: ['./challengesettings.component.scss'],
    })

      Function togglePhaseVisibility has 70 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        togglePhaseVisibility() {
          const SELF = this;
          let togglePhaseVisibilityState, isPublic;
          if (SELF.phaseVisibility.state === 'Public') {
            togglePhaseVisibilityState = 'private';

        Function toggleLeaderboardVisibility has 58 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          toggleLeaderboardVisibility() {
            const SELF = this;
            let toggleLeaderboardVisibilityState, visibility, phaseIsPublic;
            for (let i = 0; i < SELF.filteredPhases.length; i++) {
              if (SELF.filteredPhases[i]['name'] === SELF.selectedPhaseSplit['challenge_phase_name']) {

          Function challengeDateDialog has 50 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            challengeDateDialog() {
              const SELF = this;
              SELF.apiCall = (params) => {
                if (new Date(params.start_date).valueOf() < new Date(params.end_date).valueOf()) {
                  const BODY = JSON.stringify({

            Function toggleSubmissionVisibility has 49 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              toggleSubmissionVisibility() {
                const SELF = this;
                if (SELF.isLeaderboardPublic === true) {
                  let toggleSubmissionVisibilityState, isSubmissionPublic;
                  if (SELF.submissionVisibility.state === 'Public') {

              Function togglePublishChallengeState has 45 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                togglePublishChallengeState() {
                  const SELF = this;
                  let toggleChallengePublishState, isPublished;
                  if (this.publishChallenge.state === 'Published') {
                    toggleChallengePublishState = 'private';

                Function editPhaseDetails has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  editPhaseDetails() {
                    const SELF = this;
                    SELF.apiCall = (params) => {
                      const FORM_DATA: FormData = new FormData();
                      for (const key in params) {

                  Function editPhaseDetailsUpload has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    editPhaseDetailsUpload() {
                      const SELF = this;
                      SELF.apiCall = (params) => {
                        const FORM_DATA: FormData = new FormData();
                        FORM_DATA.append('phase_description_file', params['phase_description_file']);

                    Function editEvaluationCriteriaUpload has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      editEvaluationCriteriaUpload() {
                        const SELF = this;
                        SELF.apiCall = (params) => {
                          const FORM_DATA: FormData = new FormData();
                          FORM_DATA.append('evaluation_criteria_file', params['evaluation_criteria_file']);

                      Function editChallengeImage has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        editChallengeImage() {
                          const SELF = this;
                          SELF.apiCall = (params) => {
                            const FORM_DATA: FormData = new FormData();
                            FORM_DATA.append('image', params['image']);

                        Function editChallengeTermsAndConditionsUpload has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          editChallengeTermsAndConditionsUpload() {
                            const SELF = this;
                            SELF.apiCall = (params) => {
                              const FORM_DATA: FormData = new FormData();
                              FORM_DATA.append('terms_and_conditions_file', params['terms_and_conditions_file']);

                          Function editTestAnnotations has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            editTestAnnotations() {
                              const SELF = this;
                              SELF.apiCall = (params) => {
                                const FORM_DATA: FormData = new FormData();
                                FORM_DATA.append('test_annotation', params['test_annotation']);

                            Function editChallengeOverviewUpload has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              editChallengeOverviewUpload() {
                                const SELF = this;
                                SELF.apiCall = (params) => {
                                  const FORM_DATA: FormData = new FormData();
                                  FORM_DATA.append('overview_file', params['overview_file']);

                              Function editLeaderboardSchema has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                editLeaderboardSchema() {
                                  const SELF = this;
                                  SELF.apiCall = (params) => {
                                    let currentLeaderboard = this.leaderboard;
                                    this.logger.info(params);

                                Function phaseSplitSelected has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  phaseSplitSelected() {
                                    const SELF = this;
                                    return (phaseSplit) => {
                                      SELF.selectedPhaseSplit = phaseSplit;
                                      SELF.isPhaseSplitLeaderboardPublic = SELF.selectedPhaseSplit['visibility'];

                                  Function ngOnInit has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    ngOnInit() {
                                      this.challengeService.currentChallenge.subscribe((challenge) => {
                                        this.challenge = challenge;
                                      });
                                  
                                  

                                    Function editEvaluationScript has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                      editEvaluationScript() {
                                        const SELF = this;
                                        SELF.apiCall = (params) => {
                                          const FORM_DATA: FormData = new FormData();
                                          FORM_DATA.append('evaluation_script', params['evaluation_script']);

                                      Function stopParticipation has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                        stopParticipation(event) {
                                          event.preventDefault();
                                          const participationState = this.challenge['is_registration_open'] ? 'Close' : 'Open';
                                          const closeParticipationMsg = 'Participation is closed successfully';
                                          const openParticipationMsg = 'Participation is opened successfully';

                                        Function editChallengeTitle has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                          editChallengeTitle() {
                                            const SELF = this;
                                        
                                            SELF.apiCall = (params) => {
                                              const BODY = JSON.stringify(params);

                                          Function deleteChallenge has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                          Open

                                            deleteChallenge() {
                                              const SELF = this;
                                              const redirectTo = '/dashboard';
                                          
                                              SELF.apiCall = () => {

                                            Function editEvaluationCriteria has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                            Open

                                              editEvaluationCriteria() {
                                                const SELF = this;
                                                SELF.apiCall = (params) => {
                                                  const BODY = JSON.stringify(params);
                                                  SELF.apiService

                                              Function editTermsAndConditions has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                              Open

                                                editTermsAndConditions() {
                                                  const SELF = this;
                                                  SELF.apiCall = (params) => {
                                                    const BODY = JSON.stringify(params);
                                                    SELF.apiService

                                                Function editChallengeOverview has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                                Open

                                                  editChallengeOverview() {
                                                    const SELF = this;
                                                
                                                    SELF.apiCall = (params) => {
                                                      const BODY = JSON.stringify(params);

                                                  Function apiCall has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                                  Open

                                                      SELF.apiCall = () => {
                                                        const BODY = JSON.stringify({
                                                          published: isPublished,
                                                        });
                                                        SELF.apiService

                                                    Function toggleLeaderboardVisibility has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                                    Open

                                                      toggleLeaderboardVisibility() {
                                                        const SELF = this;
                                                        let toggleLeaderboardVisibilityState, visibility, phaseIsPublic;
                                                        for (let i = 0; i < SELF.filteredPhases.length; i++) {
                                                          if (SELF.filteredPhases[i]['name'] === SELF.selectedPhaseSplit['challenge_phase_name']) {

                                                    Cognitive Complexity

                                                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                                    A method's cognitive complexity is based on a few simple rules:

                                                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                                    • Code is considered more complex for each "break in the linear flow of the code"
                                                    • Code is considered more complex when "flow breaking structures are nested"

                                                    Further reading

                                                    Function add has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                    Open

                                                      add(event: MatChipInputEvent): void {
                                                        const SELF = this;
                                                        const input = event.input;
                                                        const value = event.value;
                                                        SELF.isValidationError = false;

                                                    Cognitive Complexity

                                                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                                    A method's cognitive complexity is based on a few simple rules:

                                                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                                    • Code is considered more complex for each "break in the linear flow of the code"
                                                    • Code is considered more complex when "flow breaking structures are nested"

                                                    Further reading

                                                    Similar blocks of code found in 3 locations. Consider refactoring.
                                                    Open

                                                      editChallengeOverviewUpload() {
                                                        const SELF = this;
                                                        SELF.apiCall = (params) => {
                                                          const FORM_DATA: FormData = new FormData();
                                                          FORM_DATA.append('overview_file', params['overview_file']);
                                                    frontend_v2/src/app/components/challenge/challengesettings/challengesettings.component.ts on lines 465..509
                                                    frontend_v2/src/app/components/challenge/challengesettings/challengesettings.component.ts on lines 514..559

                                                    Duplicated Code

                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                    Tuning

                                                    This issue has a mass of 316.

                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                    Refactorings

                                                    Further Reading

                                                    Similar blocks of code found in 3 locations. Consider refactoring.
                                                    Open

                                                      editChallengeTermsAndConditionsUpload() {
                                                        const SELF = this;
                                                        SELF.apiCall = (params) => {
                                                          const FORM_DATA: FormData = new FormData();
                                                          FORM_DATA.append('terms_and_conditions_file', params['terms_and_conditions_file']);
                                                    frontend_v2/src/app/components/challenge/challengesettings/challengesettings.component.ts on lines 416..460
                                                    frontend_v2/src/app/components/challenge/challengesettings/challengesettings.component.ts on lines 514..559

                                                    Duplicated Code

                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                    Tuning

                                                    This issue has a mass of 316.

                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                    Refactorings

                                                    Further Reading

                                                    Similar blocks of code found in 3 locations. Consider refactoring.
                                                    Open

                                                      editEvaluationCriteriaUpload() {
                                                        const SELF = this;
                                                        SELF.apiCall = (params) => {
                                                          const FORM_DATA: FormData = new FormData();
                                                          FORM_DATA.append('evaluation_criteria_file', params['evaluation_criteria_file']);
                                                    frontend_v2/src/app/components/challenge/challengesettings/challengesettings.component.ts on lines 416..460
                                                    frontend_v2/src/app/components/challenge/challengesettings/challengesettings.component.ts on lines 465..509

                                                    Duplicated Code

                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                    Tuning

                                                    This issue has a mass of 316.

                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                    Refactorings

                                                    Further Reading

                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                    Open

                                                      editTermsAndConditions() {
                                                        const SELF = this;
                                                        SELF.apiCall = (params) => {
                                                          const BODY = JSON.stringify(params);
                                                          SELF.apiService
                                                    frontend_v2/src/app/components/challenge/challengesettings/challengesettings.component.ts on lines 1341..1374

                                                    Duplicated Code

                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                    Tuning

                                                    This issue has a mass of 281.

                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                    Refactorings

                                                    Further Reading

                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                    Open

                                                      editEvaluationCriteria() {
                                                        const SELF = this;
                                                        SELF.apiCall = (params) => {
                                                          const BODY = JSON.stringify(params);
                                                          SELF.apiService
                                                    frontend_v2/src/app/components/challenge/challengesettings/challengesettings.component.ts on lines 650..683

                                                    Duplicated Code

                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                    Tuning

                                                    This issue has a mass of 281.

                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                    Refactorings

                                                    Further Reading

                                                    Identical blocks of code found in 3 locations. Consider refactoring.
                                                    Open

                                                        this.challengeService.currentPhases.subscribe((phases) => {
                                                          this.phases = phases;
                                                          for (let i = 0; i < this.phases.length; i++) {
                                                            if (this.phases[i].is_public === false) {
                                                              this.phases[i].showPrivate = true;
                                                    frontend_v2/src/app/components/challenge/challengesubmissions/challengesubmissions.component.ts on lines 231..241
                                                    frontend_v2/src/app/components/challenge/challengeviewallsubmissions/challengeviewallsubmissions.component.ts on lines 229..239

                                                    Duplicated Code

                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                    Tuning

                                                    This issue has a mass of 147.

                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                    Refactorings

                                                    Further Reading

                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                    Open

                                                          SELF.apiService
                                                            .patchFileUrl(
                                                              SELF.endpointsService.editChallengeDetailsURL(SELF.challenge.creator.id, SELF.challenge.id),
                                                              FORM_DATA
                                                            )
                                                    frontend_v2/src/app/components/challenge/challengesettings/challengesettings.component.ts on lines 287..299

                                                    Duplicated Code

                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                    Tuning

                                                    This issue has a mass of 144.

                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                    Refactorings

                                                    Further Reading

                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                    Open

                                                          SELF.apiService
                                                            .patchUrl(SELF.endpointsService.editChallengeDetailsURL(SELF.challenge.creator.id, SELF.challenge.id), BODY)
                                                            .subscribe(
                                                              (data) => {
                                                                SELF.challenge.title = data.title;
                                                    frontend_v2/src/app/components/challenge/challengesettings/challengesettings.component.ts on lines 372..387

                                                    Duplicated Code

                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                    Tuning

                                                    This issue has a mass of 144.

                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                    Refactorings

                                                    Further Reading

                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                    Open

                                                        if (SELF.phaseVisibility.state === 'Public') {
                                                          togglePhaseVisibilityState = 'private';
                                                          isPublic = false;
                                                          SELF.phaseVisibility.state = 'Private';
                                                          SELF.phaseVisibility.icon = 'fa fa-toggle-off grey-text text-darken-1';
                                                    frontend_v2/src/app/components/challenge/challengesettings/challengesettings.component.ts on lines 1092..1102

                                                    Duplicated Code

                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                    Tuning

                                                    This issue has a mass of 111.

                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                    Refactorings

                                                    Further Reading

                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                    Open

                                                          if (SELF.submissionVisibility.state === 'Public') {
                                                            toggleSubmissionVisibilityState = 'private';
                                                            isSubmissionPublic = false;
                                                            SELF.submissionVisibility.state = 'Private';
                                                            SELF.submissionVisibility.icon = 'fa fa-toggle-off grey-text text-darken-1';
                                                    frontend_v2/src/app/components/challenge/challengesettings/challengesettings.component.ts on lines 1014..1024

                                                    Duplicated Code

                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                    Tuning

                                                    This issue has a mass of 111.

                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                    Refactorings

                                                    Further Reading

                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                    Open

                                                            (err) => {
                                                              SELF.globalService.handleApiError(err, true);
                                                              SELF.globalService.showToast('error', err);
                                                              if (isPublic) {
                                                                SELF.phaseVisibility.state = 'Private';
                                                    frontend_v2/src/app/components/challenge/challengesettings/challengesettings.component.ts on lines 1122..1132

                                                    Duplicated Code

                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                    Tuning

                                                    This issue has a mass of 110.

                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                    Refactorings

                                                    Further Reading

                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                    Open

                                                              (err) => {
                                                                SELF.globalService.handleApiError(err, true);
                                                                SELF.globalService.showToast('error', err);
                                                                if (isSubmissionPublic) {
                                                                  SELF.submissionVisibility.state = 'Private';
                                                    frontend_v2/src/app/components/challenge/challengesettings/challengesettings.component.ts on lines 1070..1080

                                                    Duplicated Code

                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                    Tuning

                                                    This issue has a mass of 110.

                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                    Refactorings

                                                    Further Reading

                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                    Open

                                                          if (SELF.isSubmissionPublic) {
                                                            SELF.submissionVisibility.state = 'Public';
                                                            SELF.submissionVisibility.icon = 'fa fa-toggle-on green-text';
                                                          } else {
                                                            SELF.submissionVisibility.state = 'Private';
                                                    frontend_v2/src/app/components/challenge/challengesettings/challengesettings.component.ts on lines 939..945

                                                    Duplicated Code

                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                    Tuning

                                                    This issue has a mass of 75.

                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                    Refactorings

                                                    Further Reading

                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                    Open

                                                          if (SELF.isPhasePublic) {
                                                            SELF.phaseVisibility.state = 'Public';
                                                            SELF.phaseVisibility.icon = 'fa fa-toggle-on green-text';
                                                          } else {
                                                            SELF.phaseVisibility.state = 'Private';
                                                    frontend_v2/src/app/components/challenge/challengesettings/challengesettings.component.ts on lines 946..952

                                                    Duplicated Code

                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                    Tuning

                                                    This issue has a mass of 75.

                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                    Refactorings

                                                    Further Reading

                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                    Open

                                                        const PARAMS = {
                                                          title: 'Edit Test Annotations',
                                                          confirm: 'Submit',
                                                          deny: 'Cancel',
                                                          form: [
                                                    frontend_v2/src/app/components/challenge/challengesettings/challengesettings.component.ts on lines 1403..1418

                                                    Duplicated Code

                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                    Tuning

                                                    This issue has a mass of 72.

                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                    Refactorings

                                                    Further Reading

                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                    Open

                                                        const PARAMS = {
                                                          title: 'Edit Evaluation Script',
                                                          confirm: 'Submit',
                                                          deny: 'Cancel',
                                                          form: [
                                                    frontend_v2/src/app/components/challenge/challengesettings/challengesettings.component.ts on lines 1183..1198

                                                    Duplicated Code

                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                    Tuning

                                                    This issue has a mass of 72.

                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                    Refactorings

                                                    Further Reading

                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                    Open

                                                          SELF.apiService
                                                            .patchFileUrl(
                                                              SELF.endpointsService.editChallengeDetailsURL(SELF.challenge.creator.id, SELF.challenge.id),
                                                              FORM_DATA
                                                            )
                                                    frontend_v2/src/app/components/challenge/challengesettings/challengesettings.component.ts on lines 1161..1177

                                                    Duplicated Code

                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                    Tuning

                                                    This issue has a mass of 63.

                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                    Refactorings

                                                    Further Reading

                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                    Open

                                                              (data) => {
                                                                for (const attrname of Object.keys(data)) {
                                                                  SELF.selectedPhase[attrname] = data[attrname];
                                                                }
                                                                SELF.globalService.showToast('success', 'Challenge phase description updated successfully!');
                                                    frontend_v2/src/app/components/challenge/challengesettings/challengesettings.component.ts on lines 974..979

                                                    Duplicated Code

                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                    Tuning

                                                    This issue has a mass of 63.

                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                    Refactorings

                                                    Further Reading

                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                    Open

                                                              (data) => {
                                                                for (const attrname of Object.keys(data)) {
                                                                  SELF.selectedPhase[attrname] = data[attrname];
                                                                }
                                                                SELF.globalService.showToast('success', 'The challenge phase details are successfully updated!');
                                                    frontend_v2/src/app/components/challenge/challengesettings/challengesettings.component.ts on lines 575..580

                                                    Duplicated Code

                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                    Tuning

                                                    This issue has a mass of 63.

                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                    Refactorings

                                                    Further Reading

                                                    Similar blocks of code found in 3 locations. Consider refactoring.
                                                    Open

                                                      constructor(
                                                        private challengeService: ChallengeService,
                                                        private globalService: GlobalService,
                                                        private apiService: ApiService,
                                                        private endpointsService: EndpointsService,
                                                    frontend_v2/src/app/components/challenge/challengeanalytics/challengeanalytics.component.ts on lines 57..64
                                                    frontend_v2/src/app/components/challenge/challengediscuss/challengediscuss.component.ts on lines 46..53

                                                    Duplicated Code

                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                    Tuning

                                                    This issue has a mass of 62.

                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                    Refactorings

                                                    Further Reading

                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                    Open

                                                        const PARAMS = {
                                                          title: 'Edit Challenge Description',
                                                          label: 'description',
                                                          isEditorRequired: true,
                                                          editorContent: this.challenge.description,
                                                    frontend_v2/src/app/components/challenge/challengesubmit/challengesubmit.component.ts on lines 674..682

                                                    Duplicated Code

                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                    Tuning

                                                    This issue has a mass of 55.

                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                    Refactorings

                                                    Further Reading

                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                    Open

                                                                } else {
                                                                  SELF.selectedPhaseSplit['showPrivate'] = true;
                                                                  SELF.leaderboardVisibility.state = 'Private';
                                                                  SELF.leaderboardVisibility.icon = 'fa fa-toggle-off grey-text text-darken-1';
                                                                }
                                                    frontend_v2/src/app/components/challenge/challengesettings/challengesettings.component.ts on lines 1279..1283

                                                    Duplicated Code

                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                    Tuning

                                                    This issue has a mass of 48.

                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                    Refactorings

                                                    Further Reading

                                                    Identical blocks of code found in 2 locations. Consider refactoring.
                                                    Open

                                                          SELF.apiService
                                                            .patchFileUrl(
                                                              SELF.endpointsService.updateChallengePhaseDetailsURL(SELF.challenge.id, SELF.selectedPhase['id']),
                                                              FORM_DATA
                                                            )
                                                    frontend_v2/src/app/components/challenge/challengesettings/challengesettings.component.ts on lines 968..986

                                                    Duplicated Code

                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                    Tuning

                                                    This issue has a mass of 48.

                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                    Refactorings

                                                    Further Reading

                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                    Open

                                                                if (visibility === 3) {
                                                                  SELF.selectedPhaseSplit['showPrivate'] = false;
                                                                  SELF.leaderboardVisibility.state = 'Public';
                                                                  SELF.leaderboardVisibility.icon = 'fa fa-toggle-on green-text';
                                                                } else {
                                                    frontend_v2/src/app/components/challenge/challengesettings/challengesettings.component.ts on lines 1283..1287

                                                    Duplicated Code

                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                    Tuning

                                                    This issue has a mass of 48.

                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                    Refactorings

                                                    Further Reading

                                                    Similar blocks of code found in 3 locations. Consider refactoring.
                                                    Open

                                                        SELF.apiService
                                                          .patchFileUrl(
                                                            SELF.endpointsService.updateChallengePhaseDetailsURL(SELF.selectedPhase['challenge'], SELF.selectedPhase['id']),
                                                            BODY
                                                          )
                                                    frontend_v2/src/app/components/challenge/challengesettings/challengesettings.component.ts on lines 1105..1134
                                                    frontend_v2/src/app/components/challenge/challengesettings/challengesettings.component.ts on lines 1161..1177

                                                    Duplicated Code

                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                    Tuning

                                                    This issue has a mass of 48.

                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                    Refactorings

                                                    Further Reading

                                                    Similar blocks of code found in 3 locations. Consider refactoring.
                                                    Open

                                                          SELF.apiService
                                                            .patchFileUrl(
                                                              SELF.endpointsService.updateChallengePhaseDetailsURL(
                                                                SELF.selectedPhase['challenge'],
                                                                SELF.selectedPhase['id']
                                                    frontend_v2/src/app/components/challenge/challengesettings/challengesettings.component.ts on lines 1027..1082
                                                    frontend_v2/src/app/components/challenge/challengesettings/challengesettings.component.ts on lines 1105..1134

                                                    Duplicated Code

                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                    Tuning

                                                    This issue has a mass of 48.

                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                    Refactorings

                                                    Further Reading

                                                    Identical blocks of code found in 2 locations. Consider refactoring.
                                                    Open

                                                          SELF.apiService
                                                            .patchFileUrl(
                                                              SELF.endpointsService.updateChallengePhaseDetailsURL(SELF.challenge.id, SELF.selectedPhase['id']),
                                                              FORM_DATA
                                                            )
                                                    frontend_v2/src/app/components/challenge/challengesettings/challengesettings.component.ts on lines 569..586

                                                    Duplicated Code

                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                    Tuning

                                                    This issue has a mass of 48.

                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                    Refactorings

                                                    Further Reading

                                                    Similar blocks of code found in 3 locations. Consider refactoring.
                                                    Open

                                                          SELF.apiService
                                                            .patchFileUrl(
                                                              SELF.endpointsService.updateChallengePhaseDetailsURL(
                                                                SELF.selectedPhase['challenge'],
                                                                SELF.selectedPhase['id']
                                                    frontend_v2/src/app/components/challenge/challengesettings/challengesettings.component.ts on lines 1027..1082
                                                    frontend_v2/src/app/components/challenge/challengesettings/challengesettings.component.ts on lines 1161..1177

                                                    Duplicated Code

                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                    Tuning

                                                    This issue has a mass of 48.

                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                    Refactorings

                                                    Further Reading

                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                    Open

                                                          } else {
                                                            toggleLeaderboardVisibilityState = 'public';
                                                            visibility = 3;
                                                            SELF.leaderboardVisibility.state = 'Public';
                                                            SELF.leaderboardVisibility.icon = 'fa fa-toggle-on green-text';
                                                    frontend_v2/src/app/components/challenge/challengesettings/challengesettings.component.ts on lines 1260..1265

                                                    Duplicated Code

                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                    Tuning

                                                    This issue has a mass of 47.

                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                    Refactorings

                                                    Further Reading

                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                    Open

                                                            {
                                                              isRequired: false,
                                                              label: 'end_date',
                                                              placeholder: 'End Date and Time',
                                                              type: 'text',
                                                    frontend_v2/src/app/components/challenge/challengesettings/challengesettings.component.ts on lines 720..726

                                                    Duplicated Code

                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                    Tuning

                                                    This issue has a mass of 47.

                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                    Refactorings

                                                    Further Reading

                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                    Open

                                                            {
                                                              isRequired: false,
                                                              label: 'start_date',
                                                              placeholder: 'Start Date and Time',
                                                              type: 'text',
                                                    frontend_v2/src/app/components/challenge/challengesettings/challengesettings.component.ts on lines 727..733

                                                    Duplicated Code

                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                    Tuning

                                                    This issue has a mass of 47.

                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                    Refactorings

                                                    Further Reading

                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                    Open

                                                          if (SELF.leaderboardVisibility.state === 'Public') {
                                                            toggleLeaderboardVisibilityState = 'private';
                                                            visibility = 1;
                                                            SELF.leaderboardVisibility.state = 'Private';
                                                            SELF.leaderboardVisibility.icon = 'fa fa fa-toggle-off grey-text text-darken-1';
                                                    frontend_v2/src/app/components/challenge/challengesettings/challengesettings.component.ts on lines 1265..1270

                                                    Duplicated Code

                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                    Tuning

                                                    This issue has a mass of 47.

                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                    Refactorings

                                                    Further Reading

                                                    There are no issues that match your filters.

                                                    Category
                                                    Status