Cloud-CV/EvalAI

View on GitHub

Showing 1,371 of 1,371 total issues

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

            if request.data.get("file_url") is None:
                response_data = {"error": "The file URL is missing!"}
                return Response(
                    response_data, status=status.HTTP_400_BAD_REQUEST
Severity: Major
Found in apps/jobs/views.py and 2 other locations - About 1 hr to fix
apps/jobs/views.py on lines 2784..2786
apps/jobs/views.py on lines 2788..2790

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

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.challenge_phase.max_submissions_per_day
                - submissions_done_today_count
                == 0
            ):
Severity: Major
Found in apps/jobs/models.py and 1 other location - About 1 hr to fix
apps/jobs/models.py on lines 240..249

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

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

    if request.data.get("upload_id") is None:
        response_data = {"error": "Uploaded file UploadId is missing"}
        return Response(response_data, status=status.HTTP_400_BAD_REQUEST)
Severity: Major
Found in apps/jobs/views.py and 2 other locations - About 1 hr to fix
apps/jobs/views.py on lines 290..293
apps/jobs/views.py on lines 2784..2786

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

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

    if request.data.get("parts") is None:
        response_data = {"error": "Uploaded file Parts metadata is missing"}
        return Response(response_data, status=status.HTTP_400_BAD_REQUEST)
Severity: Major
Found in apps/jobs/views.py and 2 other locations - About 1 hr to fix
apps/jobs/views.py on lines 290..293
apps/jobs/views.py on lines 2788..2790

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

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

  validateInput(e) {
    this.isDirty = true;
    this.value = e;
    e === '' ? (this.isEmpty = true) : (this.isEmpty = false);
    if (e === '' && this.isRequired) {
Severity: Minor
Found in frontend_v2/src/app/components/utility/input/input.component.ts - About 1 hr to fix

    Function storeMetadata has 29 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      storeMetadata(data) {
        for (let i = 0; i < data.count; i++) {
          if (data.results[i].submission_meta_attributes) {
            const attributes = data.results[i].submission_meta_attributes;
            attributes.forEach(function (attribute) {

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

                      onSuccess: function() {
                          utilities.resetStorage();
                          $rootScope.isLoader = false;
                          $state.go("home");
                          $rootScope.isAuth = false;
      Severity: Major
      Found in frontend/src/js/route-config/route-config.js and 1 other location - About 1 hr to fix
      frontend/src/js/controllers/profileCtrl.js on lines 367..373

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

      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 (status == 200) {
                                  utilities.resetStorage();
                                  $rootScope.isLoader = false;
                                  $state.go("home");
                                  $rootScope.isAuth = false;
      Severity: Major
      Found in frontend/src/js/controllers/profileCtrl.js and 1 other location - About 1 hr to fix
      frontend/src/js/route-config/route-config.js on lines 766..772

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

      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.router.url.split('/')[2] === 'participated') {
                this.tabHighlight = 'participatedChallenges';
                this.globalService.changeTabActiveStatus('participatedChallenges');
              } else if (this.router.url.split('/')[2] === 'all') {
                this.tabHighlight = 'allChallenges';
      frontend_v2/src/app/components/nav/header-static/header-static.component.ts on lines 106..112

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

      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) => {
                this.globalService.stopLoader();
                this.globalService.showToast('success', 'Successfuly sent to EvalAI admin for approval.');
                this.router.navigate([this.hostedChallengesRoute]);
              },
      frontend_v2/src/app/components/template-challenge-create/template-challenge-create.component.ts on lines 126..133

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

      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) => {
                this.globalService.stopLoader();
                this.globalService.showToast(
                  'success',
                  'Challenge created and successfuly sent to EvalAI admin for approval.'
      frontend_v2/src/app/components/challenge-create/challenge-create.component.ts on lines 100..104

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

      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.router.url.split('/')[length] === 'all') {
                this.tabHighlight = 'allChallenges';
                this.globalService.changeTabActiveStatus('allChallenges');
              } else if (this.router.url.split('/')[1] === 'profile') {
                this.tabHighlight = 'profile';
      frontend_v2/src/app/components/utility/side-bar/side-bar.component.ts on lines 45..51

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

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

                          vm.load = function(url) {
                              // loader for loading submissions
                              vm.startLoader = loaderService.startLoader;
                              vm.startLoader("Loading Submissions");
                              if (url !== null) {
      Severity: Minor
      Found in frontend/src/js/controllers/challengeCtrl.js - About 1 hr to fix

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

                vm.setRefreshJWT = function () {
                    var parameters = {};
                    parameters.url = 'accounts/user/get_auth_token';
                    parameters.method = 'GET';
                    parameters.token = utilities.getData('userKey');
        Severity: Minor
        Found in frontend/src/js/controllers/authCtrl.js - About 1 hr to fix

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

          function dynHeaderController(utilities) {
              var vm = this;
          
              vm.user = {};
          
          
          Severity: Minor
          Found in frontend/src/js/directives/directives.js - About 1 hr to fix

            Function load has 28 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/challengeHostTeamsCtrl.js - About 1 hr to fix

              Function load has 28 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/teamsCtrl.js - About 1 hr to fix

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

                        vm.inviteOthers = function(ev, hostTeamId) {
                            ev.stopPropagation();
                            // Appending dialog to document.body 
                            var confirm = $mdDialog.prompt()
                                .title('Add other members to your team')
                Severity: Minor
                Found in frontend/src/js/controllers/challengeHostTeamsCtrl.js - About 1 hr to fix

                  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
                      Severity
                      Category
                      Status
                      Source
                      Language