Showing 1,752 of 2,421 total issues
File phpstan-baseline.php
has 5379 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare(strict_types=1);
$ignoreErrors = [];
Function legacyNameAlgorithm
has a Cognitive Complexity of 486 (exceeds 5 allowed). Consider refactoring. Open
public function legacyNameAlgorithm(string $path, Individual $person1 = null, Individual $person2 = null): string
{
// The path does not include the starting person. In some languages, the
// translation for a man’s (relative) is different from a woman’s (relative),
// due to inflection.
- 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 legacyNameAlgorithm
has 1554 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function legacyNameAlgorithm(string $path, Individual $person1 = null, Individual $person2 = null): string
{
// The path does not include the starting person. In some languages, the
// translation for a man’s (relative) is different from a woman’s (relative),
// due to inflection.
Function finishCurrentSpan
has a Cognitive Complexity of 342 (exceeds 5 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);
- 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
Statistics
has 289 functions (exceeds 20 allowed). Consider refactoring. Open
class Statistics implements
GedcomRepositoryInterface,
IndividualRepositoryInterface,
EventRepositoryInterface,
MediaRepositoryInterface,
File ReportParserGenerate.php
has 2059 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* webtrees: online genealogy
* Copyright (C) 2023 webtrees development team
File RelationshipService.php
has 1909 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* webtrees: online genealogy
* Copyright (C) 2023 webtrees development team
Function spanLtrRtl
has a Cognitive Complexity of 223 (exceeds 5 allowed). Consider refactoring. Open
public static function spanLtrRtl(string $inputText): string
{
if ($inputText === '') {
// Nothing to do
return '';
- 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 listStartHandler
has a Cognitive Complexity of 221 (exceeds 5 allowed). Consider refactoring. Open
protected function listStartHandler(array $attrs): void
{
$this->process_repeats++;
if ($this->process_repeats > 1) {
return;
- 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 Statistics.php
has 1352 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* webtrees: online genealogy
* Copyright (C) 2023 webtrees development team
Function postCustomChartAction
has a Cognitive Complexity of 144 (exceeds 5 allowed). Consider refactoring. Open
public function postCustomChartAction(ServerRequestInterface $request): ResponseInterface
{
$statistics = Registry::container()->get(Statistics::class);
assert($statistics instanceof Statistics);
- 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 render
has a Cognitive Complexity of 131 (exceeds 5 allowed). Consider refactoring. Open
public function render($renderer): void
{
$newelements = [];
$lastelement = '';
$footnote_element = [];
- 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 Gedcom.php
has 1048 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* webtrees: online genealogy
* Copyright (C) 2023 webtrees development team
File FamilyRepository.php
has 1017 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* webtrees: online genealogy
* Copyright (C) 2023 webtrees development team
File IndividualRepository.php
has 1008 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* webtrees: online genealogy
* Copyright (C) 2023 webtrees development team
Function handle
has a Cognitive Complexity of 123 (exceeds 5 allowed). Consider refactoring. Open
public function handle(ServerRequestInterface $request): ResponseInterface
{
$tree = Validator::attributes($request)->tree();
$user = Validator::attributes($request)->user();
- 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 gedcom551Tags
has 489 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function gedcom551Tags(): array
{
return [
'FAM' => new FamilyRecord(I18N::translate('Family')),
'FAM:*:ADDR' => new AddressLine(I18N::translate('Address')),
Method postCustomChartAction
has 469 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function postCustomChartAction(ServerRequestInterface $request): ResponseInterface
{
$statistics = Registry::container()->get(Statistics::class);
assert($statistics instanceof Statistics);
IndividualRepository
has 116 functions (exceeds 20 allowed). Consider refactoring. Open
class IndividualRepository implements IndividualRepositoryInterface
{
private CenturyService $century_service;
private ColorService $color_service;
Function searchIndividualsAdvanced
has a Cognitive Complexity of 111 (exceeds 5 allowed). Consider refactoring. Open
public function searchIndividualsAdvanced(array $trees, array $fields, array $modifiers): Collection
{
$fields = array_filter($fields, static fn (string $x): bool => $x !== '');
$query = DB::table('individuals')
- 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"