Cloud-CV/EvalAI

View on GitHub

Showing 1,371 of 1,371 total issues

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

  getDateDifferenceString(d1, d2) {
    const DIFF_DAYS = this.getDateDifference(d1, d2);
    if (DIFF_DAYS < 1) {
      const DIFF_HOURS = DIFF_DAYS * 24;
      if (DIFF_HOURS < 1) {
Severity: Minor
Found in frontend_v2/src/app/services/global.service.ts - About 1 hr to fix

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

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

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

              vm.startLoader = function(msg) {
                  $rootScope.isLoader = true;
                  $rootScope.loaderTitle = msg;
                  vm.changepassContainer.addClass('low-screen');
              };
      Severity: Major
      Found in frontend/src/js/controllers/changePwdCtrl.js and 1 other location - About 1 hr to fix
      frontend/src/js/controllers/updateProfileCtrl.js on lines 23..27

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

      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

              vm.startLoader = function(msg) {
                  $rootScope.isLoader = true;
                  $rootScope.loaderTitle = msg;
                  vm.updateprofileContainer.addClass('low-screen');
              };
      Severity: Major
      Found in frontend/src/js/controllers/updateProfileCtrl.js and 1 other location - About 1 hr to fix
      frontend/src/js/controllers/changePwdCtrl.js on lines 27..31

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

      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

          } else if (this.type === 'text' || this.type === 'textarea' || this.type === 'textattribute') {
            this.isValid = this.globalService.validateText(e);
            this.isValid ? (this.message = '') : (this.message = 'Enter a valid text');
          } else if (this.type === 'number') {
            this.isValid = this.globalService.validateInteger(e);
      frontend_v2/src/app/components/utility/input/input.component.ts on lines 237..251
      frontend_v2/src/app/components/utility/input/input.component.ts on lines 243..251
      frontend_v2/src/app/components/utility/input/input.component.ts on lines 248..251

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

      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

          } else if (this.type === 'number') {
            this.isValid = this.globalService.validateInteger(e);
            this.isValid ? (this.message = '') : (this.message = 'Enter a valid number');
          } else if (this.type === 'datetime') {
            this.isValid = true;
      frontend_v2/src/app/components/utility/input/input.component.ts on lines 237..251
      frontend_v2/src/app/components/utility/input/input.component.ts on lines 240..251
      frontend_v2/src/app/components/utility/input/input.component.ts on lines 248..251

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

      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

        beforeEach(async(() => {
          TestBed.configureTestingModule({
            imports: [FormsModule],
            declarations: [TermsAndConditionsModalComponent],
            providers: [GlobalService],
      frontend_v2/src/app/components/utility/confirm/confirm.component.spec.ts on lines 11..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 56.

      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

          } else if (this.isEmail) {
            this.isValid = this.globalService.validateEmail(e);
            this.isValid ? (this.message = '') : (this.message = 'Enter a valid email');
          } else if (this.type === 'text' || this.type === 'textarea' || this.type === 'textattribute') {
            this.isValid = this.globalService.validateText(e);
      frontend_v2/src/app/components/utility/input/input.component.ts on lines 240..251
      frontend_v2/src/app/components/utility/input/input.component.ts on lines 243..251
      frontend_v2/src/app/components/utility/input/input.component.ts on lines 248..251

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

      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

          } else if (this.type === 'password') {
            this.isValid = this.globalService.validatePassword(e);
            this.isValid ? (this.message = '') : (this.message = 'Password minimum 8 characters');
          }
      frontend_v2/src/app/components/utility/input/input.component.ts on lines 237..251
      frontend_v2/src/app/components/utility/input/input.component.ts on lines 240..251
      frontend_v2/src/app/components/utility/input/input.component.ts on lines 243..251

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

      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 if (SELF.router.url.split('/').length === 6) {
            SELF.router.navigate(['../../' + phaseSplit['id'] + '/' + SELF.encodeMetricURI(metricName)], { relativeTo: this.route });
          }
      frontend_v2/src/app/components/challenge/challengeleaderboard/challengeleaderboard.component.ts on lines 360..364

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

      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 {
            if (this.scrolledState === true) {
              this.globalService.scrolledStateChange(false);
              document.getElementById('up-arrow').style.display = 'none';
            }
      Severity: Major
      Found in frontend_v2/src/app/app.component.ts and 1 other location - About 1 hr to fix
      frontend_v2/src/app/app.component.ts on lines 58..63

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

      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 if (SELF.router.url.split('/').length === 5) {
            SELF.router.navigate(['../' + phaseSplit['id'] + '/' + SELF.encodeMetricURI(metricName)], { relativeTo: this.route });
          } else if (SELF.router.url.split('/').length === 6) {
            SELF.router.navigate(['../../' + phaseSplit['id'] + '/' + SELF.encodeMetricURI(metricName)], { relativeTo: this.route });
          }
      frontend_v2/src/app/components/challenge/challengeleaderboard/challengeleaderboard.component.ts on lines 362..364

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

      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 (this.document.documentElement.scrollTop > 50) {
            if (this.scrolledState === false) {
              this.globalService.scrolledStateChange(true);
              document.getElementById('up-arrow').style.display = 'block';
            }
      Severity: Major
      Found in frontend_v2/src/app/app.component.ts and 1 other location - About 1 hr to fix
      frontend_v2/src/app/app.component.ts on lines 63..68

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

      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

        beforeEach(async(() => {
          TestBed.configureTestingModule({
            declarations: [ConfirmComponent],
            providers: [GlobalService],
            schemas: [NO_ERRORS_SCHEMA],
      frontend_v2/src/app/components/challenge/challengeparticipate/terms-and-conditions-modal/terms-and-conditions-modal.component.spec.ts on lines 11..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 56.

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

              vm.setWorkerResources = function() {
                  parameters.url = "challenges/" + vm.challengeId + "/scale_resources/";
                  parameters.method = 'PUT';
                  parameters.data = {
                      "worker_cpu_cores": vm.selectedWorkerResources[0],
      Severity: Minor
      Found in frontend/src/js/controllers/challengeCtrl.js - About 1 hr to fix

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

                            onError: function(response) {
                                if (response.status == 400) {
                                    vm.stopLoader();
                                    vm.isFormError = true;
                                    var non_field_errors, isUsername_valid, isEmail_valid, isPassword1_valid, isPassword2_valid;
        Severity: Minor
        Found in frontend/src/js/controllers/authCtrl.js - About 1 hr to fix

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

              function PermCtrl(utilities, $rootScope) {
                  var vm = this;
          
                  // message for not verified users
                  vm.emailError = utilities.getData('emailError');
          Severity: Minor
          Found in frontend/src/js/controllers/permissionCtrl.js - About 1 hr to fix

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

                                                        vm.load = function(url) {
                                                            // loader for existing teams
                                                            vm.isExistLoader = true;
                                                            vm.loaderTitle = '';
                                                            vm.loaderContainer = angular.element('.exist-team-card');
            Severity: Minor
            Found in frontend/src/js/controllers/challengeCtrl.js - About 1 hr to fix

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

              module.exports = function (config) {
                config.set({
                  basePath: '',
                  frameworks: ['jasmine', '@angular-devkit/build-angular'],
                  plugins: [
              Severity: Minor
              Found in frontend_v2/karma.conf.js - About 1 hr to fix

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

                        vm.deregister = function(deregisterformvalid) {
                            if (deregisterformvalid) {
                                parameters.url = 'challenges/challenge/' + vm.challengeId + '/deregister/';
                                parameters.method = 'POST';
                                parameters.data = {};
                Severity: Minor
                Found in frontend/src/js/controllers/challengeCtrl.js - About 1 hr to fix
                  Severity
                  Category
                  Status
                  Source
                  Language