Cloud-CV/EvalAI

View on GitHub

Showing 1,371 of 1,371 total issues

Function ChallengeCtrl has 2776 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function ChallengeCtrl(utilities, loaderService, $scope, $state, $http, $stateParams, $rootScope, $interval, $mdDialog, moment, $location, $anchorScroll, $timeout) {
        var vm = this;
        vm.areSubmissionsFailing = false;
        vm.getAllEntriesTestOption = "Include private submissions";
        vm.showPrivateIds = [];
Severity: Major
Found in frontend/src/js/controllers/challengeCtrl.js - About 1 wk to fix

    File views.py has 4348 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import csv
    import json
    import logging
    import os
    import pytz
    Severity: Major
    Found in apps/challenges/views.py - About 1 wk to fix

      File challengeCtrl.js has 2785 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      // Invoking IIFE for challenge page
      (function() {
      
          'use strict';
          angular
      Severity: Major
      Found in frontend/src/js/controllers/challengeCtrl.js - About 1 wk to fix

        File views.py has 2694 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import botocore
        import datetime
        import json
        import logging
        import os
        Severity: Major
        Found in apps/jobs/views.py - About 1 wk to fix

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

          @swagger_auto_schema(
              methods=["put"],
              manual_parameters=[
                  openapi.Parameter(
                      name="challenge_pk",
          Severity: Major
          Found in apps/jobs/views.py and 1 other location - About 4 days to fix
          apps/jobs/views.py on lines 955..1079

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

          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

          @swagger_auto_schema(
              methods=["put"],
              manual_parameters=[
                  openapi.Parameter(
                      name="challenge_pk",
          Severity: Major
          Found in apps/jobs/views.py and 1 other location - About 4 days to fix
          apps/jobs/views.py on lines 1341..1465

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

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

          import json
          import logging
          import os
          import random
          import string
          Severity: Major
          Found in apps/challenges/aws_utils.py - About 4 days to fix

            Function create_challenge_using_zip_file has a Cognitive Complexity of 203 (exceeds 5 allowed). Consider refactoring.
            Open

            def create_challenge_using_zip_file(request, challenge_host_team_pk):
                """
                Creates a challenge using a zip file.
                """
                challenge_host_team = get_challenge_host_team_model(challenge_host_team_pk)
            Severity: Minor
            Found in apps/challenges/views.py - About 4 days 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 create_or_update_github_challenge has a Cognitive Complexity of 199 (exceeds 5 allowed). Consider refactoring.
            Open

            def create_or_update_github_challenge(request, challenge_host_team_pk):
                try:
                    challenge_host_team = get_challenge_host_team_model(
                        challenge_host_team_pk
                    )
            Severity: Minor
            Found in apps/challenges/views.py - About 4 days 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

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

                                    if (duration._data.years != 0) {
                                        var years = duration.asYears();
                                        vm.leaderboard[i].submission__submitted_at = years;
                                        if (years.toFixed(0)==1) {
                                            vm.leaderboard[i].timeSpan = 'year';
            Severity: Major
            Found in frontend/src/js/controllers/challengeCtrl.js and 2 other locations - About 4 days to fix
            frontend/src/js/controllers/challengeCtrl.js on lines 1597..1645
            frontend/src/js/controllers/featuredChallengeCtrl.js on lines 136..189

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

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

                                    if (duration._data.years != 0) {
                                        var years = duration.asYears();
                                        vm.leaderboard[i].submission__submitted_at = years;
                                        if (years.toFixed(0) == 1) {
                                            vm.leaderboard[i].timeSpan = 'year';
            Severity: Major
            Found in frontend/src/js/controllers/challengeCtrl.js and 2 other locations - About 4 days to fix
            frontend/src/js/controllers/challengeCtrl.js on lines 1113..1166
            frontend/src/js/controllers/featuredChallengeCtrl.js on lines 136..189

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

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

                                    if (duration._data.years != 0) {
                                        var years = duration.asYears();
                                        vm.leaderboard[i].submission__submitted_at = years;
                                        if (years.toFixed(0)==1) {
                                            vm.leaderboard[i].timeSpan = 'year';
            Severity: Major
            Found in frontend/src/js/controllers/featuredChallengeCtrl.js and 2 other locations - About 4 days to fix
            frontend/src/js/controllers/challengeCtrl.js on lines 1113..1166
            frontend/src/js/controllers/challengeCtrl.js on lines 1597..1645

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

            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 challengesettings.component.ts has 1176 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import { Component, OnInit, OnDestroy, QueryList, ViewChildren } from '@angular/core';
            import { COMMA, ENTER } from '@angular/cdk/keycodes';
            import { MatChipInputEvent } from '@angular/material/chips';
            import { Router } from '@angular/router';
            import { NGXLogger } from 'ngx-logger';

              Function configure has 578 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function configure($stateProvider, $urlRouterProvider, $locationProvider, $urlMatcherFactoryProvider) {
              
                      //in order to prevent 404 for trailing '/' in urls
                      $urlMatcherFactoryProvider.strictMode(false);
              
              
              Severity: Major
              Found in frontend/src/js/route-config/route-config.js - About 2 days to fix

                Function update_partially_evaluated_submission has a Cognitive Complexity of 133 (exceeds 5 allowed). Consider refactoring.
                Open

                def update_partially_evaluated_submission(request, challenge_pk):
                    """
                    API endpoint to update submission related attributes
                
                    Query Parameters:
                Severity: Minor
                Found in apps/jobs/views.py - About 2 days 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

                File challenge_config_utils.py has 1029 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import logging
                import requests
                import zipfile
                import yaml
                
                
                Severity: Major
                Found in apps/challenges/challenge_config_utils.py - About 2 days to fix

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

                                      onSuccess: function() {
                  
                                          vm.team.error = false;
                                          $rootScope.notify("info", "You have removed yourself successfully");
                  
                  
                  Severity: Major
                  Found in frontend/src/js/controllers/teamsCtrl.js and 1 other location - About 2 days to fix
                  frontend/src/js/controllers/challengeHostTeamsCtrl.js on lines 314..360

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

                  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

                                      onSuccess: function() {
                                          vm.team.error = false;
                                          $rootScope.notify("info", "You have removed yourself successfully");
                  
                                          var parameters = {};
                  Severity: Major
                  Found in frontend/src/js/controllers/challengeHostTeamsCtrl.js and 1 other location - About 2 days to fix
                  frontend/src/js/controllers/teamsCtrl.js on lines 266..313

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

                  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

                                      vm.load = function(url) {
                                          // loader for existing teams
                                          vm.isExistLoader = true;
                                          vm.loaderTitle = '';
                                          vm.loaderContainer = angular.element('.exist-team-card');
                  Severity: Major
                  Found in frontend/src/js/controllers/teamsCtrl.js and 1 other location - About 1 day to fix
                  frontend/src/js/controllers/challengeHostTeamsCtrl.js on lines 86..125

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

                  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

                                      vm.load = function(url) {
                                          // loader for existing teams
                                          vm.isExistLoader = true;
                                          vm.loaderTitle = '';
                                          vm.loaderContainer = angular.element('.exist-team-card');
                  Severity: Major
                  Found in frontend/src/js/controllers/challengeHostTeamsCtrl.js and 1 other location - About 1 day to fix
                  frontend/src/js/controllers/teamsCtrl.js on lines 113..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 343.

                  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