src/Plugin/Field/FieldWidget/TaxonomyLabelHierarchyWidget.php
Showing 11 of 11 total issues
Method formElement
has 58 lines of code (exceeds 40 allowed). Consider refactoring. Open
Open
public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state): array { $element = parent::formElement($items, $delta, $element, $form, $form_state); $options = $this->getOptions($items->getEntity()); $selected_items = $this->getSelectedOptions($items);
Function formElement
has a Cognitive Complexity of 11 (exceeds 10 allowed). Consider refactoring. Open
Open
public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state): array { $element = parent::formElement($items, $delta, $element, $form, $form_state); $options = $this->getOptions($items->getEntity()); $selected_items = $this->getSelectedOptions($items);
- Read upRead up
syntax error, unexpected ','
Open
Open
id: 'taxonomy_label_hierarchy',
- Exclude checks
Perl-style comments are not allowed; use "// Comment" instead Open
Open
#[FieldWidget(
- Exclude checks
Expected 1 space after "="; 0 found Open
Open
declare(strict_types=1);
- Exclude checks
Unused use statement Open
Open
use Drupal\Core\Field\Attribute\FieldWidget;
- Exclude checks
Missing class doc comment Open
Open
final class TaxonomyLabelHierarchyWidget extends OptionsWidgetBase {
- Exclude checks
Line indented incorrectly; expected 0 spaces, found 2 Open
Open
id: 'taxonomy_label_hierarchy',
- Exclude checks
Doc comment short description must start with a capital letter Open
Open
* {@inheritDoc}
- Exclude checks
Expected 1 space before "="; 0 found Open
Open
declare(strict_types=1);
- Exclude checks
Doc comment short description must end with a full stop Open
Open
* {@inheritDoc}
- Exclude checks