Showing 174 of 174 total issues

Function processField has a Cognitive Complexity of 11 (exceeds 7 allowed). Consider refactoring.
Open

  function processField($field) {
    if (!isset($field['size'])) {
      $field['size'] = 'normal';
    }

Severity: Minor
Found in tripal_chado/src/api/ChadoSchema.php - About 55 mins to fix

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.
Severity: Minor
Found in tripal_chado/src/Task/ChadoUpgrader.php - About 55 mins to fix

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;
Severity: Minor
Found in tripal_chado/src/Task/ChadoInstaller.php - About 55 mins to fix

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') {
Severity: Minor
Found in tripal_chado/src/api/ChadoSchema.php - About 45 mins to fix

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.
Severity: Minor
Found in tripal/src/Entity/TripalEntityType.php - About 45 mins to fix

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];
Severity: Minor
Found in tripal_chado/src/Plugin/TripalImporter/OBOImporter.php - About 45 mins to fix

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();
Severity: Minor
Found in tripal_chado/src/Plugin/TripalStorage/ChadoStorage.php - About 45 mins to fix

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
Severity: Minor
Found in tripal_chado/src/Plugin/DataType/ChadoDataType.php - About 45 mins to fix

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)) {
Severity: Minor
Found in tripal_chado/src/Plugin/TripalImporter/OBOImporter.php - About 45 mins to fix

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.
Severity: Minor
Found in tripal/src/api/tripal.notice.api.php - About 45 mins to fix

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) {
Severity: Minor
Found in tripal_chado/src/Entity/ChadoTermMapping.php - About 45 mins to fix

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
Severity: Minor
Found in tripal_biodb/src/Lock/PersistentDatabaseSharedLockBackend.php - About 45 mins to fix

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;
Severity: Minor
Found in tripal_chado/src/Plugin/TripalImporter/GFF3Importer.php - About 45 mins to fix

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) {
Severity: Minor
Found in tripal_chado/src/ChadoCustomTables/ChadoCustomTable.php - About 45 mins to fix

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 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.',
Severity: Minor
Found in tripal_chado/src/Plugin/TripalIdSpace/ChadoIdSpace.php - About 45 mins to fix

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);

Severity: Minor
Found in tripal_chado/src/Plugin/TripalImporter/GFF3Importer.php - About 45 mins to fix

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.
Severity: Minor
Found in tripal_chado/src/Task/ChadoInstaller.php - About 45 mins to fix

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'] = [];
Severity: Minor
Found in tripal_chado/src/Task/ChadoUpgrader.php - About 45 mins to fix

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 [];
    }
Severity: Minor
Found in tripal/src/TripalDBX/TripalDbxSchema.php - About 35 mins to fix

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) {
Severity: Minor
Found in tripal_chado/src/Plugin/TripalStorage/ChadoStorage.php - About 35 mins to fix

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

Severity
Category
Status
Source
Language