Showing 174 of 174 total issues
Function storageSettingsForm
has a Cognitive Complexity of 15 (exceeds 7 allowed). Consider refactoring. Open
public function storageSettingsForm(array &$form, FormStateInterface $form_state, $has_data) {
$elements = [];
$settings = $this->getSetting('storage_plugin_settings');
// turn into selection
- 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 cacheRelationships
has a Cognitive Complexity of 15 (exceeds 7 allowed). Consider refactoring. Open
private function cacheRelationships() {
// Now that we have all of the terms parsed and loaded into the cache,
// lets run through them one more time cache any terms in relationships
// as well.
- 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 prefixTables
has a Cognitive Complexity of 15 (exceeds 7 allowed). Consider refactoring. Open
public function prefixTables($sql) {
// Make sure there is no extra "{number:" in the query.
$matches = [];
if (preg_match_all('/\{(\d+):/', $sql, $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 validateRequired
has a Cognitive Complexity of 15 (exceeds 7 allowed). Consider refactoring. Open
private function validateRequired($values, $chado_table, $record_id, $record, &$violations) {
$chado = $this->getChadoConnection();
$schema = $chado->schema();
$table_def = $schema->getTableDef($chado_table, ['format' => 'drupal']);
$pkey = $table_def['primary key'];
- 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 setTableSchema
has a Cognitive Complexity of 15 (exceeds 7 allowed). Consider refactoring. Open
public function setTableSchema($table_schema, $force = False) {
$logger = \Drupal::service('tripal.logger');
if (!$this->table_id) {
$logger->error('Cannot set the schema for the custom table. Please, first run the init() function.');
- 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 insertFeatureProps
has a Cognitive Complexity of 15 (exceeds 7 allowed). Consider refactoring. Open
private function insertFeatureProps(){
$chado = $this->getChadoConnection();
$batch_size = 100;
$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 propertyDefinitions
has a Cognitive Complexity of 14 (exceeds 7 allowed). Consider refactoring. Open
public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) {
$properties = [];
foreach (get_called_class()::tripalTypes($field_definition) as $type) {
if ($type instanceof IntStoragePropertyType) {
- 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 form
has a Cognitive Complexity of 14 (exceeds 7 allowed). Consider refactoring. Open
public function form(array $form, FormStateInterface $form_state) {
$form = parent::form($form, $form_state);
$chado_tables = $this->entity->getTableNames();
$chado_table = $form_state->hasValue('chado_table') ? $form_state->getValue('chado_table') : 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 validateForm
has a Cognitive Complexity of 14 (exceeds 7 allowed). Consider refactoring. Open
public function validateForm(array &$form, FormStateInterface $form_state) {
parent::validateForm($form, $form_state);
$values = $form_state->getValues();
$tripal_entity_type = $this->entity;
- 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 setPrefix
has a Cognitive Complexity of 14 (exceeds 7 allowed). Consider refactoring. Open
protected function setPrefix($prefix) {
if (is_array($prefix)) {
$this->prefixes = $prefix + [
'default' => '',
];
- 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 getAvailableInstances
has a Cognitive Complexity of 14 (exceeds 7 allowed). Consider refactoring. Open
public function getAvailableInstances() :array {
$chado_schemas = [];
// Get test schema prefix. If none set, we use '0' so we can test the prefix
// and avoid false-positive since no schema name is allowed to start by a
- 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 buildForm
has a Cognitive Complexity of 14 (exceeds 7 allowed). Consider refactoring. Open
public function buildForm(array $form, FormStateInterface $form_state, $plugin_id = NULL) {
if (!$plugin_id) {
return $form;
}
- 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 validateForm
has a Cognitive Complexity of 14 (exceeds 7 allowed). Consider refactoring. Open
public function validateForm(array &$form, FormStateInterface $form_state) {
// Convert the validation code into the D8/9 equivalent
$form_values = $form_state->getValues();
$plugin_id = $form_values['importer_plugin_id'];
- 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 queryTableInformation
has a Cognitive Complexity of 14 (exceeds 7 allowed). Consider refactoring. Open
public function queryTableInformation($table) {
// Generate a key to reference this table's information on.
$key = $this->connection
->prefixTables('{' . $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 tripal_file_upload
has a Cognitive Complexity of 14 (exceeds 7 allowed). Consider refactoring. Open
function tripal_file_upload($type, $filename, $action = NULL, $chunk = 0) {
$user = \Drupal::currentUser();
$uid = $user->id();
$module = \Drupal::request()->get('module', '');
- 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 schema
has a Cognitive Complexity of 14 (exceeds 7 allowed). Consider refactoring. Open
public static function schema(FieldStorageDefinitionInterface $field_definition) {
$schema = [];
foreach (get_called_class()::tripalTypes($field_definition) as $type) {
if ($type instanceof IntStoragePropertyType) {
$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 createTableSql
has a Cognitive Complexity of 14 (exceeds 7 allowed). Consider refactoring. Open
function createTableSql($name, $table) {
$sql_fields = [];
foreach ($table['fields'] as $field_name => $field) {
$sql_fields[] = $this
->createFieldSql($field_name, $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 getTableSchema
has a Cognitive Complexity of 13 (exceeds 7 allowed). Consider refactoring. Open
public function getTableSchema($table) {
$schema = $this->getSchemaDetails();
$table_arr = 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 getTables
has a Cognitive Complexity of 13 (exceeds 7 allowed). Consider refactoring. Open
public function getTables(
array $include = []
) :array {
static $type_to_name = [
'r' => '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 insertFeatureSeqs
has a Cognitive Complexity of 13 (exceeds 7 allowed). Consider refactoring. Open
private function insertFeatureSeqs() {
$num_residues = count(array_keys($this->residue_index));
$this->setItemsHandled(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"