VSVverkeerskunde/gvq-api

View on GitHub

Showing 1,426 of 1,426 total issues

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

        4: {
            buttonsClass: 'secondary',
            iconsPrefix: 'fa',
            icons: {
                paginationSwitchDown: 'fa-toggle-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 18..37

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

Function execute has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    protected function execute(InputInterface $input, OutputInterface $output): void
    {
        $firstId = $input->getOption('first-id');
        if (null !== $firstId) {
            $firstId = (int) $firstId;
Severity: Minor
Found in src/Command/ReplayCommand.php - About 3 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 send has 77 lines of code (exceeds 25 allowed). Consider refactoring.
Open

            send: function( headers, complete ) {
                var i,
                    xhr = options.xhr();

                xhr.open(
Severity: Major
Found in public/js/jquery.js - About 3 hrs to fix

    Function _fnSetObjectDataFn has 77 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function _fnSetObjectDataFn( mSource )
        {
            if ( $.isPlainObject( mSource ) )
            {
                /* Unlike get, only the underscore (global) option is used for for
    Severity: Major
    Found in public/js/jquery.dataTables.js - About 3 hrs to fix

      Function initTable has 77 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          BootstrapTable.prototype.initTable = function () {
              var that = this,
                  columns = [],
                  data = [];
      
      
      Severity: Major
      Found in public/js/bootstrap-table.js - About 3 hrs to fix

        Function Alert has 76 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function () {
              function Alert(element) {
                this._element = element;
              } // Getters
        
        
        Severity: Major
        Found in public/js/bootstrap.js - About 3 hrs to fix

          Consider simplifying this complex logical expression.
          Open

                      if (column.checkbox || column.radio) {
                          type = column.checkbox ? 'checkbox' : type;
                          type = column.radio ? 'radio' : type;
          
                          text = [sprintf(that.options.cardView ?
          Severity: Critical
          Found in public/js/bootstrap-table.js - About 3 hrs to fix

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

                  _proto.show = function show() {
                    var _this = this;
            
                    if ($$$1(this.element).css('display') === 'none') {
                      throw new Error('Please use show on visible elements');
            Severity: Major
            Found in public/js/bootstrap.js - About 3 hrs to fix

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

                  protected function execute(InputInterface $input, OutputInterface $output): void
                  {
                      $firstId = $input->getOption('first-id');
                      if (null !== $firstId) {
                          $firstId = (int) $firstId;
              Severity: Major
              Found in src/Command/ReplayCommand.php - About 3 hrs to fix

                Function _fnGetRowElements has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    function _fnGetRowElements( settings, row, colIdx, d )
                    {
                        var
                            tds = [],
                            td = row.firstChild,
                Severity: Major
                Found in public/js/jquery.dataTables.js - About 2 hrs to fix

                  Function matcherFromGroupMatchers has 72 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
                      var bySet = setMatchers.length > 0,
                          byElement = elementMatchers.length > 0,
                          superMatcher = function( seed, context, xml, results, outermost ) {
                              var elem, j, matcher,
                  Severity: Major
                  Found in public/js/jquery.js - About 2 hrs to fix

                    Function add has 72 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

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

                      Function _fnAjaxParameters has 72 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          function _fnAjaxParameters( settings )
                          {
                              var
                                  columns = settings.aoColumns,
                                  columnCount = columns.length,
                      Severity: Major
                      Found in public/js/jquery.dataTables.js - About 2 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 VSV\GVQ_API\Quiz\Events\AnsweredCorrect;
                        Severity: Major
                        Found in src/Quiz/Serializers/AnsweredCorrectNormalizer.php and 1 other location - About 2 hrs to fix
                        src/Quiz/Serializers/AnsweredIncorrectNormalizer.php on lines 1..31

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

                        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 VSV\GVQ_API\Quiz\Events\AnsweredIncorrect;
                        Severity: Major
                        Found in src/Quiz/Serializers/AnsweredIncorrectNormalizer.php and 1 other location - About 2 hrs to fix
                        src/Quiz/Serializers/AnsweredCorrectNormalizer.php on lines 1..31

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

                        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

                        File QuestionFormType.php has 286 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        <?php declare(strict_types=1);
                        
                        namespace VSV\GVQ_API\Question\Forms;
                        
                        use Ramsey\Uuid\UuidFactoryInterface;
                        Severity: Minor
                        Found in src/Question/Forms/QuestionFormType.php - About 2 hrs to fix

                          Function _fnSort has 71 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              function _fnSort ( oSettings )
                              {
                                  var
                                      i, ien, iLen, j, jLen, k, kLen,
                                      sDataType, nTh,
                          Severity: Major
                          Found in public/js/jquery.dataTables.js - About 2 hrs to fix

                            Function attach has 71 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                var attach = function( container, buttons ) {
                                    var i, ien, node, button;
                                    var clickHandler = function ( e ) {
                                        e.preventDefault();
                                        if ( !$(e.currentTarget).hasClass('disabled') && api.page() != e.data.action ) {
                            Severity: Major
                            Found in public/js/dataTables.bootstrap4.js - About 2 hrs to fix

                              AccountViewController has 25 functions (exceeds 20 allowed). Consider refactoring.
                              Open

                              class AccountViewController extends AbstractController
                              {
                                  /**
                                   * @var RegistrationFormType
                                   */
                              Severity: Minor
                              Found in src/Account/Controllers/AccountViewController.php - About 2 hrs to fix

                                Function resolve has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                                    function resolve( depth, deferred, handler, special ) {
                                                        return function() {
                                                            var that = this,
                                                                args = arguments,
                                                                mightThrow = function() {
                                Severity: Major
                                Found in public/js/jquery.js - About 2 hrs to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language