Showing 124 of 124 total issues
Function chado_expand_var
has a Cognitive Complexity of 171 (exceeds 25 allowed). Consider refactoring. Open
function chado_expand_var($object, $type, $to_expand, $table_options = [], $schema_name = NULL) {
// Set default schema.
if (!$schema_name) {
$schema_name = \Drupal::config('tripal_chado.settings')->get('default_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 chado_generate_var
has a Cognitive Complexity of 121 (exceeds 25 allowed). Consider refactoring. Open
function chado_generate_var($table, $values, $base_options = [], $schema_name = NULL) {
// Set default schema.
if (!$schema_name) {
$schema_name = \Drupal::config('tripal_chado.settings')->get('default_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 chado_select_record
has a Cognitive Complexity of 118 (exceeds 25 allowed). Consider refactoring. Open
function chado_select_record($table, $columns, $values, $options = NULL, $chado_schema_name = NULL) {
// Set defaults for options. If we don't set defaults then
// we get memory leaks when we try to access the elements.
if (!is_array($options)) {
$options = [];
- 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 chado_phylogeny_import_tree
has a Cognitive Complexity of 115 (exceeds 25 allowed). Consider refactoring. Open
function chado_phylogeny_import_tree(&$tree, $phylotree, $options, $vocab = [], $parent = NULL, $schema_name = 'chado') {
$chado = \Drupal::service('tripal_chado.database');
$chado->setSchemaName($schema_name);
// Used for final summary message at end of recursion.
- 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 25 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 chado_insert_record
has a Cognitive Complexity of 79 (exceeds 25 allowed). Consider refactoring. Open
function chado_insert_record($table, $values, $options = [], $chado_schema_name = NULL) {
$print_errors = (isset($options['print_errors'])) ? $options['print_errors'] : FALSE;
if (!is_array($values)) {
- 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 loadFastaFeature
has a Cognitive Complexity of 75 (exceeds 25 allowed). Consider refactoring. Open
private function loadFastaFeature($fh, $name, $uname, $db_id, $accession, $parent,
$rel_type, $parent_type, $analysis_id, $organism_id, $cvterm, $source, $method, $re_name,
$match_type, $parentcvterm, $relcvterm, $seq_start, $seq_end) {
$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 parseTableDdlToDrupal
has a Cognitive Complexity of 67 (exceeds 25 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 chado_validate_phylotree
has a Cognitive Complexity of 65 (exceeds 25 allowed). Consider refactoring. Open
function chado_validate_phylotree($val_type, &$options, &$errors, &$warnings, $schema_name = 'chado') {
$chado = \Drupal::service('tripal_chado.database');
$chado->setSchemaName($schema_name);
if ($val_type != 'insert' and $val_type != 'update') {
\Drupal::service('tripal.logger')->error("The \$val_type argument to"
- 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 chado_insert_cvterm
has a Cognitive Complexity of 64 (exceeds 25 allowed). Consider refactoring. Open
function chado_insert_cvterm($term, $options = [], $schema_name = NULL) {
// Set default schema.
if (!$schema_name) {
$schema_name = \Drupal::config('tripal_chado.settings')->get('default_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 loadFasta
has a Cognitive Complexity of 64 (exceeds 25 allowed). Consider refactoring. Open
private function loadFasta($file_path, $organism_id, $type, $re_name, $re_uname, $re_accession,
$db_id, $rel_type, $re_subject, $parent_type, $method, $analysis_id, $match_type) {
$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 parse
has a Cognitive Complexity of 62 (exceeds 25 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 importRecord
has a Cognitive Complexity of 59 (exceeds 25 allowed). Consider refactoring. Open
private function importRecord($taxid, $root_taxon = NULL, $organism = NULL) {
$adds_organism = $organism ? FALSE : TRUE;
// Get the "rank" cvterm. It requires that the TAXRANK vocabulary is loaded.
$rank_cvterm = chado_get_cvterm([
- 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 chado_update_record
has a Cognitive Complexity of 58 (exceeds 25 allowed). Consider refactoring. Open
function chado_update_record($table, $match, $values, $options = NULL, $chado_schema_name = NULL) {
$print_errors = (isset($options['print_errors'])) ? $options['print_errors'] : FALSE;
if (!is_array($values)) {
- 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 54 (exceeds 25 allowed). Consider refactoring. Open
protected function validateTypes($base_table, $delta, $record_id, $record) {
$schema = $this->connection->schema();
$table_def = $schema->getTableDef($base_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 preSave
has a Cognitive Complexity of 53 (exceeds 25 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 setPropValues
has a Cognitive Complexity of 51 (exceeds 25 allowed). Consider refactoring. Open
protected function setPropValues(&$values, ChadoRecords $records) {
$schema = $this->connection->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 cleanUnusedSharedLocks
has a Cognitive Complexity of 50 (exceeds 25 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 updateExisting
has a Cognitive Complexity of 49 (exceeds 25 allowed). Consider refactoring. Open
private function updateExisting($root_taxon = NULL) {
$total = count($this->all_orgs);
$omitted_organisms = [];
$api_key = \Drupal::state()->get('tripal_ncbi_api_key', NULL);
- 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 45 (exceeds 25 allowed). Consider refactoring. Open
protected function validateUnique($base_table, $delta, $record_id, $record) {
$schema = $this->connection->schema();
$table_def = $schema->getTableDef($base_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"