Cloud-CV/EvalAI

View on GitHub

Showing 1,371 of 1,371 total issues

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

            try:
                results = json.loads(submission_result)
            except (ValueError, TypeError) as exc:
                response_data = {
                    "error": "`result` key contains invalid data with error {}."
Severity: Major
Found in apps/jobs/views.py and 3 other locations - About 2 hrs to fix
apps/jobs/views.py on lines 1147..1155
apps/jobs/views.py on lines 1725..1733
apps/jobs/views.py on lines 2326..2333

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 4 locations. Consider refactoring.
Open

    try:
        data = json.loads(data)
    except (ValueError, TypeError) as exc:
        response_data = {
            "error": "`leaderboard_data` key contains invalid data with error {}."
Severity: Major
Found in apps/jobs/views.py and 3 other locations - About 2 hrs to fix
apps/jobs/views.py on lines 1147..1155
apps/jobs/views.py on lines 1538..1546
apps/jobs/views.py on lines 1725..1733

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 4 locations. Consider refactoring.
Open

            try:
                results = json.loads(submission_result)
            except (ValueError, TypeError) as exc:
                response_data = {
                    "error": "`result` key contains invalid data with error {}."
Severity: Major
Found in apps/jobs/views.py and 3 other locations - About 2 hrs to fix
apps/jobs/views.py on lines 1538..1546
apps/jobs/views.py on lines 1725..1733
apps/jobs/views.py on lines 2326..2333

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

Function onSuccess has 60 lines of code (exceeds 25 allowed). Consider refactoring.
Open

            onSuccess: function(response) {
                var status = response.status;
                var details = response.data;
                if (status == 200) {
                    vm.existTeam = details;
Severity: Major
Found in frontend/src/js/controllers/challengeHostTeamsCtrl.js - About 2 hrs to fix

    Function showRemainingSubmissions has 60 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            vm.showRemainingSubmissions = function(phaseID) {
                vm.remainingSubmissions = {};
                vm.remainingTime = {};
                vm.showClock = false;
                vm.showSubmissionNumbers = false;
    Severity: Major
    Found in frontend/src/js/controllers/challengeCtrl.js - About 2 hrs to fix

      Function createNewTeam has 60 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              vm.createNewTeam = function() {
                  vm.isExistLoader = true;
                  vm.loaderTitle = '';
                  vm.loaderContainer = angular.element('.new-team-card');
      
      
      Severity: Major
      Found in frontend/src/js/controllers/teamsCtrl.js - About 2 hrs to fix

        Function onSuccess has 60 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                    onSuccess: function(response) {
                        var details = response.data;
                        vm.phases = details;
                        for (var i=0; i<details.count; i++) {
                            if (details.results[i].is_public == false) {
        Severity: Major
        Found in frontend/src/js/controllers/challengeCtrl.js - About 2 hrs to fix

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

            it('should create', () => {
              fixture.ngZone.run(() => {
                router.navigate(['/contact']).then(() => {
                  fixture.detectChanges();
                  expect(component).toBeTruthy();
          frontend_v2/src/app/components/challenge-create/challenge-create.component.spec.ts on lines 54..61
          frontend_v2/src/app/components/challenge/challengesubmit/challengesubmit.component.spec.ts on lines 50..57

          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 83.

          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

            it('should create', () => {
              fixture.ngZone.run(() => {
                router.navigate(['/challenge-create/']).then(() => {
                  fixture.detectChanges();
                  expect(component).toBeTruthy();
          frontend_v2/src/app/components/challenge/challengesubmit/challengesubmit.component.spec.ts on lines 50..57
          frontend_v2/src/app/components/contact/contact.component.spec.ts on lines 66..73

          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 83.

          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

            it('should create', () => {
              fixture.ngZone.run(() => {
                router.navigate(['/challenge/0/submit']).then(() => {
                  fixture.detectChanges();
                  expect(component).toBeTruthy();
          frontend_v2/src/app/components/challenge-create/challenge-create.component.spec.ts on lines 54..61
          frontend_v2/src/app/components/contact/contact.component.spec.ts on lines 66..73

          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 83.

          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

          Function updateProfile has 59 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  vm.updateProfile = function(resetconfirmFormValid, editid) {
                      if (resetconfirmFormValid) {
                          vm.user.github_url = vm.user.github_url === null ? "" : vm.user.github_url;
                          vm.user.google_scholar_url = vm.user.google_scholar_url === null ? "" : vm.user.google_scholar_url;
                          vm.user.linkedin_url = vm.user.linkedin_url === null ? "" : vm.user.linkedin_url;
          Severity: Major
          Found in frontend/src/js/controllers/profileCtrl.js - About 2 hrs to fix

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

              ngOnInit() {
                this.challengeService.currentChallenge.subscribe((challenge) => {
                  this.challenge = challenge;
                });
                this.challengeService.currentPhases.subscribe((phases) => {
            frontend_v2/src/app/components/challenge/challengeoverview/challengeoverview.component.ts on lines 34..41

            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 82.

            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

              ngOnInit() {
                this.challengeService.currentChallenge.subscribe((challenge) => {
                  this.challenge = challenge;
                });
                this.challengeService.isChallengeHost.subscribe((status) => {
            frontend_v2/src/app/components/challenge/challengephases/challengephases.component.ts on lines 32..39

            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 82.

            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

            EvalAI_Interface has 22 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class EvalAI_Interface:
                def __init__(self, AUTH_TOKEN, EVALAI_API_SERVER):
                    self.AUTH_TOKEN = AUTH_TOKEN
                    self.EVALAI_API_SERVER = EVALAI_API_SERVER
            
            
            Severity: Minor
            Found in scripts/monitoring/evalai_interface.py - About 2 hrs to fix

              TeamlistComponent has 22 functions (exceeds 20 allowed). Consider refactoring.
              Open

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

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

                  validateModalInput(e) {
                    this.inputErrorMessage = '';
                    if (e.target.name === 'challegenDeleteInput') {
                      this.isDisabled = e.target.value !== this.challenge.title;
                    } else if (e.target.name === 'editChallengeTitle') {
                Severity: Major
                Found in frontend_v2/src/app/components/utility/modal/modal.component.ts - About 2 hrs to fix

                  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']) {

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

                            if (data.count === 0) {
                              SELF.paginationDetails.showPagination = false;
                              SELF.paginationDetails.paginationMessage = 'No results found';
                            } else {
                              SELF.paginationDetails.showPagination = true;
                    frontend_v2/src/app/components/challenge/challengeviewallsubmissions/challengeviewallsubmissions.component.ts on lines 306..312

                    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 81.

                    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.patchUrl(TeamUrl, BODY).subscribe(
                              (data) => {
                                // Success Message in data.message
                                SELF.globalService.showToast('success', 'Team Updated', 5);
                                SELF.fetchMyTeams(SELF.fetchTeamsPath);
                    frontend_v2/src/app/components/publiclists/teamlist/teamlist.component.ts on lines 428..439
                    frontend_v2/src/app/components/publiclists/teamlist/teamlist.component.ts on lines 631..642

                    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 81.

                    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.deleteUrl(SELF.deleteTeamsPath + '/' + e).subscribe(
                              (data) => {
                                // Success Message in data.message
                                SELF.globalService.showToast('success', 'You were removed from the team!', 5);
                                SELF.fetchMyTeams(SELF.fetchTeamsPath);
                    frontend_v2/src/app/components/publiclists/teamlist/teamlist.component.ts on lines 469..480
                    frontend_v2/src/app/components/publiclists/teamlist/teamlist.component.ts on lines 631..642

                    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 81.

                    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

                    Severity
                    Category
                    Status
                    Source
                    Language