Function buildChadoRecords
has a Cognitive Complexity of 107 (exceeds 7 allowed). Consider refactoring. Open
protected function buildChadoRecords($values, bool $is_store) {
$logger = \Drupal::service('tripal.logger');
$chado = $this->getChadoConnection();
$schema = $chado->schema();
$records = [];
- 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 setPropValues
has a Cognitive Complexity of 73 (exceeds 7 allowed). Consider refactoring. Open
protected function setPropValues(&$values, $records) {
$chado = $this->getChadoConnection();
$schema = $chado->schema();
$replace = [];
- 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 validateTypes
has a Cognitive Complexity of 52 (exceeds 7 allowed). Consider refactoring. Open
public function validateTypes($values, $chado_table, $record_id, $record, &$violations) {
$chado = $this->getChadoConnection();
$schema = $chado->schema();
$table_def = $schema->getTableDef($chado_table, ['format' => 'drupal']);
- 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 validateUnique
has a Cognitive Complexity of 40 (exceeds 7 allowed). Consider refactoring. Open
private function validateUnique($values, $chado_table, $record_id, $record, &$violations) {
$chado = $this->getChadoConnection();
$schema = $chado->schema();
$table_def = $schema->getTableDef($chado_table, ['format' => 'drupal']);
- 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 insertValues
has a Cognitive Complexity of 35 (exceeds 7 allowed). Consider refactoring. Open
public function insertValues(&$values) : bool {
$chado = $this->getChadoConnection();
$logger = \Drupal::service('tripal.logger');
$schema = $chado->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"
Further reading
Function updateValues
has a Cognitive Complexity of 34 (exceeds 7 allowed). Consider refactoring. Open
public function updateValues(&$values) : bool {
$chado = $this->getChadoConnection();
$logger = \Drupal::service('tripal.logger');
$build = $this->buildChadoRecords($values, TRUE);
- 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 setRecordIds
has a Cognitive Complexity of 27 (exceeds 7 allowed). Consider refactoring. Open
protected function setRecordIds(&$values, $records) {
$chado = $this->getChadoConnection();
$schema = $chado->schema();
// Iterate through the value objects.
- 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 validateSize
has a Cognitive Complexity of 18 (exceeds 7 allowed). Consider refactoring. Open
public function validateSize($values, $chado_table, $record_id, $record, &$violations) {
$chado = $this->getChadoConnection();
$schema = $chado->schema();
$table_def = $schema->getTableDef($chado_table, ['format' => 'drupal']);
- 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 validateFKs
has a Cognitive Complexity of 18 (exceeds 7 allowed). Consider refactoring. Open
private function validateFKs($values, $chado_table, $record_id, $record, &$violations) {
$chado = $this->getChadoConnection();
$schema = $chado->schema();
$table_def = $schema->getTableDef($chado_table, ['format' => 'drupal']);
- 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 selectChadoRecord
has a Cognitive Complexity of 16 (exceeds 7 allowed). Consider refactoring. Open
public function selectChadoRecord(&$records, $base_tables, $chado_table, $delta, $record) {
$chado = $this->getChadoConnection();
if (!array_key_exists('conditions', $record)) {
throw new \Exception($this->t('Cannot select record in the Chado "@table" table due to missing conditions. Record: @record',
- 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 validateRequired
has a Cognitive Complexity of 15 (exceeds 7 allowed). Consider refactoring. Open
private function validateRequired($values, $chado_table, $record_id, $record, &$violations) {
$chado = $this->getChadoConnection();
$schema = $chado->schema();
$table_def = $schema->getTableDef($chado_table, ['format' => 'drupal']);
$pkey = $table_def['primary key'];
- 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 removeTypes
has a Cognitive Complexity of 10 (exceeds 7 allowed). Consider refactoring. Open
public function removeTypes($types) {
foreach ($types as $type) {
$entity_type = $type->getEntityType();
$field_type = $type->getFieldType();
- 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 addTypes
has a Cognitive Complexity of 9 (exceeds 7 allowed). Consider refactoring. Open
public function addTypes($types) {
$logger = \Drupal::service('tripal.logger');
// Index the types by their entity type, field type and key.
foreach ($types as $index => $type) {
- 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"