Showing 124 of 124 total issues
Function chado_schema_get_foreign_key
has a Cognitive Complexity of 30 (exceeds 25 allowed). Consider refactoring. Open
function chado_schema_get_foreign_key($table_desc, $field, $values, $options = NULL, $chado_schema_name = NULL) {
$messenger = \Drupal::messenger();
// Set defaults for options. If we don't set defaults then
- 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 remoteSearchPMID
has a Cognitive Complexity of 30 (exceeds 25 allowed). Consider refactoring. Open
public function remoteSearchPMID($search_array, $num_to_retrieve, $page) {
// convert the terms list provided by the caller into a string with words
// separated by a '+' symbol.
$num_criteria = $search_array['num_criteria'];
$days = 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 tripal_report_error
has a Cognitive Complexity of 29 (exceeds 25 allowed). Consider refactoring. Open
function tripal_report_error($type, $severity, $message, $variables = [], $options = []) {
$logger = \Drupal::service('tripal.logger');
$logger->warning("DEPRECATED: the '@function' function will be removed from the API in " .
"a future release. Please use the TripalLogger service for logging.",
- 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 findRecords
has a Cognitive Complexity of 29 (exceeds 25 allowed). Consider refactoring. Open
public function findRecords(string $base_table, string $table_alias) {
$found_records = [];
// Make sure all IDs are up to date.
- 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 29 (exceeds 25 allowed). Consider refactoring. Open
public function buildForm(array $form, FormStateInterface $form_state, $pub_import_id = null) {
if ($pub_import_id != null) {
// used to keep track of whether this is a new query or edit query
$this->pub_import_id = $pub_import_id;
$public = \Drupal::database();
- 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 create
has a Cognitive Complexity of 29 (exceeds 25 allowed). Consider refactoring. Open
public function create($details) {
// Set some defaults
if (!array_key_exists('prority', $details)) {
$details['priority'] = 10;
- 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 getBaseTables
has a Cognitive Complexity of 28 (exceeds 25 allowed). Consider refactoring. Open
function getBaseTables() {
// Initialize the base tables with those tables that are missing a type.
// Ideally they should have a type, but that's for a future version of Chado.
$base_tables = [
- 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 28 (exceeds 25 allowed). Consider refactoring. Open
public function parse($pub_xml) {
$pub = [];
if (!$pub_xml) {
return $pub;
- 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 getMainTables
has a Cognitive Complexity of 28 (exceeds 25 allowed). Consider refactoring. Open
public function getMainTables() {
// Initialize the base tables with those tables that are missing a type.
// Ideally they should have a type, but that's for a future version of Chado.
$base_tables = [
- 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 pmidParseArticle
has a Cognitive Complexity of 27 (exceeds 25 allowed). Consider refactoring. Open
private function pmidParseArticle($xml, &$pub) {
while ($xml->read()) {
// get this element name
$element = $xml->name;
- 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 parsePath
has a Cognitive Complexity of 27 (exceeds 25 allowed). Consider refactoring. Open
protected function parsePath(string $field_name, string $base_table, mixed $path, array $aliases = [], string $as = '', string $full_path = '') {
// If the path is a string then split it.
$path_arr = [];
if (is_string($path)) {
- 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 install
has a Cognitive Complexity of 27 (exceeds 25 allowed). Consider refactoring. Open
public function install(array $collection_ids) {
$yaml_prefix = 'tripal.tripalentitytype_collection.';
/** @var \Drupal\Core\Config\ConfigFactory $config_factory **/
$config_factory = \Drupal::service('config.factory');
- 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 FALSE;
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 0;
Avoid too many return
statements within this method. Open
return FALSE;
Avoid too many return
statements within this method. Open
return FALSE;
Avoid too many return
statements within this method. Open
return TRUE;
Avoid too many return
statements within this method. Open
return $results;
Avoid too many return
statements within this method. Open
return $result;