Showing 14 of 98 total issues
Data
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
class Data implements MetastoreItemInterface {
/**
* Node.
*
ComplexDataFacade
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class ComplexDataFacade implements \Iterator, ComplexDataInterface {
/**
* Inherited.
*
File DashboardForm.php
has 273 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace Drupal\datastore\Form;
use Drupal\Core\Pager\PagerManagerInterface;
AbstractDatabaseTable
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class AbstractDatabaseTable implements DatabaseTableInterface {
use EventDispatcherTrait;
/**
* The event name we send when we create a table.
Data
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class Data implements MetastoreEntityStorageInterface {
/**
* Entity type manager.
*
ResourcePurger
has 21 functions (exceeds 20 allowed). Consider refactoring. Confirmed
class ResourcePurger implements ContainerInjectionInterface {
/**
* The datastore.settings config.
*
Method __construct
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
array $configuration,
$plugin_id,
$plugin_definition,
AlterTableQueryBuilderInterface $alter_table_query_builder,
LoggerInterface $logger_channel,
Method __construct
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
$plugin_id,
$plugin_definition,
FieldDefinitionInterface $field_definition,
array $settings,
array $third_party_settings,
Method __construct
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
array $configuration,
$pluginId,
$pluginDefinition,
LoggerInterface $loggerChannel,
MessengerInterface $messenger,
Method getFormElement
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function getFormElement($type, $definition, $data, $object_schema = NULL, $form_state = NULL, array $context = []) {
Function expandDirectories
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function expandDirectories($base_dir) {
$directories = [];
if (!file_exists($base_dir)) {
return $directories;
- Read upRead up
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
Method formElement
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state) {
Function flattenValues
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function flattenValues($formValues, $property, $schema) {
$data = [];
switch ($schema->type) {
case 'string':
- Read upRead up
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 getObjectInArrayData
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function getObjectInArrayData($formValues, $property, $schema) {
$data = [];
if (isset($formValues[$property][$property])) {
foreach ($formValues[$property][$property] as $key => $item) {
$value = $this->handleObjectValues($formValues[$property][$property][$key][$property], $property, $schema);
- Read upRead up
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"