Showing 96 of 758 total issues
Function buildLineage
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
private function buildLineage(LineageNode $node): LineageNode
{
$indi_surname = '';
$indi_node = $node->individual();
- 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
File SosaStatisticsService.php
has 358 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* webtrees-lib: MyArtJaub library for webtrees
*
Method pedigreeCollapseByGenerationData
has 110 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function pedigreeCollapseByGenerationData(): array
{
if (!$this->isPdoSupported()) {
return [];
}
Function oneLinkedSource
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public function oneLinkedSource(Certificate $certificate): ?Source
{
$regex_query = preg_quote($certificate->gedcomPath(), '/');
$regex_pattern = '/[1-9] SOUR @(' . Gedcom::REGEX_XREF . ')@(?:\n[2-9]\s(?:(?!SOUR)\w+)\s.*)*\n[2-9] _ACT ' . $regex_query . '/i'; //phpcs:ignore Generic.Files.LineLength.TooLong
- 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 buildLineages
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function buildLineages(): ?Collection
{
$indis = $this->patrolineage_module->individuals(
$this->tree,
$this->surname,
- 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
Method handle
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handle(ServerRequestInterface $request): ResponseInterface
{
if ($this->module === null) {
throw new HttpNotFoundException(I18N::translate('The attached module could not be found.'));
}
Method buildLineage
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function buildLineage(LineageNode $node): LineageNode
{
$indi_surname = '';
$indi_node = $node->individual();
Function getLineageRootIndividual
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
private function getLineageRootIndividual(Individual $indi): ?Individual
{
$child_families = $indi->childFamilies();
if ($this->used_indis->get($indi->xref(), false) !== false) {
return null;
- 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
Method handle
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handle(ServerRequestInterface $request): ResponseInterface
{
$tree = Validator::attributes($request)->tree();
if ($this->module === null) {
Method handle
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handle(ServerRequestInterface $request): ResponseInterface
{
$tree = Validator::attributes($request)->tree();
if ($this->module === null) {
Method insertOrUpdate
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function insertOrUpdate(Tree $tree, UserInterface $user, array $sosa_records): void
{
$mass_update = DB::connection()->getDriverName() === 'mysql';
$bindings_placeholders = $bindings_values = [];
Function label
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function label(string $context): string
{
$context_label = Registry::elementFactory()->make($context)->label();
if ($this->factHasPreciseDate()) {
- 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 run
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function run(TaskSchedule $task_schedule, $force = false): void
{
/** @var TaskSchedule $task_schedule */
$task_schedule = DB::table('maj_admintasks')
->select()
- 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
Method featuresIndex
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function featuresIndex(): ?array
{
$cacheKey = $this->cacheKey();
if ($cacheKey === null) {
return null;
Method handle
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handle(ServerRequestInterface $request): ResponseInterface
{
$tree = Validator::attributes($request)->tree();
if ($this->module === null) {
Method getMenu
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getMenu(Tree $tree): ?Menu
{
$menu = new Menu(I18N::translate('Sosa Statistics'));
$menu->setClass('menu-maj-sosa');
$menu->setSubmenus([
Method run
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function run(TaskSchedule $task_schedule): bool
{
if ($this->module === null) {
return false;
}
Method loadRoutes
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function loadRoutes(Map $router): void
{
$router->attach('', '', static function (Map $router): void {
$router->attach('', '/module-maj/geodispersion', static function (Map $router): void {
Method handle
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handle(ServerRequestInterface $request): ResponseInterface
{
if ($this->module === null) {
throw new HttpNotFoundException(I18N::translate('The attached module could not be found.'));
}
Method handle
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handle(ServerRequestInterface $request): ResponseInterface
{
$tree = Validator::attributes($request)->tree();
if ($this->module === null) {