Showing 1,726 of 2,403 total issues
Method historicEventsAll
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function historicEventsAll(): Collection
{
switch (I18N::languageTag()) {
case 'nl':
return new Collection([
Method drawPerson
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function drawPerson(Individual $person, int $gen, int $state, Family|null $pfamily, string $line, bool $isRoot): string
{
if ($gen < 0) {
return '';
}
Method getEstimatedBirthDate
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getEstimatedBirthDate(): Date
{
if ($this->estimated_birth_date === null) {
foreach ($this->getAllBirthDates() as $date) {
if ($date->isOK()) {
Method factsEndHandler
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function factsEndHandler(): void
{
$this->process_repeats--;
if ($this->process_repeats > 0) {
return;
File Auth.php
has 294 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
/**
* webtrees: online genealogy
* Copyright (C) 2023 webtrees development team
Method relationships
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function relationships(): array
{
$pra = static fn (int $n, string $nominative, string $genitive): array => [
($n > 3 ? 'pra ×' . $n . ' ' : str_repeat('pra-', $n)) . $nominative,
($n > 3 ? 'pra ×' . $n . ' ' : str_repeat('pra-', $n)) . $genitive,
Method values
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function values(): array
{
$values = [
'' => '',
'AFRIKAANS' => (new LocaleAf())->endonym(),
File ModuleThemeTrait.php
has 293 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
/**
* webtrees: online genealogy
* Copyright (C) 2023 webtrees development team
Fact
has 26 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class Fact
{
private const FACT_ORDER = [
'BIRT',
'_HNM',
Method export
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function export(
Tree $tree,
bool $sort_by_xref = false,
string $encoding = UTF8::NAME,
int $access_level = Auth::PRIV_HIDE,
Method handle
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function handle(ServerRequestInterface $request): ResponseInterface
{
$tree = Validator::attributes($request)->tree();
$delete_default_resn_id = Validator::parsedBody($request)->array('delete');
File PlaceHierarchyListModule.php
has 289 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
/**
* webtrees: online genealogy
* Copyright (C) 2023 webtrees development team
File GovIdType.php
has 289 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
/**
* webtrees: online genealogy
* Copyright (C) 2023 webtrees development team
Method updateRecord
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function updateRecord(string $gedrec, Tree $tree, bool $delete): void
{
if (preg_match('/^0 @(' . Gedcom::REGEX_XREF . ')@ (' . Gedcom::REGEX_TAG . ')/', $gedrec, $match)) {
[, $gid, $type] = $match;
} elseif (preg_match('/^0 (HEAD)(?:\n|$)/', $gedrec, $match)) {
Method handle
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
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);
Function upgrade
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
Open
public function upgrade(): void
{
// It is simpler to create a new table than to update the existing one.
if (!DB::schema()->hasTable('place_location')) {
- 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 imageStartHandler
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
Open
protected function imageStartHandler(array $attrs): void
{
// Position the top corner of this box on the page. the default is the current position
$top = (float) ($attrs['top'] ?? ReportBaseElement::CURRENT_POSITION);
- 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 LifespansChartModule.php
has 287 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
/**
* webtrees: online genealogy
* Copyright (C) 2023 webtrees development team
File FrequentlyAskedQuestionsModule.php
has 287 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
/**
* webtrees: online genealogy
* Copyright (C) 2023 webtrees development team
Method listEndHandler
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function listEndHandler(): void
{
$this->process_repeats--;
if ($this->process_repeats > 0) {
return;