tripal/tripal

View on GitHub

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
Severity: Minor
Found in tripal_chado/src/api/tripal_chado.query.api.php - About 1 hr 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 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;
Severity: Minor
Found in tripal/src/Plugin/TripalPubLibrary/TripalPubLibraryPubMed.php - About 1 hr 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_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.",
Severity: Minor
Found in tripal/src/api/tripal.deprecated.api.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 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.
Severity: Minor
Found in tripal_chado/src/TripalStorage/ChadoRecords.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 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();
Severity: Minor
Found in tripal_chado/src/Form/ChadoNewPubSearchQueryForm.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 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;
Severity: Minor
Found in tripal/src/Services/TripalJob.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 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 = [
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 parse has a Cognitive Complexity of 28 (exceeds 25 allowed). Consider refactoring.
Open

  public function parse($pub_xml) {
    $pub = [];
  
    if (!$pub_xml) {
      return $pub;
Severity: Minor
Found in tripal/src/Plugin/TripalPubLibrary/TripalPubLibraryPubMed.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 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 = [
Severity: Minor
Found in tripal_chado/src/Database/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 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;
Severity: Minor
Found in tripal/src/Plugin/TripalPubLibrary/TripalPubLibraryPubMed.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 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)) {
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 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');
Severity: Minor
Found in tripal/src/Services/TripalEntityTypeCollection.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 FALSE;
Severity: Major
Found in tripal/src/Services/TripalFieldCollection.php - About 30 mins to fix

    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 0;
      Severity: Major
      Found in tripal_chado/src/Plugin/TripalImporter/FASTAImporter.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/tripal_chado.phylotree.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/tripal_chado.query.api.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

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

              Avoid too many return statements within this method.
              Open

                return $results;
              Severity: Major
              Found in tripal_chado/src/api/tripal_chado.query.api.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                  return $result;
                Severity: Major
                Found in tripal_chado/src/api/tripal_chado.property.api.php - About 30 mins to fix
                  Severity
                  Category
                  Status
                  Source
                  Language