Cloud-CV/EvalAI

View on GitHub

Showing 1,371 of 1,371 total issues

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

    SELF.apiCall = (params) => {
      let BODY = JSON.parse(JSON.stringify(params));
      if (this.selectedPhase.submission_meta_attributes !== null && this.selectedPhase.submission_meta_attributes !== undefined) {
        BODY["submission_metadata"] = [] 
        for (let idx=0; idx < this.selectedPhase.submission_meta_attributes.length; idx++) {

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

      displayDockerSubmissionInstructions(challenge, isParticipated) {
        if (isParticipated) {
          const API_PATH = this.endpointsService.challengeSubmissionsRemainingURL(challenge);
          const SELF = this;
          this.apiService.getUrl(API_PATH).subscribe(

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

                  onError: function (response) {
                      vm.data = response.data;
                      $state.go('error-404');
                      $rootScope.notify('error', vm.data.error);
                  }
      Severity: Major
      Found in frontend/src/js/controllers/SubmissionFilesCtrl.js and 1 other location - About 1 hr to fix
      frontend/src/js/controllers/ChallengeInviteCtrl.js on lines 60..64

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

      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

              vm.stopLoader = function() {
                  $rootScope.isLoader = false;
                  $rootScope.loaderTitle = '';
                  vm.updateprofileContainer.removeClass('low-screen');
              };
      Severity: Major
      Found in frontend/src/js/controllers/updateProfileCtrl.js and 2 other locations - About 1 hr to fix
      frontend/src/js/controllers/authCtrl.js on lines 52..56
      frontend/src/js/controllers/changePwdCtrl.js on lines 34..38

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

      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

              vm.stopLoader = function() {
                  $rootScope.isLoader = false;
                  $rootScope.loaderTitle = '';
                  vm.loginContainer.removeClass('low-screen');
              };
      Severity: Major
      Found in frontend/src/js/controllers/authCtrl.js and 2 other locations - About 1 hr to fix
      frontend/src/js/controllers/changePwdCtrl.js on lines 34..38
      frontend/src/js/controllers/updateProfileCtrl.js on lines 30..34

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

      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

              vm.stopLoader = function() {
                  $rootScope.isLoader = false;
                  $rootScope.loaderTitle = '';
                  vm.changepassContainer.removeClass('low-screen');
              };
      Severity: Major
      Found in frontend/src/js/controllers/changePwdCtrl.js and 2 other locations - About 1 hr to fix
      frontend/src/js/controllers/authCtrl.js on lines 52..56
      frontend/src/js/controllers/updateProfileCtrl.js on lines 30..34

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

      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

                  onError: function (response) {
                      vm.data = response.data;
                      $state.go('error-404');
                      $rootScope.notify('error', vm.data.error);
                  }
      Severity: Major
      Found in frontend/src/js/controllers/ChallengeInviteCtrl.js and 1 other location - About 1 hr to fix
      frontend/src/js/controllers/SubmissionFilesCtrl.js on lines 32..36

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

      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

        constructor(
          private globalService: GlobalService,
          private apiService: ApiService,
          public authService: AuthService,
          private router: Router,
      frontend_v2/src/app/components/auth/signup/signup.component.ts on lines 44..50
      frontend_v2/src/app/components/contact/contact.component.ts on lines 48..54
      frontend_v2/src/app/components/home/featured-challenges/featured-challenges.component.ts on lines 36..42

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

      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

          this.globalModalSubscription = this.globalService.currentModalParams.subscribe((params) => {
            setTimeout(() => {
              this.modalParams = params;
            }, 0);
          });
      Severity: Major
      Found in frontend_v2/src/app/app.component.ts and 2 other locations - About 1 hr to fix
      frontend_v2/src/app/app.component.ts on lines 90..94
      frontend_v2/src/app/app.component.ts on lines 95..99

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

      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

          this.globalConfirmSubscription = this.globalService.currentConfirmParams.subscribe((params) => {
            setTimeout(() => {
              this.confirmParams = params;
            }, 0);
          });
      Severity: Major
      Found in frontend_v2/src/app/app.component.ts and 2 other locations - About 1 hr to fix
      frontend_v2/src/app/app.component.ts on lines 90..94
      frontend_v2/src/app/app.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 57.

      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

        constructor(
          private globalService: GlobalService,
          private apiService: ApiService,
          private router: Router,
          private endpointsService: EndpointsService,
      frontend_v2/src/app/components/auth/login/login.component.ts on lines 53..59
      frontend_v2/src/app/components/auth/signup/signup.component.ts on lines 44..50
      frontend_v2/src/app/components/home/featured-challenges/featured-challenges.component.ts on lines 36..42

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

      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 (e.target.name === 'new_password1') {
            this.newPassword = e.target.value;
            if (e.target.value === this.oldPassword) {
              this.inputErrorMessage = 'Old password cannot be same as New Password';
            }
      frontend_v2/src/app/components/utility/modal/modal.component.ts on lines 365..370

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

      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 (e.target.name === 'new_password2') {
            this.retype_newPassword = e.target.value;
            if (e.target.value !== this.newPassword) {
              this.inputErrorMessage = 'Password do not match';
            }
      frontend_v2/src/app/components/utility/modal/modal.component.ts on lines 360..370

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

      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

        constructor(
          private globalService: GlobalService,
          private apiService: ApiService,
          public authService: AuthService,
          private endpointsService: EndpointsService,
      frontend_v2/src/app/components/auth/login/login.component.ts on lines 53..59
      frontend_v2/src/app/components/contact/contact.component.ts on lines 48..54
      frontend_v2/src/app/components/home/featured-challenges/featured-challenges.component.ts on lines 36..42

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

      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

        constructor(
          private endpointsService: EndpointsService,
          private router: Router,
          private globalService: GlobalService,
          private apiService: ApiService,
      frontend_v2/src/app/components/auth/login/login.component.ts on lines 53..59
      frontend_v2/src/app/components/auth/signup/signup.component.ts on lines 44..50
      frontend_v2/src/app/components/contact/contact.component.ts on lines 48..54

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

      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

          this.globalLoadingSubscription = this.globalService.currentisLoading.subscribe((isLoading) => {
            setTimeout(() => {
              this.isLoading = isLoading;
            }, 0);
          });
      Severity: Major
      Found in frontend_v2/src/app/app.component.ts and 2 other locations - About 1 hr to fix
      frontend_v2/src/app/app.component.ts on lines 95..99
      frontend_v2/src/app/app.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 57.

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

      def make_team_name_unique():
          participant_team_list = []
          host_team_list = []
          participant_team_iter = 1
      
      
      Severity: Minor
      Found in scripts/migration/set_team_name_unique.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 update_submission_meta has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

      def update_submission_meta(request, challenge_pk, submission_pk):
          """
          Common API Endpoint for updating the submission meta data for hosts and participants.
          """
      
      
      Severity: Minor
      Found in apps/jobs/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 handle_submission_resume has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

      def handle_submission_resume(submission, updated_status):
          """
          Function to handle the submission resuming. It is handled in the following way -
          1. Change the submissions status to resumed
      
      
      Severity: Minor
      Found in apps/jobs/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 setup_eks_cluster has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

      def setup_eks_cluster(challenge):
          """
          Creates EKS and NodeGroup ARN roles
      
          Arguments:
      Severity: Minor
      Found in apps/challenges/aws_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

      Severity
      Category
      Status
      Source
      Language