SU-SWS/stanford_fields

View on GitHub
src/Plugin/Field/FieldWidget/LocalistUrlWidget.php

Summary

Maintainability
A
0 mins
Test Coverage
A
98%

Showing 5 of 22 total issues

File LocalistUrlWidget.php has 295 lines of code (exceeds 250 allowed). Consider refactoring.
Wontfix

<?php
 
namespace Drupal\stanford_fields\Plugin\Field\FieldWidget;
 
use Drupal\Component\Utility\NestedArray;
Severity: Minor
Found in src/Plugin/Field/FieldWidget/LocalistUrlWidget.php - About 3 hrs to fix

    Method formElement has 41 lines of code (exceeds 40 allowed). Consider refactoring.
    Wontfix

    public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state) {
    $element = parent::formElement($items, $delta, $element, $form, $form_state);
    // Fallback to inherited link widget if the base_url is not set.
    if (!$this->getSetting('base_url')) {
    return $element;
    Severity: Minor
    Found in src/Plugin/Field/FieldWidget/LocalistUrlWidget.php - About 1 hr to fix

      Function massageFormValues has a Cognitive Complexity of 12 (exceeds 10 allowed). Consider refactoring.
      Wontfix

      public function massageFormValues(array $values, array $form, FormStateInterface $form_state) {
      if (!$this->getSetting('base_url')) {
      return parent::massageFormValues($values, $form, $form_state);
      }
       
       
      Severity: Minor
      Found in src/Plugin/Field/FieldWidget/LocalistUrlWidget.php - About 35 mins to fix

      syntax error, unexpected ','
      Open

      id: 'localist_url',

      Doc comment short description must start with a capital letter
      Wontfix

      * {@inheritDoc}

      Line indented incorrectly; expected 0 spaces, found 2
      Open

      id: 'localist_url',

      Doc comment short description must end with a full stop
      Wontfix

      * {@inheritDoc}

      Missing class doc comment
      Open

      class LocalistUrlWidget extends LinkWidget {

      Doc comment short description must start with a capital letter
      Wontfix

      * {@inheritDoc}

      Doc comment short description must start with a capital letter
      Wontfix

      * {@inheritDoc}

      Doc comment short description must end with a full stop
      Wontfix

      * {@inheritDoc}

      Doc comment short description must start with a capital letter
      Wontfix

      * {@inheritDoc}

      Doc comment short description must end with a full stop
      Wontfix

      * {@inheritDoc}

      Doc comment short description must start with a capital letter
      Wontfix

      * {@inheritDoc}

      Perl-style comments are not allowed; use "// Comment" instead
      Open

      #[FieldWidget(

      Unused use statement
      Open

      use Drupal\Core\Field\Attribute\FieldWidget;

      Doc comment short description must end with a full stop
      Wontfix

      * {@inheritDoc}

      Doc comment short description must end with a full stop
      Wontfix

      * {@inheritDoc}

      Doc comment short description must end with a full stop
      Wontfix

      * {@inheritDoc}

      Doc comment short description must end with a full stop
      Wontfix

      * {@inheritDoc}

      Doc comment short description must start with a capital letter
      Wontfix

      * {@inheritDoc}

      Doc comment short description must start with a capital letter
      Wontfix

      * {@inheritDoc}

      There are no issues that match your filters.

      Category
      Status