Showing 160 of 174 total issues
Function prepareUpgradeTables
has a Cognitive Complexity of 124 (exceeds 7 allowed). Consider refactoring. Open
protected function prepareUpgradeTables() {
$chado_schema = $this->outputSchemas[0];
$ref_schema = $this->inputSchemas[0];
// Column-specific upgrade procedures. First level keys are table names,
- 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 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 parseGFF3Line
has a Cognitive Complexity of 81 (exceeds 7 allowed). Consider refactoring. Open
private function parseGFF3Line($line) {
// get the columns
$cols = explode("\t", $line);
if (sizeof($cols) != 9) {
- 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 parseTableDdlToDrupal
has a Cognitive Complexity of 67 (exceeds 7 allowed). Consider refactoring. Open
public function parseTableDdlToDrupal(string $table_ddl) :array {
$tripaldbx = \Drupal::service('tripal.dbx');
$table_structure = $tripaldbx->parseTableDdl($table_ddl);
// Start with the name of the table.
$table_def = [];
- 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 cleanUnusedSharedLocks
has a Cognitive Complexity of 50 (exceeds 7 allowed). Consider refactoring. Open
public function cleanUnusedSharedLocks() {
// Acquire a state modification lock.
if ($this->modLocker->acquire(static::STATE_KEY_SHARED)) {
// Get shared lock status.
$shared_locks = $this->state->get(static::STATE_KEY_SHARED, []);
- 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 setFieldDefDefaults
has a Cognitive Complexity of 44 (exceeds 7 allowed). Consider refactoring. Open
public function setFieldDefDefaults(array $field_def = []) : array {
$new_defs = [];
$new_defs['name'] = 'tripal_entity.change.me';
if (array_key_exists('name', $field_def) and !empty($field_def['name'])) {
- 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 addBaseTableSVFields
has a Cognitive Complexity of 44 (exceeds 7 allowed). Consider refactoring. Open
private function addBaseTableSVFields(TripalEntityType $entityType, string $chado_table) {
// We need the idSpace manager object.
$idSpace_manager = \Drupal::service('tripal.collection_plugin_manager.idspace');
- 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 preSave
has a Cognitive Complexity of 43 (exceeds 7 allowed). Consider refactoring. Open
public function preSave(EntityStorageInterface $storage) {
parent::preSave($storage);
// Create a values array appropriate for `loadValues()`
list($values, $tripal_storages) = TripalEntity::getValuesArray($this);
- 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 __construct
has a Cognitive Complexity of 43 (exceeds 7 allowed). Consider refactoring. Open
public function __construct(array $details = NULL) {
// Instantiate the TripalLogger.
$this->messageLogger = \Drupal::service('tripal.logger');
- 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 parse
has a Cognitive Complexity of 41 (exceeds 7 allowed). Consider refactoring. Open
private function parse($obo_file, &$header) {
// Set to 1 if we are in the top header lines of the file.
$in_header = TRUE;
// Holds the full stanza for the term.
$stanza = [];
- 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 findEBITerm
has a Cognitive Complexity of 40 (exceeds 7 allowed). Consider refactoring. Open
private function findEBITerm($id) {
// Warn the user if we're looking up terms in EBI as this will slow the
// loader if there are many lookups.
if ($this->ebi_warned == FALSE) {
- 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 processTerm
has a Cognitive Complexity of 39 (exceeds 7 allowed). Consider refactoring. Open
private function processTerm($stanza, $is_relationship = 0) {
$chado = $this->getChadoConnection();
//
- 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 cacheTermStanza
has a Cognitive Complexity of 38 (exceeds 7 allowed). Consider refactoring. Open
private function cacheTermStanza($stanza, $type) {
// Make sure we have defaults.
if (!$this->default_namespace) {
throw new \Exception('Cannot cache terms without a default CV.' . print_r($stanza, 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 parseTableDdl
has a Cognitive Complexity of 38 (exceeds 7 allowed). Consider refactoring. Open
public function parseTableDdl(string $table_ddl) :array {
$table_definition = [
'columns' => [],
'constraints' => [],
'indexes' => [],
- 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 onFieldableEntityTypeUpdate
has a Cognitive Complexity of 37 (exceeds 7 allowed). Consider refactoring. Open
public function onFieldableEntityTypeUpdate(EntityTypeInterface $entity_type, EntityTypeInterface $original, array $field_storage_definitions, array $original_field_storage_definitions, array &$sandbox = NULL) {
parent::onFieldableEntityTypeUpdate($entity_type,$original,$field_storage_definitions,$original_field_storage_definitions,$sandbox);
// build associate array of old fields
$oldTypes = [];
- 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 findFeatures
has a Cognitive Complexity of 36 (exceeds 7 allowed). Consider refactoring. Open
private function findFeatures() {
$chado = $this->getChadoConnection();
$batch_size = 1000;
$num_features = count(array_keys($this->features));
$num_batches = (int) ($num_features / $batch_size) + 1;
- 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"