Cloud-CV/EvalAI

View on GitHub

Showing 1,371 of 1,371 total issues

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

        vm.editChallengeOverview = function(editChallengeOverviewForm) {
            if (editChallengeOverviewForm) {
                var challengeHostList = utilities.getData("challengeCreator");
                for (var challenge in challengeHostList) {
                    if (challenge == vm.challengeId) {
Severity: Major
Found in frontend/src/js/controllers/challengeCtrl.js and 3 other locations - About 1 day to fix
frontend/src/js/controllers/challengeCtrl.js on lines 2521..2557
frontend/src/js/controllers/challengeCtrl.js on lines 2571..2607
frontend/src/js/controllers/challengeCtrl.js on lines 2680..2714

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

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

        vm.editSubmissionGuideline = function(editSubmissionGuidelinesForm) {
            if (editSubmissionGuidelinesForm) {
                var challengeHostList = utilities.getData("challengeCreator");
                for (var challenge in challengeHostList) {
                    if (challenge == vm.challengeId) {
Severity: Major
Found in frontend/src/js/controllers/challengeCtrl.js and 3 other locations - About 1 day to fix
frontend/src/js/controllers/challengeCtrl.js on lines 2432..2468
frontend/src/js/controllers/challengeCtrl.js on lines 2571..2607
frontend/src/js/controllers/challengeCtrl.js on lines 2680..2714

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

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

        vm.editTermsAndConditions = function(editTermsAndConditionsForm) {
            if (editTermsAndConditionsForm) {
                var challengeHostList = utilities.getData("challengeCreator");
                for (var challenge in challengeHostList) {
                    if (challenge == vm.challengeId) {
Severity: Major
Found in frontend/src/js/controllers/challengeCtrl.js and 3 other locations - About 1 day to fix
frontend/src/js/controllers/challengeCtrl.js on lines 2432..2468
frontend/src/js/controllers/challengeCtrl.js on lines 2521..2557
frontend/src/js/controllers/challengeCtrl.js on lines 2571..2607

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

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

        vm.editEvaluationCriteria = function(editEvaluationCriteriaForm) {
            if (editEvaluationCriteriaForm) {
                var challengeHostList = utilities.getData("challengeCreator");
                for (var challenge in challengeHostList) {
                    if (challenge == vm.challengeId) {
Severity: Major
Found in frontend/src/js/controllers/challengeCtrl.js and 3 other locations - About 1 day to fix
frontend/src/js/controllers/challengeCtrl.js on lines 2432..2468
frontend/src/js/controllers/challengeCtrl.js on lines 2521..2557
frontend/src/js/controllers/challengeCtrl.js on lines 2680..2714

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

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

File submission_worker.py has 771 lines of code (exceeds 250 allowed). Consider refactoring.
Open

from __future__ import (absolute_import, division, print_function,
                        unicode_literals)

import contextlib
import importlib
Severity: Major
Found in scripts/workers/submission_worker.py - About 1 day to fix

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

                            if (url !== null) {
    
                                //store the header data in a variable
                                var headers = {
                                    'Authorization': "Token " + userKey
    Severity: Major
    Found in frontend/src/js/controllers/challengeCtrl.js and 1 other location - About 1 day to fix
    frontend/src/js/controllers/challengeCtrl.js on lines 1362..1395

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

    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

                            if (url !== null) {
    
                                //store the header data in a variable
                                var headers = {
                                    'Authorization': "Token " + userKey
    Severity: Major
    Found in frontend/src/js/controllers/challengeCtrl.js and 1 other location - About 1 day to fix
    frontend/src/js/controllers/challengeCtrl.js on lines 1854..1887

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

    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

      editChallengeTermsAndConditionsUpload() {
        const SELF = this;
        SELF.apiCall = (params) => {
          const FORM_DATA: FormData = new FormData();
          FORM_DATA.append('terms_and_conditions_file', params['terms_and_conditions_file']);
    frontend_v2/src/app/components/challenge/challengesettings/challengesettings.component.ts on lines 416..460
    frontend_v2/src/app/components/challenge/challengesettings/challengesettings.component.ts on lines 514..559

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

    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

      editEvaluationCriteriaUpload() {
        const SELF = this;
        SELF.apiCall = (params) => {
          const FORM_DATA: FormData = new FormData();
          FORM_DATA.append('evaluation_criteria_file', params['evaluation_criteria_file']);
    frontend_v2/src/app/components/challenge/challengesettings/challengesettings.component.ts on lines 416..460
    frontend_v2/src/app/components/challenge/challengesettings/challengesettings.component.ts on lines 465..509

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

    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

      editChallengeOverviewUpload() {
        const SELF = this;
        SELF.apiCall = (params) => {
          const FORM_DATA: FormData = new FormData();
          FORM_DATA.append('overview_file', params['overview_file']);
    frontend_v2/src/app/components/challenge/challengesettings/challengesettings.component.ts on lines 465..509
    frontend_v2/src/app/components/challenge/challengesettings/challengesettings.component.ts on lines 514..559

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

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

        function TeamsCtrl(utilities,loaderService, $scope, $state, $http, $rootScope, $mdDialog) {
            var vm = this;
            var userKey = utilities.getData('userKey');
            var challengePk = 1;
    
    
    Severity: Major
    Found in frontend/src/js/controllers/teamsCtrl.js - About 1 day to fix

      File code_upload_submission_worker.py has 729 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import json
      import logging
      import os
      import signal
      import sys
      Severity: Major
      Found in scripts/workers/code_upload_submission_worker.py - About 1 day to fix

        Function ChallengeHostTeamsCtrl has 328 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function ChallengeHostTeamsCtrl(utilities, loaderService, $scope, $state, $http, $rootScope, $mdDialog) {
                var vm = this;
                var userKey = utilities.getData('userKey');
        
                utilities.showLoader();
        Severity: Major
        Found in frontend/src/js/controllers/challengeHostTeamsCtrl.js - About 1 day to fix

          Function AuthCtrl has 320 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function AuthCtrl(utilities, $state, $rootScope) {
                  var vm = this;
                  // condition for showing password strength
                  vm.showPasswordStrength = false;
                  vm.isRem = false;
          Severity: Major
          Found in frontend/src/js/controllers/authCtrl.js - About 1 day to fix

            Function update_submission has a Cognitive Complexity of 80 (exceeds 5 allowed). Consider refactoring.
            Open

            def update_submission(request, challenge_pk):
                """
                API endpoint to update submission related attributes
            
                Query Parameters:
            Severity: Minor
            Found in apps/jobs/views.py - About 1 day 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 profileCtrl has 316 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function profileCtrl(utilities, $rootScope, $scope, $mdDialog, moment, $state) {
                    var vm = this;
            
                    vm.user = {};
                    vm.countLeft = 0;
            Severity: Major
            Found in frontend/src/js/controllers/profileCtrl.js - About 1 day to fix

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

                 cancelSubmission(submission) {
                  const SELF = this;
                  if (submission.status != "submitted") {
                    SELF.globalService.showToast('error', 'Only unproccessed submissions can be cancelled', 5);
                    return;
              frontend_v2/src/app/components/challenge/challengeviewallsubmissions/challengeviewallsubmissions.component.ts on lines 623..663

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

              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

                cancelSubmission(submission) {
                  const SELF = this;
                  if (submission.status != "submitted") {
                    SELF.globalService.showToast('error', 'Only unproccessed submissions can be cancelled', 5);
                    return;
              frontend_v2/src/app/components/challenge/challengesubmissions/challengesubmissions.component.ts on lines 598..638

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

              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

              File route-config.js has 680 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              /**
               * Config for the router
               */
              
              (function () {
              Severity: Major
              Found in frontend/src/js/route-config/route-config.js - About 1 day to fix

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

                  editEvaluationCriteria() {
                    const SELF = this;
                    SELF.apiCall = (params) => {
                      const BODY = JSON.stringify(params);
                      SELF.apiService
                frontend_v2/src/app/components/challenge/challengesettings/challengesettings.component.ts on lines 650..683

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

                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

                Severity
                Category
                Status
                Source
                Language