VSVverkeerskunde/gvq-api

View on GitHub

Showing 1,426 of 1,426 total issues

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

        controller: function (quizId, questionNr, answerId) {
          let deferredRender = $.Deferred();

          function renderAnsweredQuestion (data) {
            let answerResult = 'wrong';
Severity: Minor
Found in public/js/quiz.js - About 1 hr to fix

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

        BootstrapTable.prototype.prepend = function (data) {
            this.initData(data, 'prepend');
            this.initSearch();
            this.initPagination();
            this.initSort();
    Severity: Major
    Found in public/js/bootstrap-table.js and 1 other location - About 1 hr to fix
    public/js/bootstrap-table.js on lines 2542..2548

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

    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

        BootstrapTable.prototype.append = function (data) {
            this.initData(data, 'append');
            this.initSearch();
            this.initPagination();
            this.initSort();
    Severity: Major
    Found in public/js/bootstrap-table.js and 1 other location - About 1 hr to fix
    public/js/bootstrap-table.js on lines 2550..2556

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

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

                var setData = function (data, val, src) {
                    var a = _fnSplitObjNotation( src ), b;
                    var aLast = a[a.length-1];
                    var arrayNotation, funcNotation, o, innerSrc;
        
    Severity: Minor
    Found in public/js/jquery.dataTables.js - About 1 hr to fix

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

          public function save(Request $request): Response
          {
              /** @var string $json */
              $json = $request->getContent();
              $json = $this->jsonEnricher->enrich($json);
      Severity: Major
      Found in src/Question/Controllers/QuestionController.php and 1 other location - About 1 hr to fix
      src/Company/Controllers/CompanyController.php on lines 48..63

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

      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

          public function save(Request $request): Response
          {
              /** @var string $json */
              $json = $request->getContent();
              $json = $this->jsonEnricher->enrich($json);
      Severity: Major
      Found in src/Company/Controllers/CompanyController.php and 1 other location - About 1 hr to fix
      src/Question/Controllers/QuestionController.php on lines 57..71

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

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

            _proto.show = function show() {
              var _this = this;
      
              if (this._isTransitioning || $$$1(this._element).hasClass(ClassName.SHOW)) {
                return;
      Severity: Minor
      Found in public/js/bootstrap.js - About 1 hr to fix

        Function _fnBuildHead has 47 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function _fnBuildHead( oSettings )
            {
                var i, ien, cell, row, column;
                var thead = oSettings.nTHead;
                var tfoot = oSettings.nTFoot;
        Severity: Minor
        Found in public/js/jquery.dataTables.js - About 1 hr to fix

          Method denormalize has 47 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function denormalize($data, $class, $format = null, array $context = []): Quiz
              {
                  $questions = array_map(
                      function (array $question) use ($format, $context) {
                          return $this->questionDenormalizer->denormalize(
          Severity: Minor
          Found in src/Quiz/Serializers/QuizDenormalizer.php - About 1 hr to fix

            Method showQuiz has 47 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function showQuiz(ContainerInterface $container, Request $request): Response
                {
                    $language = $request->get('language');
            
                    if ($request->query->get('channel') === 'company') {
            Severity: Minor
            Found in src/Quiz/Controllers/QuizViewController.php - About 1 hr to fix

              Function addCombinator has 46 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function addCombinator( matcher, combinator, base ) {
                  var dir = combinator.dir,
                      skip = combinator.next,
                      key = skip || dir,
                      checkNonElements = base && key === "parentNode",
              Severity: Minor
              Found in public/js/jquery.js - About 1 hr to fix

                Function select has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                select = Sizzle.select = function( selector, context, results, seed ) {
                    var i, tokens, token, type, find,
                        compiled = typeof selector === "function" && selector,
                        match = !seed && tokenize( (selector = compiled.selector || selector) );
                
                
                Severity: Minor
                Found in public/js/jquery.js - About 1 hr to fix

                  Function tokenize has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
                      var matched, match, tokens, type,
                          soFar, groups, preFilters,
                          cached = tokenCache[ selector + " " ];
                  
                  
                  Severity: Minor
                  Found in public/js/jquery.js - About 1 hr to fix

                    Function matcherFromTokens has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function matcherFromTokens( tokens ) {
                        var checkContext, matcher, j,
                            len = tokens.length,
                            leadingRelative = Expr.relative[ tokens[0].type ],
                            implicitRelative = leadingRelative || Expr.relative[" "],
                    Severity: Minor
                    Found in public/js/jquery.js - About 1 hr to fix

                      Function _fnDetectHeader has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          function _fnDetectHeader ( aLayout, nThead )
                          {
                              var nTrs = $(nThead).children('tr');
                              var nTr, nCell;
                              var i, k, l, iLen, jLen, iColShifted, iColumn, iColspan, iRowspan;
                      Severity: Minor
                      Found in public/js/jquery.dataTables.js - About 1 hr to fix

                        Function val has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            val: function( value ) {
                                var hooks, ret, valueIsFunction,
                                    elem = this[ 0 ];
                        
                                if ( !arguments.length ) {
                        Severity: Minor
                        Found in public/js/jquery.js - About 1 hr to fix

                          Function show has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                _proto.show = function show() {
                                  var _this = this;
                          
                                  if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && $$$1(this._element).hasClass(ClassName.ACTIVE) || $$$1(this._element).hasClass(ClassName.DISABLED)) {
                                    return;
                          Severity: Minor
                          Found in public/js/bootstrap.js - About 1 hr to fix

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

                                    var run = function ( s ) {
                                        var fnSelector = typeof s === 'function';
                                
                                        if ( s === null || s === undefined || fnSelector ) {
                                            // All cells and function selectors
                            Severity: Minor
                            Found in public/js/jquery.dataTables.js - About 1 hr to fix

                              Function controller has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                      controller: function () {
                                        let startButton = view.find('button.gvq-start-button');
                              
                                        let teamSelect = view.find('select[name="choose-team"]');
                              
                              
                              Severity: Minor
                              Found in public/js/quiz.js - About 1 hr to fix

                                Method editContact has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    public function editContact(Request $request, ?string $id): Response
                                    {
                                        if ($id === null) {
                                            $user = $this->userRepository->getByEmail(new Email($this->getUser()->getUsername()));
                                        } elseif ($this->get('security.authorization_checker')->isGranted('ROLE_CONTACT')) {
                                Severity: Minor
                                Found in src/User/Controllers/UserViewController.php - About 1 hr to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language