VSVverkeerskunde/gvq-api

View on GitHub

Showing 1,426 of 1,426 total issues

The class AccountViewController has an overall complexity of 67 which is very high. The configured complexity threshold is 50.
Open

class AccountViewController extends AbstractController
{
    /**
     * @var RegistrationFormType
     */

The class AccountViewController has 15 public methods. Consider refactoring AccountViewController to keep number of public methods under 10.
Open

class AccountViewController extends AbstractController
{
    /**
     * @var RegistrationFormType
     */

TooManyPublicMethods

Since: 0.1

A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.

By default it ignores methods starting with 'get' or 'set'.

Example

Source https://phpmd.org/rules/codesize.html#toomanypublicmethods

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

<?php declare(strict_types=1);

namespace VSV\GVQ_API\Statistics\Serializers;

use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
Severity: Major
Found in src/Statistics/Serializers/TeamScoresNormalizer.php and 3 other locations - About 3 hrs to fix
src/Question/Serializers/CategoriesNormalizer.php on lines 1..45
src/Question/Serializers/QuestionsNormalizer.php on lines 1..45
src/Team/Serializers/TeamsNormalizer.php on lines 1..45

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

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 4 locations. Consider refactoring.
Open

<?php declare(strict_types=1);

namespace VSV\GVQ_API\Team\Serializers;

use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
Severity: Major
Found in src/Team/Serializers/TeamsNormalizer.php and 3 other locations - About 3 hrs to fix
src/Question/Serializers/CategoriesNormalizer.php on lines 1..45
src/Question/Serializers/QuestionsNormalizer.php on lines 1..45
src/Statistics/Serializers/TeamScoresNormalizer.php on lines 1..45

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

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 4 locations. Consider refactoring.
Open

<?php declare(strict_types=1);

namespace VSV\GVQ_API\Question\Serializers;

use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
Severity: Major
Found in src/Question/Serializers/CategoriesNormalizer.php and 3 other locations - About 3 hrs to fix
src/Question/Serializers/QuestionsNormalizer.php on lines 1..45
src/Statistics/Serializers/TeamScoresNormalizer.php on lines 1..45
src/Team/Serializers/TeamsNormalizer.php on lines 1..45

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

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 4 locations. Consider refactoring.
Open

<?php declare(strict_types=1);

namespace VSV\GVQ_API\Question\Serializers;

use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
Severity: Major
Found in src/Question/Serializers/QuestionsNormalizer.php and 3 other locations - About 3 hrs to fix
src/Question/Serializers/CategoriesNormalizer.php on lines 1..45
src/Statistics/Serializers/TeamScoresNormalizer.php on lines 1..45
src/Team/Serializers/TeamsNormalizer.php on lines 1..45

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

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

    function _fnGetObjectDataFn( mSource )
    {
        if ( $.isPlainObject( mSource ) )
        {
            /* Build an object of get functions, and wrap them in a single call */
Severity: Major
Found in public/js/jquery.dataTables.js - About 3 hrs to fix

    Method handle has 82 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function handle(DomainMessage $domainMessage)
        {
            $payload = $domainMessage->getPayload();
    
            if ($payload instanceof EmailRegistered) {
    Severity: Major
    Found in src/Statistics/Projectors/UniqueParticipantProjector.php - About 3 hrs to fix

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

      <?php declare(strict_types=1);
      
      namespace VSV\GVQ_API\Contest\ValueObjects;
      
      use VSV\GVQ_API\Common\ValueObjects\NotEmptyString;
      Severity: Major
      Found in src/Contest/ValueObjects/Address.php and 2 other locations - About 3 hrs to fix
      src/Statistics/ValueObjects/TeamScore.php on lines 1..78
      src/Team/Service/WeightedTeam.php on lines 1..80

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

      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\Statistics\ValueObjects;
      
      use VSV\GVQ_API\Team\Models\Team;
      Severity: Major
      Found in src/Statistics/ValueObjects/TeamScore.php and 2 other locations - About 3 hrs to fix
      src/Contest/ValueObjects/Address.php on lines 1..78
      src/Team/Service/WeightedTeam.php on lines 1..80

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

      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\Service;
      
      use VSV\GVQ_API\Statistics\ValueObjects\Average;
      Severity: Major
      Found in src/Team/Service/WeightedTeam.php and 2 other locations - About 3 hrs to fix
      src/Contest/ValueObjects/Address.php on lines 1..78
      src/Statistics/ValueObjects/TeamScore.php on lines 1..78

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

      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._cleanTipClass = function _cleanTipClass() {
              var $tip = $$$1(this.getTipElement());
              var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX);
      
              if (tabClass !== null && tabClass.length > 0) {
      Severity: Major
      Found in public/js/bootstrap.js and 1 other location - About 3 hrs to fix
      public/js/bootstrap.js on lines 3233..3240

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

      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._cleanTipClass = function _cleanTipClass() {
              var $tip = $$$1(this.getTipElement());
              var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX);
      
              if (tabClass !== null && tabClass.length > 0) {
      Severity: Major
      Found in public/js/bootstrap.js and 1 other location - About 3 hrs to fix
      public/js/bootstrap.js on lines 3016..3023

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

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

          BootstrapTable.prototype.initServer = function (silent, query, url) {
              var that = this,
                  data = {},
                  index = $.inArray(this.options.sortName, this.header.fields),
                  params = {
      Severity: Major
      Found in public/js/bootstrap-table.js - About 3 hrs to fix

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

        <?php declare(strict_types=1);
        
        namespace VSV\GVQ_API\Quiz\Serializers;
        
        use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
        Severity: Major
        Found in src/Quiz/Serializers/QuestionAskedNormalizer.php and 1 other location - About 3 hrs to fix
        src/Quiz/Serializers/AnsweredTooLateNormalizer.php on lines 1..45

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

        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\Serializers;
        
        use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
        Severity: Major
        Found in src/Quiz/Serializers/AnsweredTooLateNormalizer.php and 1 other location - About 3 hrs to fix
        src/Quiz/Serializers/QuestionAskedNormalizer.php on lines 1..45

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

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

        function Sizzle( selector, context, results, seed ) {
            var m, i, elem, nid, match, groups, newSelector,
                newContext = context && context.ownerDocument,
        
                // nodeType defaults to 9, since context defaults to document
        Severity: Major
        Found in public/js/jquery.js - About 3 hrs to fix

          Function CHILD has 80 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  "CHILD": function( type, what, argument, first, last ) {
                      var simple = type.slice( 0, 3 ) !== "nth",
                          forward = type.slice( -4 ) !== "last",
                          ofType = what === "of-type";
          
          
          Severity: Major
          Found in public/js/jquery.js - About 3 hrs to fix

            Function _ has 79 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                        _: function ( settings, host, idx, buttons, page, pages ) {
                            var classes = settings.oClasses;
                            var lang = settings.oLanguage.oPaginate;
                            var aria = settings.oLanguage.oAria.paginate || {};
                            var btnDisplay, btnClass, counter=0;
            Severity: Major
            Found in public/js/jquery.dataTables.js - About 3 hrs to fix

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

                      3: {
                          buttonsClass: 'default',
                          iconsPrefix: 'glyphicon',
                          icons: {
                              paginationSwitchDown: 'glyphicon-collapse-down icon-chevron-down',
              Severity: Major
              Found in public/js/bootstrap-table.js and 1 other location - About 3 hrs to fix
              public/js/bootstrap-table.js on lines 38..57

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

              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

              Severity
              Category
              Status
              Source
              Language