Showing 174 of 174 total issues

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

        Function insertSynonyms has a Cognitive Complexity of 8 (exceeds 7 allowed). Consider refactoring.
        Open

          private function insertSynonyms() {
            $chado = $this->getChadoConnection();
            $batch_size = 1000;
            $num_synonyms = count(array_keys($this->synonym_lookup));
            $num_batches = (int) ($num_synonyms / $batch_size) + 1;
        Severity: Minor
        Found in tripal_chado/src/Plugin/TripalImporter/GFF3Importer.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

        Function onFieldableEntityTypeCreate has a Cognitive Complexity of 8 (exceeds 7 allowed). Consider refactoring.
        Open

          public function onFieldableEntityTypeCreate(EntityTypeInterface $entity_type, array $field_storage_definitions) {
            parent::onFieldableEntityTypeCreate($entity_type,$field_storage_definitions);
        
            // This is where we create the types each field describes in the
            // associated TripalStorage instance.
        Severity: Minor
        Found in tripal/src/Entity/TripalEntityStorageSchema.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

        Function isInvalidSchemaName has a Cognitive Complexity of 8 (exceeds 7 allowed). Consider refactoring.
        Open

          public function isInvalidSchemaName(
            string $schema_name,
            bool $ignore_reservation = FALSE,
            bool $reload_config = FALSE
          ) :string {
        Severity: Minor
        Found in tripal/src/TripalDBX/TripalDbx.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

        Function onEntityTypeDelete has a Cognitive Complexity of 8 (exceeds 7 allowed). Consider refactoring.
        Open

          public function onEntityTypeDelete(EntityTypeInterface $entity_type) {
        
            // build remove storage operations
            $storageOps = [];
            foreach ($this->fieldStorageDefinitions() as $storageDefinition) {
        Severity: Minor
        Found in tripal/src/Entity/TripalEntityStorageSchema.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

        Function addBundleField has a Cognitive Complexity of 8 (exceeds 7 allowed). Consider refactoring.
        Open

          public function addBundleField(string $bundle, array $field_def) : bool {
            $logger = \Drupal::service('tripal.logger');
        
            if (!$this->validateFieldDef($field_def)) {
              return False;
        Severity: Minor
        Found in tripal/src/Services/TripalFieldsManager.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

        Function setSchemaName has a Cognitive Complexity of 8 (exceeds 7 allowed). Consider refactoring.
        Open

          public function setSchemaName(string $schema_name) :void {
            // Does schema change?
            if (!empty($this->schemaName) && ($schema_name == $this->schemaName)) {
              return;
            }
        Severity: Minor
        Found in tripal/src/TripalDBX/TripalDbxConnection.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