Showing 174 of 174 total issues
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"
Further reading
Function insertSynonyms
has a Cognitive Complexity of 8 (exceeds 7 allowed). Consider refactoring. Open
private function insertSynonyms() {
$chado = $this->getChadoConnection();
$batch_size = 1000;
$num_synonyms = count(array_keys($this->synonym_lookup));
$num_batches = (int) ($num_synonyms / $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 onFieldableEntityTypeCreate
has a Cognitive Complexity of 8 (exceeds 7 allowed). Consider refactoring. Open
public function onFieldableEntityTypeCreate(EntityTypeInterface $entity_type, array $field_storage_definitions) {
parent::onFieldableEntityTypeCreate($entity_type,$field_storage_definitions);
// This is where we create the types each field describes in the
// associated TripalStorage instance.
- 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 isInvalidSchemaName
has a Cognitive Complexity of 8 (exceeds 7 allowed). Consider refactoring. Open
public function isInvalidSchemaName(
string $schema_name,
bool $ignore_reservation = FALSE,
bool $reload_config = FALSE
) :string {
- 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 onEntityTypeDelete
has a Cognitive Complexity of 8 (exceeds 7 allowed). Consider refactoring. Open
public function onEntityTypeDelete(EntityTypeInterface $entity_type) {
// build remove storage operations
$storageOps = [];
foreach ($this->fieldStorageDefinitions() as $storageDefinition) {
- 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 addBundleField
has a Cognitive Complexity of 8 (exceeds 7 allowed). Consider refactoring. Open
public function addBundleField(string $bundle, array $field_def) : bool {
$logger = \Drupal::service('tripal.logger');
if (!$this->validateFieldDef($field_def)) {
return 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 setSchemaName
has a Cognitive Complexity of 8 (exceeds 7 allowed). Consider refactoring. Open
public function setSchemaName(string $schema_name) :void {
// Does schema change?
if (!empty($this->schemaName) && ($schema_name == $this->schemaName)) {
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"