Showing 1,725 of 2,400 total issues
Method handle
has 437 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handle(ServerRequestInterface $request): ResponseInterface
{
$tree = Validator::attributes($request)->tree();
$xrefs = $this->admin_service->duplicateXrefs($tree);
File RightToLeftSupport.php
has 884 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* webtrees: online genealogy
* Copyright (C) 2023 webtrees development team
Method finishCurrentSpan
has 424 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static function finishCurrentSpan(string &$result, bool $theEnd = false): void
{
$textSpan = substr($result, self::$posSpanStart);
$result = substr($result, 0, self::$posSpanStart);
File SearchService.php
has 867 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* webtrees: online genealogy
* Copyright (C) 2023 webtrees development team
Function render
has a Cognitive Complexity of 102 (exceeds 5 allowed). Consider refactoring. Open
public function render($renderer): void
{
// checkFootnote
$newelements = [];
$lastelement = [];
- 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 UTF8.php
has 817 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* webtrees: online genealogy
* Copyright (C) 2023 webtrees development team
Method childFacts
has 387 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function childFacts(Individual $person, Family $family, string $option, string $relation, Date $min_date, Date $max_date): Collection
{
$SHOW_RELATIVES_EVENTS = $person->tree()->getPreference('SHOW_RELATIVES_EVENTS');
$birth_of_a_child = [
Method searchIndividualsAdvanced
has 385 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function searchIndividualsAdvanced(Tree $tree, array $fields, array $modifiers): Collection
{
$fields = array_filter($fields, static fn (string $x): bool => $x !== '');
$query = DB::table('individuals')
File StatisticsChartModule.php
has 781 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* webtrees: online genealogy
* Copyright (C) 2023 webtrees development team
Method load
has 363 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function load(Map $router): void
{
$router->attach('', '', static function (Map $router) {
// Admin routes.
$router->attach('', '/admin', static function (Map $router) {
File ClippingsCartModule.php
has 758 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* webtrees: online genealogy
* Copyright (C) 2023 webtrees development team
Function childFacts
has a Cognitive Complexity of 86 (exceeds 5 allowed). Consider refactoring. Open
private function childFacts(Individual $person, Family $family, string $option, string $relation, Date $min_date, Date $max_date): Collection
{
$SHOW_RELATIVES_EVENTS = $person->tree()->getPreference('SHOW_RELATIVES_EVENTS');
$birth_of_a_child = [
- 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 webtrees.js
has 737 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* webtrees: online genealogy
* Copyright (C) 2023 webtrees development team
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Method listStartHandler
has 339 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function listStartHandler(array $attrs): void
{
$this->process_repeats++;
if ($this->process_repeats > 1) {
return;
Function handle
has a Cognitive Complexity of 84 (exceeds 5 allowed). Consider refactoring. Open
public function handle(ServerRequestInterface $request): ResponseInterface
{
$this->layout = 'layouts/administration';
$tree = Validator::attributes($request)->tree();
- 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 spanLtrRtl
has 319 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function spanLtrRtl(string $inputText): string
{
if ($inputText === '') {
// Nothing to do
return '';
File ModuleService.php
has 689 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* webtrees: online genealogy
* Copyright (C) 2023 webtrees development team
File WebRoutes.php
has 680 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* webtrees: online genealogy
* Copyright (C) 2023 webtrees development team
Function parentFacts
has a Cognitive Complexity of 77 (exceeds 5 allowed). Consider refactoring. Open
private function parentFacts(Individual $person, int $sosa, Date $min_date, Date $max_date): Collection
{
$SHOW_RELATIVES_EVENTS = $person->tree()->getPreference('SHOW_RELATIVES_EVENTS');
$death_of_a_parent = [
- 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 getEstimatedBirthDate
has a Cognitive Complexity of 76 (exceeds 5 allowed). Consider refactoring. Open
public function getEstimatedBirthDate(): Date
{
if ($this->estimated_birth_date === null) {
foreach ($this->getAllBirthDates() as $date) {
if ($date->isOK()) {
- 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"