Showing 160 of 174 total issues
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"
Further reading
Function checkSequenceExists
has a Cognitive Complexity of 9 (exceeds 7 allowed). Consider refactoring. Open
public function checkSequenceExists($table, $column, $sequence_name = NULL) {
if ($sequence_name === NULL) {
// Ensure they gave us a table.
- 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 submitForm
has a Cognitive Complexity of 9 (exceeds 7 allowed). Consider refactoring. Open
public function submitForm(array &$form, FormStateInterface $form_state) {
$values = $form_state->getValues();
$action = $values['action'];
$mview_id = $values['mview_id'];
$chado_schema = $values['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 tripalClear
has a Cognitive Complexity of 9 (exceeds 7 allowed). Consider refactoring. Open
public function tripalClear($field_item, $field_name, $prop_types, $prop_values, $entity) {
$delta = $field_item->getName();
foreach ($prop_values as $prop_value) {
$prop_key = $prop_value->getKey();
- 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 associateChildren
has a Cognitive Complexity of 9 (exceeds 7 allowed). Consider refactoring. Open
private function associateChildren() {
$this->setItemsHandled(0);
$this->setTotalItems(count(array_keys($this->features)));
// Iterate through parent-child relationships and set the ranks.
- 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 executeSqlQueries
has a Cognitive Complexity of 9 (exceeds 7 allowed). Consider refactoring. Open
public function executeSqlQueries(
string $sql_queries,
$search_path_mode = FALSE,
?string $schema_name = NULL
) :bool {
- 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 prepDBs
has a Cognitive Complexity of 9 (exceeds 7 allowed). Consider refactoring. Open
private function prepDBs() {
// Get the list of database records that are needed by this GFF file. If
// they do not exist then add them.
foreach (array_keys($this->db_lookup) as $dbname) {
- 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 formElement
has a Cognitive Complexity of 9 (exceeds 7 allowed). Consider refactoring. Open
public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state) {
$chado = \Drupal::service('tripal_chado.database');
// Get the field settings.
$field_definition = $items[$delta]->getFieldDefinition();
- 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 log2Message
has a Cognitive Complexity of 9 (exceeds 7 allowed). Consider refactoring. Open
protected function log2Message($level, $message, $context = []) {
if (in_array($level, ['info', 'notice'])) {
$status = \Drupal\Core\Messenger\MessengerInterface::TYPE_STATUS;
}
- 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 submitForm
has a Cognitive Complexity of 9 (exceeds 7 allowed). Consider refactoring. Open
public function submitForm(array &$form, FormStateInterface $form_state) {
$values = $form_state->getValues();
$action = $values['action'];
$table_id = $values['table_id'];
$chado_schema = $values['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 validateParameters
has a Cognitive Complexity of 9 (exceeds 7 allowed). Consider refactoring. Open
public function validateParameters() :void {
try {
// Check input.
if (empty($this->parameters['input_schemas'])
|| (1 != count($this->parameters['input_schemas']))
- 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
Avoid too many return
statements within this method. Open
return tripal_file_upload_merge($filename, $type, $user_dir);
Avoid too many return
statements within this method. Open
return tripal_file_upload_verify($filename, $chunk, $user_dir);
Avoid too many return
statements within this method. Open
return FALSE;
Function tripalDashboard
has a Cognitive Complexity of 8 (exceeds 7 allowed). Consider refactoring. Open
public function tripalDashboard() {
$output = '';
$block_manager = \Drupal::service('plugin.manager.block');
// You can hard code configuration or you load from settings.
$config = [];
- 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"