VSVverkeerskunde/gvq-api

View on GitHub

Showing 428 of 1,426 total issues

Function hide has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      _proto.hide = function hide() {
        var _this2 = 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 expandAllRows has 33 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        BootstrapTable.prototype.expandAllRows = function (isSubTable) {
            if (isSubTable) {
                var $tr = this.$body.find(sprintf('> tr[data-index="%s"]', 0)),
                    that = this,
                    detailIcon = null,
    Severity: Minor
    Found in public/js/bootstrap-table.js - About 1 hr to fix

      Function toggle has 33 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

            _proto.toggle = function toggle() {
              var triggerChangeEvent = true;
              var addAriaPressed = true;
              var rootElement = $$$1(this._element).closest(Selector.DATA_TOGGLE)[0];
      
      
      Severity: Minor
      Found in public/js/bootstrap.js - About 1 hr to fix

        Function _dataApiKeydownHandler has 33 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

              Dropdown._dataApiKeydownHandler = function _dataApiKeydownHandler(event) {
                // If not input/textarea:
                //  - And not a key in REGEXP_KEYDOWN => not a dropdown command
                // If input/textarea:
                //  - If space key => not a dropdown command
        Severity: Minor
        Found in public/js/bootstrap.js - About 1 hr to fix

          Method buildForm has 33 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/LoginFormType.php - About 1 hr to fix

            Method newQuestionFromData has 33 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function newQuestionFromData(
                    UuidFactoryInterface $uuidFactory,
                    NotEmptyString $imageFileName,
                    array $data
                ): Question {
            Severity: Minor
            Found in src/Question/Forms/QuestionFormType.php - About 1 hr to fix

              Function _clearMenus has 32 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                    Dropdown._clearMenus = function _clearMenus(event) {
                      if (event && (event.which === RIGHT_MOUSE_BUTTON_WHICH || event.type === 'keyup' && event.which !== TAB_KEYCODE)) {
                        return;
                      }
              
              
              Severity: Minor
              Found in public/js/bootstrap.js - About 1 hr to fix

                Function setFieldIndex has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    var setFieldIndex = function (columns) {
                        var i, j, k,
                            totalCol = 0,
                            flag = [];
                
                
                Severity: Minor
                Found in public/js/bootstrap-table.js - About 1 hr to fix

                  Method requestPassword has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

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

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

                            controller: function (quizId, score, totalQuestions) {
                              setViewValue('score', score);
                              setViewValue('totalQuestions', totalQuestions);
                    
                              view.find('button.gvq-play-again').on('click', function () {
                    Severity: Minor
                    Found in public/js/quiz.js - About 1 hr to fix

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

                          public function denormalize($data, $class, $format = null, array $context = []): Question
                          {
                              $category = $this->categoryDenormalizer->denormalize(
                                  $data['category'],
                                  Category::class,
                      Severity: Minor
                      Found in src/Question/Serializers/QuestionDenormalizer.php - About 1 hr to fix

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

                                TranslatorInterface $translator,
                                UuidFactoryInterface $uuidFactory,
                                UserRepository $userRepository,
                                CompanyRepository $companyRepository,
                                RegistrationRepository $registrationRepository,
                        Severity: Major
                        Found in src/Account/Controllers/AccountViewController.php - About 1 hr to fix

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

                                  Year $year,
                                  ContestService $contestService,
                                  UuidFactoryInterface $uuidFactory,
                                  QuizRepository $quizRepository,
                                  TieBreakerRepository $tieBreakerRepository,
                          Severity: Major
                          Found in src/Contest/Controllers/ContestViewController.php - About 1 hr to fix

                            Function validate has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function validate($value, Constraint $constraint): void
                                {
                                    if ($constraint instanceof UserIsUnique) {
                                        $user = $this->userRepository->getByEmail(new Email($value));
                                        $raiseError = false;
                            Severity: Minor
                            Found in src/Account/Constraints/UserIsUniqueValidator.php - About 1 hr 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 validate has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function validate($value, Constraint $constraint): void
                                {
                                    if ($constraint instanceof AliasIsUnique) {
                                        $company = $this->companyRepository->getByAlias(new Alias($value));
                                        $raiseError = false;
                            Severity: Minor
                            Found in src/Account/Constraints/AliasIsUniqueValidator.php - About 1 hr 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

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

                                    Year $year,
                                    UserRepository $userRepository,
                                    CompanyRepository $companyRepository,
                                    DashboardService $dashboardService,
                                    StatisticsService $statisticsService,
                            Severity: Major
                            Found in src/Dashboard/Controllers/DashboardViewController.php - About 1 hr to fix

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

                                      string $id,
                                      string $language,
                                      int $year,
                                      CategoryEntity $categoryEntity,
                                      string $text,
                              Severity: Major
                              Found in src/Question/Repositories/Entities/QuestionEntity.php - About 1 hr to fix

                                Function getEventBus has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    private function getEventBus(InputInterface $input): SimpleEventBus
                                    {
                                        $name = $input->getOption('projector');
                                
                                        $eventBus = null;
                                Severity: Minor
                                Found in src/Command/ReplayCommand.php - About 1 hr 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 validate has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    public function validate($value, Constraint $constraint): void
                                    {
                                        if ($constraint instanceof CompanyIsUnique) {
                                            $company = $this->companyRepository->getByName(new NotEmptyString($value));
                                            $raiseError = false;
                                Severity: Minor
                                Found in src/Account/Constraints/CompanyIsUniqueValidator.php - About 1 hr 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 load has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                jQuery.fn.load = function( url, params, callback ) {
                                    var selector, type, response,
                                        self = this,
                                        off = url.indexOf( " " );
                                
                                
                                Severity: Minor
                                Found in public/js/jquery.js - About 1 hr to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language