Cloud-CV/EvalAI

View on GitHub

Showing 1,371 of 1,371 total issues

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

apps/hosts/migrations/0003_challengehostteam_team_url.py on lines 0..16

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

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

                onSuccess: function(response) {
                    var details = response.data;

                    for (var i = 0; i < details.results.length; i++) {
                        vm.submissionVisibility[details.results[i].id] = details.results[i].is_public;
Severity: Major
Found in frontend/src/js/controllers/challengeCtrl.js - About 2 hrs to fix

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

        var directives = gulp.src('frontend/src/js/directives/*.js')
            .pipe(concat('directives.js'))
            .pipe(gulp_if(production, rename({ suffix: '.min' })))
            .pipe(gulp_if(production, uglify({ mangle: false })))
            .pipe(gulp.dest('frontend/dist/js'))
    Severity: Major
    Found in gulpfile.js and 5 other locations - About 2 hrs to fix
    gulpfile.js on lines 96..100
    gulpfile.js on lines 102..106
    gulpfile.js on lines 108..112
    gulpfile.js on lines 120..124
    gulpfile.js on lines 126..130

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

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

        var configs = gulp.src('frontend/src/js/route-config/*.js')
            .pipe(concat('route-config.js'))
            .pipe(gulp_if(production, rename({ suffix: '.min' })))
            .pipe(gulp_if(production, uglify({ mangle: false })))
            .pipe(gulp.dest('frontend/dist/js'));
    Severity: Major
    Found in gulpfile.js and 5 other locations - About 2 hrs to fix
    gulpfile.js on lines 96..100
    gulpfile.js on lines 108..112
    gulpfile.js on lines 114..118
    gulpfile.js on lines 120..124
    gulpfile.js on lines 126..130

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

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

        var filters = gulp.src('frontend/src/js/filters/*.js')
            .pipe(concat('filters.js'))
            .pipe(gulp_if(production, rename({ suffix: '.min' })))
            .pipe(gulp_if(production, uglify({ mangle: false })))
            .pipe(gulp.dest('frontend/dist/js'));
    Severity: Major
    Found in gulpfile.js and 5 other locations - About 2 hrs to fix
    gulpfile.js on lines 96..100
    gulpfile.js on lines 102..106
    gulpfile.js on lines 108..112
    gulpfile.js on lines 114..118
    gulpfile.js on lines 126..130

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

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

        var controllers = gulp.src('frontend/src/js/controllers/*.js')
            .pipe(concat('controllers.js'))
            .pipe(gulp_if(production, rename({ suffix: '.min' })))
            .pipe(gulp_if(production, uglify({ mangle: false })))
            .pipe(gulp.dest('frontend/dist/js'));
    Severity: Major
    Found in gulpfile.js and 5 other locations - About 2 hrs to fix
    gulpfile.js on lines 96..100
    gulpfile.js on lines 102..106
    gulpfile.js on lines 114..118
    gulpfile.js on lines 120..124
    gulpfile.js on lines 126..130

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

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

        var services = gulp.src('frontend/src/js/services/*.js')
            .pipe(concat('services.js'))
            .pipe(gulp_if(production, rename({ suffix: '.min' })))
            .pipe(gulp_if(production, uglify({ mangle: false })))
            .pipe(gulp.dest('frontend/dist/js'))
    Severity: Major
    Found in gulpfile.js and 5 other locations - About 2 hrs to fix
    gulpfile.js on lines 96..100
    gulpfile.js on lines 102..106
    gulpfile.js on lines 108..112
    gulpfile.js on lines 114..118
    gulpfile.js on lines 120..124

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

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

        var app = gulp.src('frontend/src/js/app.js')
            .pipe(concat('app.js'))
            .pipe(gulp_if(production, rename({ suffix: '.min' })))
            .pipe(gulp_if(production, uglify({ mangle: false })))
            .pipe(gulp.dest('frontend/dist/js'));
    Severity: Major
    Found in gulpfile.js and 5 other locations - About 2 hrs to fix
    gulpfile.js on lines 102..106
    gulpfile.js on lines 108..112
    gulpfile.js on lines 114..118
    gulpfile.js on lines 120..124
    gulpfile.js on lines 126..130

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

    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 utils.py has 279 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import base64
    import json
    import logging
    import os
    import re
    Severity: Minor
    Found in apps/base/utils.py - About 2 hrs to fix

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

          if request.method == "GET":
              subscribers = Subscribers.objects.all().order_by("-pk")
              serializer = SubscribeSerializer(
                  subscribers, many=True, context={"request": request}
              )
      Severity: Major
      Found in apps/web/views.py and 1 other location - About 2 hrs to fix
      apps/web/views.py on lines 180..186

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

      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 request.method == "GET":
              teams = Team.objects.all().order_by("position")
              serializer = TeamSerializer(
                  teams, many=True, context={"request": request}
              )
      Severity: Major
      Found in apps/web/views.py and 1 other location - About 2 hrs to fix
      apps/web/views.py on lines 147..153

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

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

        fetchSubmissions(challenge, phase) {
          const SELF = this;
          let API_PATH;
          if (SELF.filterSubmissionsQuery === '') {
            API_PATH = SELF.endpointsService.allChallengeSubmissionURL(challenge, phase);

        File challenge.service.ts has 276 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import { Injectable } from '@angular/core';
        import { BehaviorSubject } from 'rxjs';
        import { NGXLogger } from 'ngx-logger';
        import { Router } from '@angular/router';
        
        
        Severity: Minor
        Found in frontend_v2/src/app/services/challenge.service.ts - About 2 hrs to fix

          File challenge.component.spec.ts has 276 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import { async, ComponentFixture, TestBed } from '@angular/core/testing';
          import { HeaderStaticComponent } from '../../components/nav/header-static/header-static.component';
          import { ChallengeComponent } from './challenge.component';
          import { ApiService } from '../../services/api.service';
          import { GlobalService } from '../../services/global.service';
          Severity: Minor
          Found in frontend_v2/src/app/components/challenge/challenge.component.spec.ts - About 2 hrs to fix

            Function update_leaderboard_data has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
            Open

            def update_leaderboard_data(request, leaderboard_data_pk):
                """API endpoint to update a metric in leaderboard data
            
                Arguments:
                    request {HttpRequest} -- The request object
            Severity: Minor
            Found in apps/jobs/views.py - About 2 hrs to fix

            Cognitive Complexity

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

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

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

            Further reading

            Function request_challenge_approval_by_pk has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
            Open

            def request_challenge_approval_by_pk(request, challenge_pk):
                """
                Checks if all challenge phases have finished submissions for the given challenge
                and send approval request for the challenge
                """
            Severity: Minor
            Found in apps/challenges/views.py - About 2 hrs to fix

            Cognitive Complexity

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

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

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

            Further reading

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

            export class AboutComponent implements OnInit {
              /**
               * Constructor.
               * @param globalService  GlobalService Injection.
               */
            Severity: Major
            Found in frontend_v2/src/app/components/about/about.component.ts and 1 other location - About 2 hrs to fix
            frontend_v2/src/app/components/get-involved/get-involved.component.ts on lines 12..25

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

            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

            @Component({
              selector: 'app-challengeviewallsubmissions',
              templateUrl: './challengeviewallsubmissions.component.html',
              styleUrls: ['./challengeviewallsubmissions.component.scss'],
              animations: [
            frontend_v2/src/app/components/challenge/challengesubmissions/challengesubmissions.component.ts on lines 22..659

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

            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

            export class GetInvolvedComponent implements OnInit {
              /**
               * Constructor.
               * @param globalService  GlobalService Injection.
               */
            frontend_v2/src/app/components/about/about.component.ts on lines 12..25

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

            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

            @Component({
              selector: 'app-challengesubmissions',
              templateUrl: './challengesubmissions.component.html',
              styleUrls: ['./challengesubmissions.component.scss'],
              animations: [
            frontend_v2/src/app/components/challenge/challengeviewallsubmissions/challengeviewallsubmissions.component.ts on lines 19..664

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

            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