Cloud-CV/EvalAI

View on GitHub

Showing 1,371 of 1,371 total issues

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

        vm.createNewTeam = function() {
            vm.isLoader = true;
            vm.loaderTitle = '';
            vm.newContainer = angular.element('.new-team-card');

Severity: Major
Found in frontend/src/js/controllers/challengeCtrl.js - About 2 hrs to fix

    Function displayDockerSubmissionInstructions has 55 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

                vm.displayDockerSubmissionInstructions = function (isDockerBased, isParticipated) {
                // get remaining submission for docker based challenge
                if (isDockerBased && isParticipated == true && vm.eligible_to_submit) {
                    parameters.url = 'jobs/' + vm.challengeId + '/remaining_submissions/';
                    parameters.method = 'GET';
    Severity: Major
    Found in frontend/src/js/controllers/challengeCtrl.js - About 2 hrs to fix

      Function editChallengePhase has 55 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              vm.editChallengePhase = function(editChallengePhaseForm) {
                  if (editChallengePhaseForm) {
                      vm.challengePhaseId = vm.page.challenge_phase.id;
                      parameters.url = "challenges/challenge/" + vm.challengeId + "/challenge_phase/" + vm.challengePhaseId;
                      parameters.method = 'PATCH';
      Severity: Major
      Found in frontend/src/js/controllers/challengeCtrl.js - About 2 hrs to fix

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

          ngOnInit() {
            this.router.events.subscribe((event: Event) => {
              if (event instanceof NavigationEnd) {
                this.currentRoutePath = event.url; // current url path
              }
        Severity: Major
        Found in frontend_v2/src/app/app.component.ts - About 2 hrs to fix

          Function userSignUp has 55 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            userSignUp(signupFormValid) {
              if (signupFormValid) {
                let email = this.authService.regUser['email'];
                this.globalService.startLoader('Setting up your details!');
                const SIGNUP_BODY = JSON.stringify({
          Severity: Major
          Found in frontend_v2/src/app/components/auth/signup/signup.component.ts - About 2 hrs to fix

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

                                if (vm.existTeam.count === 0) {
                                    vm.showPagination = false;
                                    vm.paginationMsg = "No team exists for now. Start by creating a new team!";
                                } else {
                                    vm.activateCollapsible();
            Severity: Major
            Found in frontend/src/js/controllers/challengeHostTeamsCtrl.js and 1 other location - About 2 hrs to fix
            frontend/src/js/controllers/teamsCtrl.js on lines 53..60

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

            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

                                if (vm.existTeam.count === 0) {
                                    vm.showPagination = false;
                                    vm.paginationMsg = "No team exists for now. Start by creating a new team!";
                                } else {
                                    vm.activateCollapsible();
            Severity: Major
            Found in frontend/src/js/controllers/teamsCtrl.js and 1 other location - About 2 hrs to fix
            frontend/src/js/controllers/challengeHostTeamsCtrl.js on lines 55..62

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

            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

            ChallengeService has 21 functions (exceeds 20 allowed). Consider refactoring.
            Open

            @Injectable()
            export class ChallengeService {
              private defaultChallenge: any = { creator: {} };
              private defaultStars: any = { count: 0, is_starred: false };
              private defaultPublishChallenge: any = {
            Severity: Minor
            Found in frontend_v2/src/app/services/challenge.service.ts - About 2 hrs to fix

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

                  try:
                      challenge = Challenge.objects.get(queue=queue_name)  # noqa
                  except Challenge.DoesNotExist:
                      response_data = {
                          "error": "Challenge with queue name {} does not exist".format(
              Severity: Major
              Found in apps/jobs/views.py and 4 other locations - About 2 hrs to fix
              apps/jobs/views.py on lines 913..919
              apps/jobs/views.py on lines 1883..1889
              apps/jobs/views.py on lines 1930..1936
              apps/jobs/views.py on lines 2190..2198

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

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

                  try:
                      submission = Submission.objects.get(pk=submission_pk)
                  except Submission.DoesNotExist:
                      response_data = {
                          "error": "Submission {} does not exist".format(submission_pk)
              Severity: Major
              Found in apps/jobs/views.py and 4 other locations - About 2 hrs to fix
              apps/jobs/views.py on lines 913..919
              apps/jobs/views.py on lines 1930..1936
              apps/jobs/views.py on lines 2103..2111
              apps/jobs/views.py on lines 2190..2198

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

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

                  try:
                      challenge = Challenge.objects.get(queue=queue_name)
                  except Challenge.DoesNotExist:
                      response_data = {
                          "error": "Challenge with queue name {} does not exists".format(
              Severity: Major
              Found in apps/jobs/views.py and 4 other locations - About 2 hrs to fix
              apps/jobs/views.py on lines 913..919
              apps/jobs/views.py on lines 1883..1889
              apps/jobs/views.py on lines 1930..1936
              apps/jobs/views.py on lines 2103..2111

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

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

                  try:
                      submission = Submission.objects.get(pk=submission_pk)
                  except Submission.DoesNotExist:
                      response_data = {
                          "error": "Submission {} does not exist".format(submission_pk)
              Severity: Major
              Found in apps/jobs/views.py and 4 other locations - About 2 hrs to fix
              apps/jobs/views.py on lines 913..919
              apps/jobs/views.py on lines 1883..1889
              apps/jobs/views.py on lines 2103..2111
              apps/jobs/views.py on lines 2190..2198

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

              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

                      migrations.AlterField(
                          model_name="challenge",
                          name="banned_email_ids",
                          field=django.contrib.postgres.fields.ArrayField(
                              base_field=models.TextField(blank=True, null=True),
              apps/challenges/migrations/0075_add_list_as_default_value_in_email_ids_or_domains.py on lines 46..50
              apps/jobs/migrations/0019_add_missing_migration_file_after_django_2_migration.py on lines 13..17

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

              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

                  operations = [
                      migrations.AlterField(
                          model_name='submission',
                          name='job_name',
                          field=django.contrib.postgres.fields.ArrayField(base_field=models.TextField(blank=True, null=True), blank=True, default=list, null=True, size=None),
              apps/challenges/migrations/0075_add_list_as_default_value_in_email_ids_or_domains.py on lines 25..29
              apps/challenges/migrations/0075_add_list_as_default_value_in_email_ids_or_domains.py on lines 46..50

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

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

                  try:
                      submission = Submission.objects.get(pk=submission_id)
                  except Submission.DoesNotExist:
                      response_data = {
                          "error": "Submission {} does not exist".format(submission_id)
              Severity: Major
              Found in apps/jobs/views.py and 4 other locations - About 2 hrs to fix
              apps/jobs/views.py on lines 1883..1889
              apps/jobs/views.py on lines 1930..1936
              apps/jobs/views.py on lines 2103..2111
              apps/jobs/views.py on lines 2190..2198

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

              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

                      migrations.AlterField(
                          model_name="challengephase",
                          name="allowed_email_ids",
                          field=django.contrib.postgres.fields.ArrayField(
                              base_field=models.TextField(blank=True, null=True),
              apps/challenges/migrations/0075_add_list_as_default_value_in_email_ids_or_domains.py on lines 25..29
              apps/jobs/migrations/0019_add_missing_migration_file_after_django_2_migration.py on lines 13..17

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

              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 refreshSubmissionData has 54 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      vm.refreshSubmissionData = function() {
              
                          // get submissions of a particular challenge phase
              
                          if (!vm.isResult) {
              Severity: Major
              Found in frontend/src/js/controllers/challengeCtrl.js - About 2 hrs to fix

                Function challengeCreate has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        vm.challengeCreate = function() {
                            if (vm.hostTeamId) {
                                var fileVal = angular.element(".file-path").val();
                
                                if (fileVal === null || fileVal === "") {
                Severity: Major
                Found in frontend/src/js/controllers/challengeCreate.js - About 2 hrs to fix

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

                    hideTermsAndConditionsModal() {
                      if (this.isTermsAndConditionsModalVisible) {
                        this.isTermsAndConditionsModalVisible = false;
                        const TEMP = { isTermsAndConditionsModalVisible: false };
                        this.termsAndConditionsSource.next(Object.assign({}, this.termsAndConditionsModalDefault, TEMP));
                  Severity: Major
                  Found in frontend_v2/src/app/services/global.service.ts and 3 other locations - About 2 hrs to fix
                  frontend_v2/src/app/services/global.service.ts on lines 184..190
                  frontend_v2/src/app/services/global.service.ts on lines 231..237
                  frontend_v2/src/app/services/global.service.ts on lines 242..248

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

                  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

                    hideModal() {
                      if (this.isModalVisible) {
                        this.isModalVisible = false;
                        const TEMP = { isModalVisible: false };
                        this.modalSource.next(Object.assign({}, this.modalDefault, TEMP));
                  Severity: Major
                  Found in frontend_v2/src/app/services/global.service.ts and 3 other locations - About 2 hrs to fix
                  frontend_v2/src/app/services/global.service.ts on lines 184..190
                  frontend_v2/src/app/services/global.service.ts on lines 242..248
                  frontend_v2/src/app/services/global.service.ts on lines 253..259

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

                  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