tripal_chado/src/Plugin/TripalIdSpace/ChadoIdSpace.php

Summary

Maintainability
B
6 hrs
Test Coverage
B
88%

Function saveTermAttributes has a Cognitive Complexity of 24 (exceeds 7 allowed). Consider refactoring.
Open

  protected function saveTermAttributes(TripalTerm $term, object $cvterm, array $options) : bool {

    $update_parent = False;
    if (array_key_exists('updateParent', $options)) {
      $update_parent = $options['updateParent'];
Severity: Minor
Found in tripal_chado/src/Plugin/TripalIdSpace/ChadoIdSpace.php - About 3 hrs 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 getTerm has a Cognitive Complexity of 19 (exceeds 7 allowed). Consider refactoring.
Open

  public function getTerm($accession, $options = []) {

    if (!$this->is_valid) {
      return NULL;
    }
Severity: Minor
Found in tripal_chado/src/Plugin/TripalIdSpace/ChadoIdSpace.php - About 2 hrs 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

There are no issues that match your filters.

Category
Status