Showing 124 of 124 total issues
Function submitForm
has a Cognitive Complexity of 26 (exceeds 25 allowed). Consider refactoring. Open
public function submitForm(array &$form, FormStateInterface $form_state) {
$public = \Drupal::database();
$user_input = $form_state->getUserInput();
$form_mode = NULL;
if (isset($user_input['mode'])) {
- 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 installTerms
has a Cognitive Complexity of 26 (exceeds 25 allowed). Consider refactoring. Open
public function installTerms(string $id = 'chado_content_terms') {
$config_factory = \Drupal::service('config.factory');
$config_key = 'tripal.tripal_content_terms.' . $id;
$config = $config_factory->get($config_key);
- 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 findMissingProteins
has a Cognitive Complexity of 26 (exceeds 25 allowed). Consider refactoring. Open
private function findMissingProteins() {
$this->setItemsHandled(0);
$this->setTotalItems(count(array_keys($this->features)));
// Don't do anything if the user wants to skip creation of non listed
- 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 findSynonyms
has a Cognitive Complexity of 26 (exceeds 25 allowed). Consider refactoring. Open
private function findSynonyms() {
$chado = $this->getChadoConnection();
$batch_size = 1000;
$num_features = count(array_keys($this->features));
$num_batches = (int) ($num_features / $batch_size) + 1;
- 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"