Cloud-CV/EvalAI

View on GitHub

Showing 1,371 of 1,371 total issues

Function toggleSubmissionVisibility has 49 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  toggleSubmissionVisibility() {
    const SELF = this;
    if (SELF.isLeaderboardPublic === true) {
      let toggleSubmissionVisibilityState, isSubmissionPublic;
      if (SELF.submissionVisibility.state === 'Public') {

    Function downloadChallengeSubmissions has 48 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            vm.downloadChallengeSubmissions = function() {
                if (vm.phaseId) {
                    parameters.url = "challenges/" + vm.challengeId + "/phase/" + vm.phaseId + "/download_all_submissions/" + vm.fileSelected + "/";
                    if (vm.fieldsToGet === undefined || vm.fieldsToGet.length === 0) {
                        parameters.method = "GET";
    Severity: Minor
    Found in frontend/src/js/controllers/challengeCtrl.js - About 1 hr to fix

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

      module.exports = function(config) {
        var configuration = {
      
          // base path that will be used to resolve all patterns (eg. files, exclude)
          basePath: '',
      Severity: Minor
      Found in karma.conf.js - About 1 hr to fix

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

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

          Function deregister_participant_team_from_challenge has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
          Open

          def deregister_participant_team_from_challenge(request, challenge_pk):
              """
              Deregister a participant team from a challenge
              Arguments:
                  challenge_pk {int} -- Challenge primary key
          Severity: Minor
          Found in apps/challenges/views.py - About 1 hr 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 get_or_create_sqs_queue has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
          Open

          def get_or_create_sqs_queue(queue_name, challenge=None):
              """
              Args:
                  queue_name: Name of the SQS Queue
              Returns:
          Severity: Minor
          Found in apps/jobs/sender.py - About 1 hr 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 check_prizes has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
          Open

              def check_prizes(self):
                  # Verify Prizes are correct
                  if "prizes" in self.yaml_file_data:
                      rank_set = set()
                      for prize in self.yaml_file_data["prizes"]:
          Severity: Minor
          Found in apps/challenges/challenge_config_utils.py - About 1 hr 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 15 (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

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

                  migrations.AddField(
                      model_name="challengeevaluationcluster",
                      name="efs_mount_target_ids",
                      field=django.contrib.postgres.fields.ArrayField(
                          base_field=models.CharField(blank=True, max_length=256),
          apps/challenges/migrations/0075_add_list_as_default_value_in_email_ids_or_domains.py on lines 15..19
          apps/challenges/migrations/0075_add_list_as_default_value_in_email_ids_or_domains.py on lines 36..40

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

          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

          def get_boto3_client(resource, aws_keys):
              client = boto3.client(
                  resource,
                  region_name=aws_keys["AWS_REGION"],
                  aws_access_key_id=aws_keys["AWS_ACCESS_KEY_ID"],
          Severity: Major
          Found in scripts/monitoring/auto_scale_ec2_workers.py and 1 other location - About 1 hr to fix
          scripts/monitoring/auto_scale_eks_nodes.py on lines 43..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 49.

          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="allowed_email_domains",
                      field=django.contrib.postgres.fields.ArrayField(
                          base_field=models.CharField(blank=True, max_length=50),
          apps/challenges/migrations/0075_add_list_as_default_value_in_email_ids_or_domains.py on lines 36..40
          apps/challenges/migrations/0081_add_efs_mount_meta_fields.py on lines 24..28

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

          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

          def get_boto3_client(resource, aws_keys):
              client = boto3.client(
                  resource,
                  region_name=aws_keys["AWS_REGION"],
                  aws_access_key_id=aws_keys["AWS_ACCESS_KEY_ID"],
          Severity: Major
          Found in scripts/monitoring/auto_scale_eks_nodes.py and 1 other location - About 1 hr to fix
          scripts/monitoring/auto_scale_ec2_workers.py on lines 20..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 49.

          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="blocked_email_domains",
                      field=django.contrib.postgres.fields.ArrayField(
                          base_field=models.CharField(blank=True, max_length=50),
          apps/challenges/migrations/0075_add_list_as_default_value_in_email_ids_or_domains.py on lines 15..19
          apps/challenges/migrations/0081_add_efs_mount_meta_fields.py on lines 24..28

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

          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

              try:
                  leaderboard_data = LeaderboardData.objects.get(pk=leaderboard_data_pk, is_disabled=False)
              except LeaderboardData.DoesNotExist:
                  response_data = {"error": "Leaderboard data does not exist"}
                  return Response(response_data, status=status.HTTP_404_NOT_FOUND)
          Severity: Major
          Found in apps/jobs/views.py and 1 other location - About 1 hr to fix
          apps/jobs/views.py on lines 146..152

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

          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

                  migrations.AddField(
                      model_name="challenge",
                      name="allowed_email_domains",
                      field=django.contrib.postgres.fields.ArrayField(
                          base_field=models.CharField(blank=True, max_length=50),
          apps/challenges/migrations/0034_add_allow_block_domain_fields.py on lines 26..30

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

          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

              try:
                  challenge_phase = ChallengePhase.objects.get(
                      pk=challenge_phase_id, challenge=challenge
                  )
              except ChallengePhase.DoesNotExist:
          Severity: Major
          Found in apps/jobs/views.py and 1 other location - About 1 hr to fix
          apps/jobs/views.py on lines 2305..2309

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

          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

                  migrations.AddField(
                      model_name="challenge",
                      name="blocked_email_domains",
                      field=django.contrib.postgres.fields.ArrayField(
                          base_field=models.CharField(blank=True, max_length=50),
          apps/challenges/migrations/0034_add_allow_block_domain_fields.py on lines 16..20

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

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

              function HostedChallengesCtrl(utilities) {
                  var vm = this;
                  var userKey = utilities.getData('userKey');
          
                  utilities.showLoader();
          Severity: Minor
          Found in frontend/src/js/controllers/hostedChallengeCtrl.js - About 1 hr to fix

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

              ngOnInit() {
                this.globalService.startLoader('');
                const SELF = this;
                if (this.authService.isLoggedIn()) {
                  this.isLoggedIn = true;
            Severity: Minor
            Found in frontend_v2/src/app/components/challenge/challenge.component.ts - About 1 hr to fix

              Function resetPasswordConfirm has 47 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                resetPasswordConfirm(resetconfirmFormValid) {
                  if (resetconfirmFormValid) {
                    this.globalService.startLoader('Resetting Your Password');
              
                    const RESET_BODY = JSON.stringify({
                Severity
                Category
                Status
                Source
                Language