Showing 1,725 of 2,400 total issues
File IndividualFactsService.php
has 670 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* webtrees: online genealogy
* Copyright (C) 2023 webtrees development team
FamilyRepository
has 80 functions (exceeds 20 allowed). Consider refactoring. Open
class FamilyRepository
{
private CenturyService $century_service;
private ColorService $color_service;
Method upgrade
has 298 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function upgrade(): void
{
DB::schema()->create('gedcom', static function (Blueprint $table): void {
$table->integer('gedcom_id', true);
$table->string('gedcom_name', 255);
File Soundex.php
has 662 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* webtrees: online genealogy
* Copyright (C) 2023 webtrees development team
Method handle
has 292 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handle(ServerRequestInterface $request): ResponseInterface
{
$tree = Validator::attributes($request)->tree();
$user = Validator::attributes($request)->user();
File GedcomImportService.php
has 643 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* webtrees: online genealogy
* Copyright (C) 2023 webtrees development team
File Individual.php
has 640 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* webtrees: online genealogy
* Copyright (C) 2023 webtrees development team
File GedcomRecord.php
has 637 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* webtrees: online genealogy
* Copyright (C) 2023 webtrees development team
Method values
has 278 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function values(): array
{
$values = [
'' => '',
1 => 'Amt',
Function getCloseRelationship
has a Cognitive Complexity of 70 (exceeds 5 allowed). Consider refactoring. Open
private function getCloseRelationship(Individual $individual1, Individual $individual2, int $maxlength = 4): array
{
if ($individual1 === $individual2) {
return [$individual1];
}
- 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 daitchMokotoffWord
has a Cognitive Complexity of 68 (exceeds 5 allowed). Consider refactoring. Open
private static function daitchMokotoffWord(string $name): array
{
// Apply special transformation rules to the input string
$name = I18N::strtoupper($name);
foreach (self::TRANSFORM_NAMES as $transformRule) {
- 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 getAllCountries
has 255 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getAllCountries(): array
{
return [
/* I18N: Name of a country or state */
'???' => I18N::translate('Unknown'),
Function display
has a Cognitive Complexity of 64 (exceeds 5 allowed). Consider refactoring. Open
public function display(Tree|null $tree = null, string|null $date_format = null, bool $convert_calendars = false): string
{
if ($tree instanceof Tree) {
$CALENDAR_FORMAT = $tree->getPreference('CALENDAR_FORMAT');
} else {
- 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 ANSEL.php
has 579 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* webtrees: online genealogy
* Copyright (C) 2023 webtrees development team
Method iso3166
has 246 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function iso3166(): array
{
return [
'GBR' => 'GB', // Must come before ENG, NIR, SCT and WLS
'ABW' => 'AW',
Function isDead
has a Cognitive Complexity of 62 (exceeds 5 allowed). Consider refactoring. Open
public function isDead(): bool
{
$MAX_ALIVE_AGE = (int) $this->tree->getPreference('MAX_ALIVE_AGE');
$today_jd = Registry::timestampFactory()->now()->julianDay();
- 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 handle
has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring. Open
public function handle(ServerRequestInterface $request): ResponseInterface
{
$tree = Validator::attributes($request)->tree();
$xref = Validator::parsedBody($request)->isXref()->string('xref');
$family = Registry::familyFactory()->make($xref, $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 render
has 225 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function render($renderer): void
{
$newelements = [];
$lastelement = '';
$footnote_element = [];
Function isRelated
has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring. Open
private static function isRelated(Individual $target, int $distance): bool
{
static $cache = null;
$user_individual = Registry::individualFactory()->make($target->tree->getUserPreference(Auth::user(), UserInterface::PREF_TREE_ACCOUNT_XREF), $target->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
File AbstractIndividualListModule.php
has 533 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* webtrees: online genealogy
* Copyright (C) 2023 webtrees development team