VSVverkeerskunde/gvq-api

View on GitHub

Showing 1,426 of 1,426 total issues

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

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

    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

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

                if (this.options.showPaginationSwitch) {
                    this.$toolbar.find('button[name="paginationSwitch"]')
                        .off('click').on('click', $.proxy(this.togglePagination, this));
                }
        Severity: Major
        Found in public/js/bootstrap-table.js and 2 other locations - About 1 hr to fix
        public/js/bootstrap-table.js on lines 1148..1151
        public/js/bootstrap-table.js on lines 1228..1231

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

        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

              _proto.getTipElement = function getTipElement() {
                this.tip = this.tip || $$$1(this.config.template)[0];
                return this.tip;
              };
        Severity: Major
        Found in public/js/bootstrap.js and 1 other location - About 1 hr to fix
        public/js/bootstrap.js on lines 3208..3211

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

        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

              _proto.getTipElement = function getTipElement() {
                this.tip = this.tip || $$$1(this.config.template)[0];
                return this.tip;
              };
        Severity: Major
        Found in public/js/bootstrap.js and 1 other location - About 1 hr to fix
        public/js/bootstrap.js on lines 2819..2822

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

        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 (this.options.showFullscreen) {
                    this.$toolbar.find('button[name="fullscreen"]')
                        .off('click').on('click', $.proxy(this.toggleFullscreen, this));
                }
        Severity: Major
        Found in public/js/bootstrap-table.js and 2 other locations - About 1 hr to fix
        public/js/bootstrap-table.js on lines 1223..1226
        public/js/bootstrap-table.js on lines 1228..1231

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

        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 (this.options.showRefresh) {
                    this.$toolbar.find('button[name="refresh"]')
                        .off('click').on('click', $.proxy(this.refresh, this));
                }
        Severity: Major
        Found in public/js/bootstrap-table.js and 2 other locations - About 1 hr to fix
        public/js/bootstrap-table.js on lines 1148..1151
        public/js/bootstrap-table.js on lines 1223..1226

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

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

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

                _proto.hide = function hide(event) {
                  var _this2 = this;
          
                  if (event) {
                    event.preventDefault();
          Severity: Minor
          Found in public/js/bootstrap.js - About 1 hr to fix

            Function _showElement has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                  _proto._showElement = function _showElement(relatedTarget) {
                    var _this3 = this;
            
                    var transition = $$$1(this._element).hasClass(ClassName.FADE);
            
            
            Severity: Minor
            Found in public/js/bootstrap.js - About 1 hr to fix

              Function keys has 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                          Object.keys = (function() {
                              var hasOwnProperty = Object.prototype.hasOwnProperty,
                                  hasDontEnumBug = !({ toString: null }).propertyIsEnumerable('toString'),
                                  dontEnums = [
                                      'toString',
              Severity: Minor
              Found in public/js/bootstrap-table.js - About 1 hr to fix

                Method edit has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function edit(Request $request, string $id): Response
                    {
                        $companies = $this->getCompaniesForUser();
                
                        $company = $this->getActiveCompany($companies, $id);
                Severity: Minor
                Found in src/Company/Controllers/CompanyViewController.php - About 1 hr to fix

                  Method statistics has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function statistics(): Response
                      {
                          $startedCounts = $this->statisticsService->getStartedQuizCounts();
                          $finishedCounts = $this->statisticsService->getFinishedQuizCounts();
                          $passedCounts = $this->statisticsService->getPassedQuizCounts();
                  Severity: Minor
                  Found in src/Statistics/Controllers/StatisticsViewController.php - About 1 hr to fix

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

                        public function getAverageByChannel(QuizChannel $channel): Average
                        {
                            $scalarScore = $this->entityManager->createQueryBuilder()
                                ->select('avg(detailedTopScore.score)')
                                ->from(DetailedTopScoreEntity::class, 'detailedTopScore')
                    src/Statistics/Repositories/DetailedTopScoreDoctrineRepository.php on lines 87..100

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

                    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 getAverageByLanguage(Language $language): Average
                        {
                            $scalarScore = $this->entityManager->createQueryBuilder()
                                ->select('avg(detailedTopScore.score)')
                                ->from(DetailedTopScoreEntity::class, 'detailedTopScore')
                    src/Statistics/Repositories/DetailedTopScoreDoctrineRepository.php on lines 68..81

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

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

                    jQuery.speed = function( speed, easing, fn ) {
                        var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
                            complete: fn || !fn && easing ||
                                isFunction( speed ) && speed,
                            duration: speed,
                    Severity: Minor
                    Found in public/js/jquery.js - About 1 hr to fix

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

                          removeClass: function( value ) {
                              var classes, elem, cur, curValue, clazz, j, finalValue,
                                  i = 0;
                      
                              if ( isFunction( value ) ) {
                      Severity: Minor
                      Found in public/js/jquery.js - About 1 hr to fix
                        Severity
                        Category
                        Status
                        Source
                        Language