Showing 160 of 174 total issues

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

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.
Severity: Minor
Found in tripal_chado/src/api/ChadoSchema.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 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'];
Severity: Minor
Found in tripal_chado/src/Form/ChadoMviewForm.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 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();
Severity: Minor
Found in tripal/src/TripalField/TripalFieldItemBase.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 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.
Severity: Minor
Found in tripal_chado/src/Plugin/TripalImporter/GFF3Importer.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 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 {
Severity: Minor
Found in tripal/src/TripalDBX/TripalDbxConnection.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 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) {
Severity: Minor
Found in tripal_chado/src/Plugin/TripalImporter/GFF3Importer.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 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();

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;
    }
Severity: Minor
Found in tripal/src/Services/TripalLogger.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 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'];
Severity: Minor
Found in tripal_chado/src/Form/ChadoCustomTableForm.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 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']))
Severity: Minor
Found in tripal_chado/src/Task/ChadoCloner.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

Avoid too many return statements within this method.
Open

      return tripal_file_upload_merge($filename, $type, $user_dir);
Severity: Major
Found in tripal/src/api/tripal.upload.api.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

          return tripal_file_upload_verify($filename, $chunk, $user_dir);
    Severity: Major
    Found in tripal/src/api/tripal.upload.api.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

            return FALSE;
      Severity: Major
      Found in tripal_chado/src/api/ChadoSchema.php - About 30 mins to fix

        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 = [];
        Severity: Minor
        Found in tripal/src/Controller/TripalController.php - About 25 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