VSVverkeerskunde/gvq-api

View on GitHub

Showing 1,426 of 1,426 total issues

Function __row_selector has 53 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    var __row_selector = function ( settings, selector, opts )
    {
        var rows;
        var run = function ( sel ) {
            var selInt = _intVal( sel );
Severity: Major
Found in public/js/jquery.dataTables.js - About 2 hrs to fix

    Method editImage has 53 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function editImage(Request $request, string $id): Response
        {
            $question = $this->questionRepository->getById(
                $this->uuidFactory->fromString($id)
            );
    Severity: Major
    Found in src/Question/Controllers/QuestionViewController.php - About 2 hrs to fix

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

              if (isSubTable) {
                  this.expandRow_(false, 0);
              } else {
                  var trs = this.$body.children();
                  for (var i = 0; i < trs.length; i++) {
      Severity: Major
      Found in public/js/bootstrap-table.js and 1 other location - About 2 hrs to fix
      public/js/bootstrap-table.js on lines 3145..3179

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

      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 (isSubTable) {
                  var $tr = this.$body.find(sprintf('> tr[data-index="%s"]', 0)),
                      that = this,
                      detailIcon = null,
                      executeInterval = false,
      Severity: Major
      Found in public/js/bootstrap-table.js and 1 other location - About 2 hrs to fix
      public/js/bootstrap-table.js on lines 3183..3190

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

      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 generateQuestions has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
      Open

          private function generateQuestions(Language $language, Year $year, ?string $firstQuestionId): Questions
          {
              $pickedQuestions = [];
              $firstQuestion = null;
      
      
      Severity: Minor
      Found in src/Quiz/Service/QuizService.php - 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 remove has 52 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          remove: function( elem, types, handler, selector, mappedTypes ) {
      
              var j, origCount, tmp,
                  events, t, handleObj,
                  special, handlers, type, namespaces, origType,
      Severity: Major
      Found in public/js/jquery.js - About 2 hrs to fix

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

                    } else if (score <= 8) {
                      view.find('#share-title-very-bad').hide();
                      view.find('#share-title-bad').hide();
                      view.find('#share-title-good').show();
                      view.find('#share-title-very-good').hide();
        Severity: Major
        Found in public/js/quiz.js and 2 other locations - About 2 hrs to fix
        public/js/quiz.js on lines 473..493
        public/js/quiz.js on lines 478..493

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

        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

                    } else if (score <= 6) {
                      view.find('#share-title-very-bad').hide();
                      view.find('#share-title-bad').show();
                      view.find('#share-title-good').hide();
                      view.find('#share-title-very-good').hide();
        Severity: Major
        Found in public/js/quiz.js and 2 other locations - About 2 hrs to fix
        public/js/quiz.js on lines 473..493
        public/js/quiz.js on lines 483..493

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

        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 (score <= 4) {
                      view.find('#share-title-very-bad').show();
                      view.find('#share-title-bad').hide();
                      view.find('#share-title-good').hide();
                      view.find('#share-title-very-good').hide();
        Severity: Major
        Found in public/js/quiz.js and 2 other locations - About 2 hrs to fix
        public/js/quiz.js on lines 478..493
        public/js/quiz.js on lines 483..493

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

        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

        <?php declare(strict_types=1);
        
        namespace VSV\GVQ_API\Team\Serializers;
        
        use Ramsey\Uuid\Uuid;
        Severity: Major
        Found in src/Team/Serializers/TeamDenormalizer.php and 2 other locations - About 2 hrs to fix
        src/Question/Serializers/CategoryDenormalizer.php on lines 1..30
        src/Quiz/Serializers/EmailRegisteredDenormalizer.php on lines 1..34

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

        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

        <?php declare(strict_types=1);
        
        namespace VSV\GVQ_API\Quiz\Serializers;
        
        use Ramsey\Uuid\Uuid;
        Severity: Major
        Found in src/Quiz/Serializers/EmailRegisteredDenormalizer.php and 2 other locations - About 2 hrs to fix
        src/Question/Serializers/CategoryDenormalizer.php on lines 1..30
        src/Team/Serializers/TeamDenormalizer.php on lines 1..30

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

        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

        <?php declare(strict_types=1);
        
        namespace VSV\GVQ_API\Question\Serializers;
        
        use Ramsey\Uuid\Uuid;
        Severity: Major
        Found in src/Question/Serializers/CategoryDenormalizer.php and 2 other locations - About 2 hrs to fix
        src/Quiz/Serializers/EmailRegisteredDenormalizer.php on lines 1..34
        src/Team/Serializers/TeamDenormalizer.php on lines 1..30

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

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

        function buildFragment( elems, context, scripts, selection, ignored ) {
            var elem, tmp, tag, wrap, contains, j,
                fragment = context.createDocumentFragment(),
                nodes = [],
                i = 0,
        Severity: Major
        Found in public/js/jquery.js - About 2 hrs to fix

          Function loaded has 51 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  var loaded = function ( s ) {
                      if ( ! s || ! s.time ) {
                          callback();
                          return;
                      }
          Severity: Major
          Found in public/js/jquery.dataTables.js - About 2 hrs to fix

            Method execute has 51 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                protected function execute(InputInterface $input, OutputInterface $output): void
                {
                    $helper = $this->getHelper('question');
                    $question = new ConfirmationQuestion('Continue with cleaning the read models? ', false);
            
            
            Severity: Major
            Found in src/Command/CleanReadModelsCommand.php - About 2 hrs to fix

              Consider simplifying this complex logical expression.
              Open

                              if ( ( mappedTypes || origType === handleObj.origType ) &&
                                  ( !handler || handler.guid === handleObj.guid ) &&
                                  ( !tmp || tmp.test( handleObj.namespace ) ) &&
                                  ( !selector || selector === handleObj.selector ||
                                      selector === "**" && handleObj.selector ) ) {
              Severity: Critical
              Found in public/js/jquery.js - About 2 hrs to fix

                Function _fnCreateTr has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    function _fnCreateTr ( oSettings, iRow, nTrIn, anTds )
                    {
                        var
                            row = oSettings.aoData[iRow],
                            rowData = row._aData,
                Severity: Minor
                Found in public/js/jquery.dataTables.js - About 1 hr to fix

                  Function _fnApplyColumnDefs has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      function _fnApplyColumnDefs( oSettings, aoColDefs, aoCols, fn )
                      {
                          var i, iLen, j, jLen, k, kLen, def;
                          var columns = oSettings.aoColumns;
                      
                  Severity: Minor
                  Found in public/js/jquery.dataTables.js - About 1 hr to fix

                    Function run has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            var run = function ( sel ) {
                                var selInt = _intVal( sel );
                                var i, ien;
                        
                                // Short cut - selector is a number and no options provided (default is
                    Severity: Minor
                    Found in public/js/jquery.dataTables.js - About 1 hr to fix

                      Function _fnSortFlatten has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          function _fnSortFlatten ( settings )
                          {
                              var
                                  i, iLen, k, kLen,
                                  aSort = [],
                      Severity: Minor
                      Found in public/js/jquery.dataTables.js - About 1 hr to fix
                        Severity
                        Category
                        Status
                        Source
                        Language