Showing 160 of 174 total issues
Function insertFeatureSynonyms
has a Cognitive Complexity of 11 (exceeds 7 allowed). Consider refactoring. Open
private function insertFeatureSynonyms(){
$chado = $this->getChadoConnection();
$batch_size = 1000;
$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 insertFeatureCVterms
has a Cognitive Complexity of 11 (exceeds 7 allowed). Consider refactoring. Open
private function insertFeatureCVterms() {
$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 create
has a Cognitive Complexity of 11 (exceeds 7 allowed). Consider refactoring. Open
public function create($run_args, $file_details = []) {
// global $user;
$user = User::load(\Drupal::currentUser()->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 buildForm
has a Cognitive Complexity of 11 (exceeds 7 allowed). Consider refactoring. Open
public function buildForm(array $form, FormStateInterface $form_state) {
$chado = new ChadoConnection();
$form['msg-top'] = [
- 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 insertFeatureDbxrefs
has a Cognitive Complexity of 11 (exceeds 7 allowed). Consider refactoring. Open
private function insertFeatureDbxrefs() {
$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 shouldUseTripalDbxSchema
has a Cognitive Complexity of 11 (exceeds 7 allowed). Consider refactoring. Open
public function shouldUseTripalDbxSchema() :bool {
$should = FALSE;
// Check the class/object who is using Tripal DBX:
// We do this using the backtrace functionality with the assumption that
- 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 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"