VSVverkeerskunde/gvq-api

View on GitHub

Showing 1,426 of 1,426 total issues

Function _toSettings has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    var _toSettings = function ( mixed )
    {
        var idx, jq;
        var settings = DataTable.settings;
        var tables = $.map( settings, function (el, i) {
Severity: Minor
Found in public/js/jquery.dataTables.js - About 1 hr to fix

    Function _fnSortAria has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function _fnSortAria ( settings )
        {
            var label;
            var nextSort;
            var columns = settings.aoColumns;
    Severity: Minor
    Found in public/js/jquery.dataTables.js - About 1 hr to fix

      Function renderQuestion has 30 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                function renderQuestion (data) {
                  let imageLocation = quizConfig.imageDirectory + data.question.imageFileName;
                  let questionImage = new Image();
                  setViewValue('questionText', data.question.text);
      
      
      Severity: Minor
      Found in public/js/quiz.js - About 1 hr to fix

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

            stopPropagation: function() {
                var e = this.originalEvent;
        
                this.isPropagationStopped = returnTrue;
        
        
        Severity: Major
        Found in public/js/jquery.js and 1 other location - About 1 hr to fix
        public/js/jquery.js on lines 5416..5424

        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

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

            preventDefault: function() {
                var e = this.originalEvent;
        
                this.isDefaultPrevented = returnTrue;
        
        
        Severity: Major
        Found in public/js/jquery.js and 1 other location - About 1 hr to fix
        public/js/jquery.js on lines 5425..5433

        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

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

                    function (WeightedTeam $wt1, WeightedTeam $wt2): int {
                        if ($wt1->getParticipationCount()->toNative() > $wt2->getParticipationCount()->toNative()) {
                            return -1;
                        } elseif ($wt1->getParticipationCount()->toNative() < $wt2->getParticipationCount()->toNative()) {
                            return 1;
        Severity: Major
        Found in src/Team/Service/TeamService.php and 1 other location - About 1 hr to fix
        src/Statistics/ValueObjects/TeamScores.php on lines 55..66

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

        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

                    function (TeamScore $ts1, TeamScore $ts2): int {
                        if ($ts1->getRankingScore()->toNative() > $ts2->getRankingScore()->toNative()) {
                            return -1;
                        } elseif ($ts1->getRankingScore()->toNative() < $ts2->getRankingScore()->toNative()) {
                            return 1;
        Severity: Major
        Found in src/Statistics/ValueObjects/TeamScores.php and 1 other location - About 1 hr to fix
        src/Team/Service/TeamService.php on lines 128..139

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

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

            attr: function( elem, name, value ) {
                var ret, hooks,
                    nType = elem.nodeType;
        
                // Don't get/set attributes on text, comment and attribute nodes
        Severity: Minor
        Found in public/js/jquery.js - About 1 hr to fix

          Function _fnFilterComplete has 29 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function _fnFilterComplete ( oSettings, oInput, iForce )
              {
                  var oPrevSearch = oSettings.oPreviousSearch;
                  var aoPrevSearch = oSettings.aoPreSearchCols;
                  var fnSaveFilter = function ( oFilter ) {
          Severity: Minor
          Found in public/js/jquery.dataTables.js - About 1 hr to fix

            Function refresh has 29 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                  _proto.refresh = function refresh() {
                    var _this2 = this;
            
                    var autoMethod = this._scrollElement === this._scrollElement.window ? OffsetMethod.OFFSET : OffsetMethod.POSITION;
                    var offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method;
            Severity: Minor
            Found in public/js/bootstrap.js - About 1 hr to fix

              Function _fnFilter has 29 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function _fnFilter( settings, input, force, regex, smart, caseInsensitive )
                  {
                      var rpSearch = _fnFilterCreateSearch( input, regex, smart, caseInsensitive );
                      var prevSearch = settings.oPreviousSearch.sSearch;
                      var displayMaster = settings.aiDisplayMaster;
              Severity: Minor
              Found in public/js/jquery.dataTables.js - About 1 hr to fix

                Method login has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function login(Request $request): Response
                    {
                        $form = $this->createLoginForm();
                        $form->handleRequest($request);
                
                
                Severity: Minor
                Found in src/Account/Controllers/AccountViewController.php - About 1 hr to fix

                  Method rankTeamScores has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      private function rankTeamScores(Teams $teams): TeamScores
                      {
                          /** @var WeightedTeam[] $weightedTeams */
                          $weightedTeams = [];
                  
                  
                  Severity: Minor
                  Found in src/Team/Service/TeamService.php - About 1 hr to fix

                    Method buildForm has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function buildForm(FormBuilderInterface $builder, array $options)
                        {
                            /** @var TranslatorInterface $translator */
                            $translator = $options['translator'];
                    
                    
                    Severity: Minor
                    Found in src/Account/Forms/RequestPasswordFormType.php - About 1 hr to fix

                      Method guardChannel has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          private function guardChannel(QuizChannel $channel, ?Company $company, ?Partner $partner, ?Team $team): void
                          {
                              switch ($channel->toNative()) {
                                  case QuizChannel::INDIVIDUAL:
                                  case QuizChannel::LEAGUE:
                      Severity: Minor
                      Found in src/Quiz/Models/Quiz.php - About 1 hr to fix

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

                        <?php declare(strict_types=1);
                        
                        namespace VSV\GVQ_API\Quiz\Events;
                        
                        use Ramsey\Uuid\UuidInterface;
                        Severity: Major
                        Found in src/Quiz/Events/QuestionAsked.php and 1 other location - About 1 hr to fix
                        src/Quiz/Events/AnsweredTooLate.php on lines 1..51

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

                        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

                        <?php declare(strict_types=1);
                        
                        namespace VSV\GVQ_API\Quiz\Events;
                        
                        use Ramsey\Uuid\UuidInterface;
                        Severity: Major
                        Found in src/Quiz/Events/AnsweredTooLate.php and 1 other location - About 1 hr to fix
                        src/Quiz/Events/QuestionAsked.php on lines 1..52

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

                        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

                        Method __construct has 9 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                                UuidInterface $id,
                                QuizChannel $channel,
                                ?Company $company,
                                ?Partner $partner,
                                ?Team $team,
                        Severity: Major
                        Found in src/Quiz/Models/Quiz.php - About 1 hr to fix

                          Method __construct has 9 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                                  UuidInterface $id,
                                  Language $language,
                                  Year $year,
                                  Category $category,
                                  NotEmptyString $text,
                          Severity: Major
                          Found in src/Question/Models/Question.php - About 1 hr to fix

                            Method __construct has 9 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                    Year $year,
                                    StatisticsService $statisticsService,
                                    SerializerInterface $serializer,
                                    ResponseFactory $responseFactory,
                                    TeamRepository $teamRepository,
                            Severity: Major
                            Found in src/Statistics/Controllers/StatisticsViewController.php - About 1 hr to fix
                              Severity
                              Category
                              Status
                              Source
                              Language