Showing 174 of 174 total issues
Function processField
has a Cognitive Complexity of 11 (exceeds 7 allowed). Consider refactoring. Open
function processField($field) {
if (!isset($field['size'])) {
$field['size'] = 'normal';
}
- 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 prepareAggregateFunctionUpgrade
has a Cognitive Complexity of 11 (exceeds 7 allowed). Consider refactoring. Open
protected function prepareAggregateFunctionUpgrade() {
$chado_schema = $this->outputSchemas[0];
$ref_schema = $this->inputSchemas[0];
// Get the list of new aggregate functions.
- 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 validateParameters
has a Cognitive Complexity of 11 (exceeds 7 allowed). Consider refactoring. Open
public function validateParameters() :void {
try {
// Select a default version if needed.
if (empty($this->parameters['version'])) {
$this->parameters['version'] = static::DEFAULT_CHADO_VERSION;
- 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 createFieldSql
has a Cognitive Complexity of 10 (exceeds 7 allowed). Consider refactoring. Open
function createFieldSql($name, $spec) {
// The PostgreSQL server converts names into lowercase, unless quoted.
$sql = '"' . $name . '" ' . $spec['pgsql_type'];
if (isset($spec['type']) && $spec['type'] == 'serial') {
- 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 getTokens
has a Cognitive Complexity of 10 (exceeds 7 allowed). Consider refactoring. Open
public function getTokens($options = []) {
$tokens = [];
// Set default 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 fixTermMismatch
has a Cognitive Complexity of 10 (exceeds 7 allowed). Consider refactoring. Open
private function fixTermMismatch($stanza, $dbxref, $cv, $name) {
$chado = $this->getChadoConnection();
$name = $stanza['name'][0];
- 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 isEmpty
has a Cognitive Complexity of 10 (exceeds 7 allowed). Consider refactoring. Open
public function isEmpty() {
foreach ($this->properties as $property) {
$definition = $property
->getDataDefinition();
if (!$definition
- 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 loadOBO_v1_2_id
has a Cognitive Complexity of 10 (exceeds 7 allowed). Consider refactoring. Open
private function loadOBO_v1_2_id($obo) {
// Convert the module name to the real path if present
$matches = [];
if (preg_match("/\{(.*?)\}/", $obo->path, $matches)) {
- 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 tripal_set_message
has a Cognitive Complexity of 10 (exceeds 7 allowed). Consider refactoring. Open
function tripal_set_message($message, $importance = TRIPAL_INFO, $options = []) {
$user = \Drupal::currentUser();
global $user;
// Only show the message to the users with 'view dev helps' permission.
- 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 getColumnTermId
has a Cognitive Complexity of 10 (exceeds 7 allowed). Consider refactoring. Open
public function getColumnTermId($table, $column) : string {
foreach ($this->tables as $table_def) {
if ($table_def['name'] == $table) {
foreach ($table_def['columns'] as $column_def) {
if ($column_def['name'] == $column) {
- 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 acquireShared
has a Cognitive Complexity of 10 (exceeds 7 allowed). Consider refactoring. Open
public function acquireShared(
string $name,
float $timeout = self::DEFAULT_LOCK_TIMEOUT,
string $owner = '',
?int $pid = 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 findDbxrefs
has a Cognitive Complexity of 10 (exceeds 7 allowed). Consider refactoring. Open
private function findDbxrefs() {
$chado = $this->getChadoConnection();
$batch_size = 1000;
$num_dbxrefs = count(array_keys($this->dbxref_lookup));
$num_batches = (int) ($num_dbxrefs / $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 validateTableSchema
has a Cognitive Complexity of 10 (exceeds 7 allowed). Consider refactoring. Open
static public function validateTableSchema($table_schema) {
$messages = [];
$logger = \Drupal::service('tripal.logger');
if (!$table_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 saveTerm
has a Cognitive Complexity of 10 (exceeds 7 allowed). Consider refactoring. Open
public function saveTerm($term, $options = []) {
// Don't save terms that aren't valid
if (!$term->isValid()) {
$this->messageLogger->error(t('ChadoIdSpace::saveTerm(). The term, "@term" is not valid and cannot be saved. It must include a name, accession, IdSpace and vocabulary.',
- 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 prepSynonms
has a Cognitive Complexity of 10 (exceeds 7 allowed). Consider refactoring. Open
private function prepSynonms() {
// make sure we have a 'synonym_type' vocabulary
$select = ['name' => 'synonym_type'];
$results = chado_select_record('cv', ['*'], $select);
- 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 performTask
has a Cognitive Complexity of 10 (exceeds 7 allowed). Consider refactoring. Open
public function performTask() :bool {
// Task return status.
$task_success = FALSE;
// Validate parameters.
- 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 prepareCommentUpgrade
has a Cognitive Complexity of 10 (exceeds 7 allowed). Consider refactoring. Open
protected function prepareCommentUpgrade() {
$chado_schema = $this->outputSchemas[0];
$ref_schema = $this->inputSchemas[0];
$this->upgradeQueries['#comments'] = [];
- 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 findTables
has a Cognitive Complexity of 9 (exceeds 7 allowed). Consider refactoring. Open
public function findTables($table_expression) {
if ($table_expression === NULL) {
return [];
}
- 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"