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

  beforeEach(async(() => {
    TestBed.configureTestingModule({
      declarations: [PrivacyPolicyComponent, HeaderStaticComponent, FooterComponent],
      providers: [GlobalService, AuthService, ApiService, EndpointsService],
      imports: [HttpClientModule, RouterTestingModule],
frontend_v2/src/app/components/about/about.component.spec.ts on lines 19..25
frontend_v2/src/app/components/get-involved/get-involved.component.spec.ts on lines 22..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 62.

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 (data.next === null) {
            SELF.paginationDetails.isNext = 'disabled';
            SELF.paginationDetails.currentPage = Math.ceil(data.count / 100);
          } else {
            SELF.paginationDetails.isNext = '';
frontend_v2/src/app/components/challenge/challengesubmissions/challengesubmissions.component.ts on lines 303..309

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

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

  constructor(
    private challengeService: ChallengeService,
    private globalService: GlobalService,
    private apiService: ApiService,
    private endpointsService: EndpointsService,
frontend_v2/src/app/components/challenge/challengeanalytics/challengeanalytics.component.ts on lines 57..64
frontend_v2/src/app/components/challenge/challengediscuss/challengediscuss.component.ts on lines 46..53

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

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 (data.next === null) {
          SELF.paginationDetails.isNext = 'disabled';
          SELF.paginationDetails.currentPage = 1;
        } else {
          SELF.paginationDetails.isNext = '';
frontend_v2/src/app/components/challenge/challengesubmissions/challengesubmissions.component.ts on lines 370..376

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

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

  constructor(
    private authService: AuthService,
    private router: Router,
    private challengeService: ChallengeService,
    private globalService: GlobalService,
frontend_v2/src/app/components/challenge/challengeanalytics/challengeanalytics.component.ts on lines 57..64
frontend_v2/src/app/components/challenge/challengesettings/challengesettings.component.ts on lines 224..231

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

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

  constructor(
    private apiService: ApiService,
    private globalService: GlobalService,
    private endpointService: EndpointsService,
    private challengeService: ChallengeService,
frontend_v2/src/app/components/challenge/challengediscuss/challengediscuss.component.ts on lines 46..53
frontend_v2/src/app/components/challenge/challengesettings/challengesettings.component.ts on lines 224..231

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

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

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

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

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

Refactorings

Further Reading

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

                    if "default_order_by" not in data["schema"]:
                        message = self.error_messages_dict.get(
                            "missing_leaderboard_default_order_by"
                        ).format(data.get("id"))
                        self.error_messages.append(message)
Severity: Major
Found in apps/challenges/challenge_config_utils.py and 2 other locations - About 1 hr to fix
apps/challenges/challenge_config_utils.py on lines 584..589
apps/challenges/challenge_config_utils.py on lines 591..596

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

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 get_members(self, obj):
        participants = Participant.objects.filter(team__pk=obj.id)
        serializer = ParticipantSerializer(participants, many=True)
        return serializer.data
Severity: Major
Found in apps/participants/serializers.py and 1 other location - About 1 hr to fix
apps/hosts/serializers.py on lines 91..94

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

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

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

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

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

Refactorings

Further Reading

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

                    if "labels" not in data["schema"]:
                        message = self.error_messages_dict.get(
                            "missing_leaderboard_labels"
                        ).format(data.get("id"))
                        self.error_messages.append(message)
Severity: Major
Found in apps/challenges/challenge_config_utils.py and 2 other locations - About 1 hr to fix
apps/challenges/challenge_config_utils.py on lines 584..589
apps/challenges/challenge_config_utils.py on lines 597..602

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

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 submission_status not in [
            Submission.FAILED,
            Submission.CANCELLED,
            Submission.FINISHED,
        ]:
Severity: Major
Found in apps/jobs/views.py and 1 other location - About 1 hr to fix
apps/jobs/views.py on lines 1689..1695

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

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 submission_status not in [
            Submission.RUNNING,
            Submission.PARTIALLY_EVALUATED,
            Submission.FINISHED,
        ]:
Severity: Major
Found in apps/jobs/views.py and 1 other location - About 1 hr to fix
apps/jobs/views.py on lines 1138..1144

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

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

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

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

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

Refactorings

Further Reading

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

                if "schema" not in data:
                    message = self.error_messages_dict.get(
                        "missing_leaderboard_schema"
                    ).format(data.get("id"))
                    self.error_messages.append(message)
Severity: Major
Found in apps/challenges/challenge_config_utils.py and 2 other locations - About 1 hr to fix
apps/challenges/challenge_config_utils.py on lines 591..596
apps/challenges/challenge_config_utils.py on lines 597..602

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

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 get_members(self, obj):
        hosts = ChallengeHost.objects.filter(team_name_id=obj.id)
        serializer = ChallengeHostSerializer(hosts, many=True)
        return serializer.data
Severity: Major
Found in apps/hosts/serializers.py and 1 other location - About 1 hr to fix
apps/participants/serializers.py on lines 116..119

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

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

        vm.editChallengeTitle = function(editChallengeTitleForm) {
            if (editChallengeTitleForm) {
                var challengeHostList = utilities.getData("challengeCreator");
                for (var challenge in challengeHostList) {
                    if (challenge == vm.challengeId) {
Severity: Minor
Found in frontend/src/js/controllers/challengeCtrl.js - About 1 hr to fix

    Function dynHeader has 33 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function dynHeader() {
            var directive = {
                link: link,
                templateUrl: 'dist/views/web/partials/main-header.html',
                transclude: true,
    Severity: Minor
    Found in frontend/src/js/directives/directives.js - About 1 hr to fix

      Function start has 33 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                  vm.start = function() {
                      vm.stopFetchingSubmissions();
                      vm.poller = $interval(function() {
                          parameters.url = "jobs/challenge/" + vm.challengeId + "/challenge_phase/" + vm.phaseId + "/submission/?page=" + Math.ceil(vm.currentPage);
                          parameters.method = 'GET';
      Severity: Minor
      Found in frontend/src/js/controllers/challengeCtrl.js - About 1 hr to fix

        Function editChallengeOverview has 33 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                vm.editChallengeOverview = function(editChallengeOverviewForm) {
                    if (editChallengeOverviewForm) {
                        var challengeHostList = utilities.getData("challengeCreator");
                        for (var challenge in challengeHostList) {
                            if (challenge == vm.challengeId) {
        Severity: Minor
        Found in frontend/src/js/controllers/challengeCtrl.js - About 1 hr to fix

          Function editEvaluationCriteria has 33 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  vm.editEvaluationCriteria = function(editEvaluationCriteriaForm) {
                      if (editEvaluationCriteriaForm) {
                          var challengeHostList = utilities.getData("challengeCreator");
                          for (var challenge in challengeHostList) {
                              if (challenge == vm.challengeId) {
          Severity: Minor
          Found in frontend/src/js/controllers/challengeCtrl.js - About 1 hr to fix

            Function editTermsAndConditions has 33 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    vm.editTermsAndConditions = function(editTermsAndConditionsForm) {
                        if (editTermsAndConditionsForm) {
                            var challengeHostList = utilities.getData("challengeCreator");
                            for (var challenge in challengeHostList) {
                                if (challenge == vm.challengeId) {
            Severity: Minor
            Found in frontend/src/js/controllers/challengeCtrl.js - About 1 hr to fix

              Function editSubmissionGuideline has 33 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      vm.editSubmissionGuideline = function(editSubmissionGuidelinesForm) {
                          if (editSubmissionGuidelinesForm) {
                              var challengeHostList = utilities.getData("challengeCreator");
                              for (var challenge in challengeHostList) {
                                  if (challenge == vm.challengeId) {
              Severity: Minor
              Found in frontend/src/js/controllers/challengeCtrl.js - About 1 hr to fix
                Severity
                Category
                Status
                Source
                Language