VSVverkeerskunde/gvq-api

View on GitHub

Showing 1,426 of 1,426 total issues

Avoid excessively long variable names like $uniqueParticipantRepository. Keep variable name length under 20.
Open

    private $uniqueParticipantRepository;

LongVariable

Since: 0.2

Detects when a field, formal or local variable is declared with a long name.

Example

class Something {
    protected $reallyLongIntName = -3; // VIOLATION - Field
    public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
        $otherReallyLongName = -5; // VIOLATION - Local
        for ($interestingIntIndex = 0; // VIOLATION - For
             $interestingIntIndex < 10;
             $interestingIntIndex++ ) {
        }
    }
}

Source https://phpmd.org/rules/naming.html#longvariable

Avoid excessively long variable names like $uniqueParticipantsCount. Keep variable name length under 20.
Open

    private $uniqueParticipantsCount;

LongVariable

Since: 0.2

Detects when a field, formal or local variable is declared with a long name.

Example

class Something {
    protected $reallyLongIntName = -3; // VIOLATION - Field
    public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
        $otherReallyLongName = -5; // VIOLATION - Local
        for ($interestingIntIndex = 0; // VIOLATION - For
             $interestingIntIndex < 10;
             $interestingIntIndex++ ) {
        }
    }
}

Source https://phpmd.org/rules/naming.html#longvariable

Avoid excessively long variable names like $teamParticipationRepository. Keep variable name length under 20.
Open

        TeamParticipationRepository $teamParticipationRepository
Severity: Minor
Found in src/Team/Service/TeamService.php by phpmd

LongVariable

Since: 0.2

Detects when a field, formal or local variable is declared with a long name.

Example

class Something {
    protected $reallyLongIntName = -3; // VIOLATION - Field
    public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
        $otherReallyLongName = -5; // VIOLATION - Local
        for ($interestingIntIndex = 0; // VIOLATION - For
             $interestingIntIndex < 10;
             $interestingIntIndex++ ) {
        }
    }
}

Source https://phpmd.org/rules/naming.html#longvariable

Function access has 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
    var i = 0,
        len = elems.length,
        bulk = key == null;

Severity: Minor
Found in public/js/jquery.js - About 1 hr to fix

    Function extend has 41 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    jQuery.extend = jQuery.fn.extend = function() {
        var options, name, src, copy, copyIsArray, clone,
            target = arguments[ 0 ] || {},
            i = 1,
            length = arguments.length,
    Severity: Minor
    Found in public/js/jquery.js - About 1 hr to fix

      Function stop has 41 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          stop: function( type, clearQueue, gotoEnd ) {
              var stopQueue = function( hooks ) {
                  var stop = hooks.stop;
                  delete hooks.stop;
                  stop( gotoEnd );
      Severity: Minor
      Found in public/js/jquery.js - About 1 hr to fix

        Function style has 41 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            style: function( elem, name, value, extra ) {
        
                // Don't set styles on text and comment nodes
                if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
                    return;
        Severity: Minor
        Found in public/js/jquery.js - About 1 hr to fix

          Function _fnFeatureHtmlPaginate has 41 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function _fnFeatureHtmlPaginate ( settings )
              {
                  var
                      type   = settings.sPaginationType,
                      plugin = DataTable.ext.pager[ type ],
          Severity: Minor
          Found in public/js/jquery.dataTables.js - About 1 hr to fix

            Function initContainer has 41 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                BootstrapTable.prototype.initContainer = function () {
                    this.$container = $([
                        '<div class="bootstrap-table">',
                        '<div class="fixed-table-toolbar"></div>',
                        this.options.paginationVAlign === 'top' || this.options.paginationVAlign === 'both' ?
            Severity: Minor
            Found in public/js/bootstrap-table.js - About 1 hr to fix

              Method getTopCompanies has 41 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function getTopCompanies(NaturalNumber $nrOfPassedEmployees): iterable
                  {
                      $batchSize = 10;
                      $firstResult = 0;
              
              
              Severity: Minor
              Found in src/Statistics/Repositories/TopScoreDoctrineRepository.php - About 1 hr to fix

                Method buildForm has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function buildForm(FormBuilderInterface $builder, array $options)
                    {
                        parent::buildForm($builder, $options);
                
                        $languages = $options['languages']->toArray();
                Severity: Minor
                Found in src/User/Forms/UserFormType.php - About 1 hr to fix

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

                      public function edit(Request $request, string $id): Response
                      {
                          $question = $this->questionRepository->getById(
                              $this->uuidFactory->fromString($id)
                          );
                  Severity: Minor
                  Found in src/Question/Controllers/QuestionViewController.php - About 1 hr to fix

                    Function toggleClass has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        toggleClass: function( value, stateVal ) {
                            var type = typeof value,
                                isValidValue = type === "string" || Array.isArray( value );
                    
                            if ( typeof stateVal === "boolean" && isValidValue ) {
                    Severity: Minor
                    Found in public/js/jquery.js - About 1 hr to fix

                      Function on has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function on( elem, types, selector, data, fn, one ) {
                          var origFn, type;
                      
                          // Types can be a map of types/handlers
                          if ( typeof types === "object" ) {
                      Severity: Minor
                      Found in public/js/jquery.js - About 1 hr to fix

                        Function adjustCSS has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function adjustCSS( elem, prop, valueParts, tween ) {
                            var adjusted, scale,
                                maxIterations = 20,
                                currentValue = tween ?
                                    function() {
                        Severity: Minor
                        Found in public/js/jquery.js - About 1 hr to fix

                          Function _fnBrowserDetect has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              function _fnBrowserDetect( settings )
                              {
                                  // We don't need to do this every time DataTables is constructed, the values
                                  // calculated are specific to the browser and OS configuration which we
                                  // don't expect to change between initialisations
                          Severity: Minor
                          Found in public/js/jquery.dataTables.js - About 1 hr to fix

                            Function fetchData has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                        var fetchData = function (data, type, src) {
                                            var arrayNotation, funcNotation, out, innerSrc;
                                
                                            if ( src !== "" )
                                            {
                            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

                                      if (Util.isElement(this._config.parent)) {
                                        parent = this._config.parent; // It's a jQuery object
                              
                                        if (typeof this._config.parent.jquery !== 'undefined') {
                                          parent = this._config.parent[0];
                              Severity: Major
                              Found in public/js/bootstrap.js and 1 other location - About 1 hr to fix
                              public/js/bootstrap.js on lines 1548..1554

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

                              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

                                        } else if (Util.isElement(this._config.reference)) {
                                          referenceElement = this._config.reference; // Check if it's jQuery element
                              
                                          if (typeof this._config.reference.jquery !== 'undefined') {
                                            referenceElement = this._config.reference[0];
                              Severity: Major
                              Found in public/js/bootstrap.js and 1 other location - About 1 hr to fix
                              public/js/bootstrap.js on lines 1289..1297

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

                              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 13 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  protected function execute(InputInterface $input, OutputInterface $output): void
                                  {
                                      $helper = $this->getHelper('question');
                                      $question = new ConfirmationQuestion('Continue with cleaning the read models? ', false);
                              
                              
                              Severity: Minor
                              Found in src/Command/CleanReadModelsCommand.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

                              Severity
                              Category
                              Status
                              Source
                              Language