Function parse
has a Cognitive Complexity of 41 (exceeds 7 allowed). Consider refactoring. Open
private function parse($obo_file, &$header) {
// Set to 1 if we are in the top header lines of the file.
$in_header = TRUE;
// Holds the full stanza for the term.
$stanza = [];
- Read upRead up
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 findEBITerm
has a Cognitive Complexity of 40 (exceeds 7 allowed). Consider refactoring. Open
private function findEBITerm($id) {
// Warn the user if we're looking up terms in EBI as this will slow the
// loader if there are many lookups.
if ($this->ebi_warned == FALSE) {
- Read upRead up
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 processTerm
has a Cognitive Complexity of 39 (exceeds 7 allowed). Consider refactoring. Open
private function processTerm($stanza, $is_relationship = 0) {
$chado = $this->getChadoConnection();
//
- Read upRead up
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 cacheTermStanza
has a Cognitive Complexity of 38 (exceeds 7 allowed). Consider refactoring. Open
private function cacheTermStanza($stanza, $type) {
// Make sure we have defaults.
if (!$this->default_namespace) {
throw new \Exception('Cannot cache terms without a default CV.' . print_r($stanza, TRUE));
- Read upRead up
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 formValidate
has a Cognitive Complexity of 24 (exceeds 7 allowed). Consider refactoring. Open
public function formValidate($form, &$form_state) {
$public = \Drupal::database();
$obo_id = $form_state->getValue('obo_id');
$obo_name = trim($form_state->getValue('obo_name'));
- Read upRead up
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 23 (exceeds 7 allowed). Consider refactoring. Open
private function saveTerm($stanza, $is_relationship = FALSE) {
$chado = $this->getChadoConnection();
// Get the term ID.
$id = $stanza['id'][0];
- Read upRead up
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 setDefaults
has a Cognitive Complexity of 23 (exceeds 7 allowed). Consider refactoring. Open
private function setDefaults($header) {
$short_name = '';
$namespace = '';
$idspaces = [];
- Read upRead up
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 oboEbiLookup
has a Cognitive Complexity of 21 (exceeds 7 allowed). Consider refactoring. Open
private function oboEbiLookup($accession, $type_of_search, $found_iri = NULL, $found_ontology = NULL) {
// Grab just the ontology from the $accession.
$parts = explode(':', $accession);
$ontology = strtolower($parts[0]);
$ontology = preg_replace('/\s+/', '', $ontology);
- Read upRead up
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 cacheRelationships
has a Cognitive Complexity of 15 (exceeds 7 allowed). Consider refactoring. Open
private function cacheRelationships() {
// Now that we have all of the terms parsed and loaded into the cache,
// lets run through them one more time cache any terms in relationships
// as well.
- Read upRead up
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 formSubmit
has a Cognitive Complexity of 12 (exceeds 7 allowed). Consider refactoring. Open
public function formSubmit($form, &$form_state) {
$public = \Drupal::database();
$obo_id = $form_state->getValue('obo_id');
$obo_name = trim($form_state->getValue('obo_name'));
- Read upRead up
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];
- Read upRead up
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)) {
- Read upRead up
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"