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

apps/challenges/migrations/0044_add_field_to_allow_email_ids_in_challenge_phase.py on lines 0..20
apps/challenges/migrations/0054_add_banned_email_ids_field.py on lines 0..18

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

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

apps/challenges/migrations/0044_add_field_to_allow_email_ids_in_challenge_phase.py on lines 0..20
apps/jobs/migrations/0013_add_job_id_field_in_submission_model.py on lines 0..18

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

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

apps/challenges/migrations/0054_add_banned_email_ids_field.py on lines 0..18
apps/jobs/migrations/0013_add_job_id_field_in_submission_model.py on lines 0..18

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

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 (vm.hasPrizes) {
                    parameters.url = 'challenges/challenge/' + vm.challengeId + '/prizes/';
                    parameters.method = 'GET';
                    parameters.data = {};
                    parameters.callback = {
Severity: Major
Found in frontend/src/js/controllers/challengeCtrl.js and 1 other location - About 4 hrs to fix
frontend/src/js/controllers/challengeCtrl.js on lines 426..440

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

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 (vm.has_sponsors) {
                    parameters.url = 'challenges/challenge/' + vm.challengeId + '/sponsors/';
                    parameters.method = 'GET';
                    parameters.data = {};
                    parameters.callback = {
Severity: Major
Found in frontend/src/js/controllers/challengeCtrl.js and 1 other location - About 4 hrs to fix
frontend/src/js/controllers/challengeCtrl.js on lines 408..422

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

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

        vm.getLeaderboard = function(phaseSplitId) {
            vm.stopLeaderboard = function() {
                $interval.cancel(vm.poller);
            };
            vm.stopLeaderboard();
Severity: Major
Found in frontend/src/js/controllers/challengeCtrl.js - About 4 hrs to fix

    GlobalService has 37 functions (exceeds 20 allowed). Consider refactoring.
    Open

    @Injectable()
    export class GlobalService {
      scrolledStateDefault = false;
      toastErrorCodes = [400, 500];
      authStorageKey = 'authtoken';
    Severity: Minor
    Found in frontend_v2/src/app/services/global.service.ts - About 4 hrs to fix

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

      def start_job():
          evalai_interface = create_evalai_interface(auth_token, evalai_endpoint)
          response = evalai_interface.get_challenges()
          start_or_stop_workers_for_challenges(response, evalai_interface)
          next_page = response["next"]
      Severity: Major
      Found in scripts/monitoring/auto_scale_ec2_workers.py and 1 other location - About 4 hrs to fix
      scripts/monitoring/auto_scale_workers.py on lines 120..128

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

      def start_job():
          evalai_interface = create_evalai_interface(auth_token, evalai_endpoint)
          response = evalai_interface.get_challenges()
          scale_up_or_down_workers_for_challenges(response, evalai_interface)
          next_page = response["next"]
      Severity: Major
      Found in scripts/monitoring/auto_scale_workers.py and 1 other location - About 4 hrs to fix
      scripts/monitoring/auto_scale_ec2_workers.py on lines 114..122

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

          function utilities($http, EnvironmentConfig) {
      
              // factory for API calls
              this.sendRequest = function(parameters, header, type) {
                  var url = EnvironmentConfig.API + parameters.url;
      Severity: Major
      Found in frontend/src/js/services/services.js - About 4 hrs to fix

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

                                onSuccess: function(response) {
                                    var details = response.data;
                                    vm.currentDate = details.datetime_now;
                                    for (var i in details.challenge_participant_team_list) {
                                        if (details.challenge_participant_team_list[i].challenge !== null && details.challenge_participant_team_list[i].challenge.id == vm.challengeId) {
        Severity: Major
        Found in frontend/src/js/controllers/challengeCtrl.js - About 4 hrs to fix

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

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

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

                                parameters.callback = {
                                    onSuccess: function(response) {
                                        var details = response.data;
                                        var anchor = angular.element('<a/>');
                                        anchor.attr({
            Severity: Major
            Found in frontend/src/js/controllers/challengeCtrl.js and 1 other location - About 4 hrs to fix
            frontend/src/js/controllers/challengeCtrl.js on lines 2178..2191

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

            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

                                parameters.callback = {
                                    onSuccess: function(response) {
                                        var details = response.data;
                                        var anchor = angular.element('<a/>');
                                        anchor.attr({
            Severity: Major
            Found in frontend/src/js/controllers/challengeCtrl.js and 1 other location - About 4 hrs to fix
            frontend/src/js/controllers/challengeCtrl.js on lines 2203..2216

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

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

                function updateProfileCtrl(utilities, $state, $rootScope) {
                    var vm = this;
                    var userKey = utilities.getData('userKey');
                    vm.wrnMsg = {};
                    vm.isValid = {};
            Severity: Major
            Found in frontend/src/js/controllers/updateProfileCtrl.js - About 4 hrs to fix

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

                              onError: function(response) {
                                  utilities.hideLoader();
                                  var status = response.status;
                                  var error = response.data;
                                  if (status == 403) {
              Severity: Major
              Found in frontend/src/js/controllers/dashCtrl.js and 2 other locations - About 4 hrs to fix
              frontend/src/js/controllers/dashCtrl.js on lines 119..133
              frontend/src/js/controllers/dashCtrl.js on lines 151..165

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

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

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

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

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

              Refactorings

              Further Reading

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

                          onError: function(response) {
                              utilities.hideLoader();
                              var status = response.status;
                              var error = response.data;
                              if (status == 403) {
              Severity: Major
              Found in frontend/src/js/controllers/dashCtrl.js and 2 other locations - About 4 hrs to fix
              frontend/src/js/controllers/dashCtrl.js on lines 81..95
              frontend/src/js/controllers/dashCtrl.js on lines 119..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 127.

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

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

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

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

              Refactorings

              Further Reading

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

                          onError: function(response) {
                              utilities.hideLoader();
                              var status = response.status;
                              var error = response.data;
                              if (status == 403) {
              Severity: Major
              Found in frontend/src/js/controllers/dashCtrl.js and 2 other locations - About 4 hrs to fix
              frontend/src/js/controllers/dashCtrl.js on lines 81..95
              frontend/src/js/controllers/dashCtrl.js on lines 151..165

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

              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 run_submission has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
              Open

              def run_submission(
                  challenge_id, challenge_phase, submission, user_annotation_file_path
              ):
                  """
                  * receives a challenge id, phase id and user annotation file path
              Severity: Minor
              Found in scripts/workers/submission_worker.py - About 4 hrs to fix

              Cognitive Complexity

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

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

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

              Further reading

              Function ngOnInit has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
              Open

                ngOnInit() {
                  if (this.params) {
                    if (this.params['title']) {
                      this.title = this.params['title'];
                    }

              Cognitive Complexity

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

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

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

              Further reading

              Severity
              Category
              Status
              Source
              Language