Showing 1,726 of 2,403 total issues
Function getAnniversaryEvents
has a Cognitive Complexity of 56 (exceeds 5 allowed). Consider refactoring. Open
public function getAnniversaryEvents(int $jd, string $facts, Tree $tree, string $filterof = '', string $filtersx = ''): array
{
$found_facts = [];
$anniversaries = [
- 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 process
has a Cognitive Complexity of 55 (exceeds 5 allowed). Consider refactoring. Open
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
{
$ua = Validator::serverParams($request)->string('HTTP_USER_AGENT', '');
$ip = Validator::attributes($request)->string('client-ip');
$address = IPFactory::parseAddressString($ip);
- 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 CountryService.php
has 520 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* webtrees: online genealogy
* Copyright (C) 2023 webtrees development team
Method handle
has 207 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handle(ServerRequestInterface $request): ResponseInterface
{
$this->layout = 'layouts/administration';
$tree = Validator::attributes($request)->tree();
File RelationshipsChartModule.php
has 496 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* webtrees: online genealogy
* Copyright (C) 2023 webtrees development team
Method tags
has 197 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function tags(): array
{
return [
'FAM:*:ADDR:_NAME' => new CustomElement(I18N::translate('Name of addressee')),
// I18N: https://gov.genealogy.net
ReportParserGenerate
has 54 functions (exceeds 20 allowed). Consider refactoring. Open
class ReportParserGenerate extends ReportParserBase
{
/** Are we collecting data from <Footnote> elements */
private bool $process_footnote = true;
File Fact.php
has 479 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* webtrees: online genealogy
* Copyright (C) 2023 webtrees development team
File RenumberTreeAction.php
has 474 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* webtrees: online genealogy
* Copyright (C) 2023 webtrees development team
File AbstractCalendarDate.php
has 474 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* webtrees: online genealogy
* Copyright (C) 2023 webtrees development team
Function repeatTagStartHandler
has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring. Open
protected function repeatTagStartHandler(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
Method handle
has 180 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handle(ServerRequestInterface $request): ResponseInterface
{
$tree1_name = Validator::parsedBody($request)->string('tree1_name');
$tree2_name = Validator::parsedBody($request)->string('tree2_name');
Method render
has 180 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function render($renderer): void
{
// checkFootnote
$newelements = [];
$lastelement = [];
Function getWidth
has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring. Open
public function getWidth($renderer): array
{
// Setup the style name, a font must be selected to calculate the width
$renderer->setCurrentStyle('footnotenum');
- 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 getWidth
has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring. Open
public function getWidth($renderer): array
{
// Setup the style name
$renderer->setCurrentStyle('footnotenum');
- 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 getWidth
has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring. Open
public function getWidth($renderer): array
{
// Setup the style name, a font must be selected to calculate the width
if ($renderer->getCurrentStyle() !== $this->styleName) {
$renderer->setCurrentStyle($this->styleName);
- 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 getWidth
has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring. Open
public function getWidth($renderer): array
{
// Setup the style name, a font must be selected to calculate the width
if ($renderer->getCurrentStyle() !== $this->styleName) {
$renderer->setCurrentStyle($this->styleName);
- 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 chart
has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring. Open
protected function chart(Individual $individual, int $style, int $width, int $generations): ResponseInterface
{
$ancestors = $this->chart_service->sosaStradonitzAncestors($individual, $generations);
$width = intdiv(self::CHART_WIDTH_PIXELS * $width, 100);
- 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 importRecord
has 164 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function importRecord(string $gedrec, Tree $tree, bool $update): void
{
$tree_id = $tree->id();
// Escaped @ signs (only if importing from file)
GedcomRecord
has 47 functions (exceeds 20 allowed). Consider refactoring. Open
class GedcomRecord
{
public const RECORD_TYPE = 'UNKNOWN';
protected const ROUTE_NAME = GedcomRecordPage::class;