Showing 1,726 of 2,403 total issues
Method chart
has 162 lines of code (exceeds 25 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);
ClippingsCartModule
has 46 functions (exceeds 20 allowed). Consider refactoring. Open
class ClippingsCartModule extends AbstractModule implements ModuleMenuInterface
{
use ModuleMenuTrait;
// What to add to the cart?
AbstractCalendarDate
has 46 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class AbstractCalendarDate
{
// GEDCOM calendar escape
public const ESCAPE = '@#DUNKNOWN@';
Function relativesStartHandler
has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring. Open
protected function relativesStartHandler(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
Function importRecord
has a Cognitive Complexity of 40 (exceeds 5 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)
- 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 getGedcomValue
has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring. Open
private function getGedcomValue(string $tag, int $level, string $gedrec): string
{
if ($gedrec === '') {
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 getDescendantsHtml
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
private function getDescendantsHtml(Tree $tree, array $individuals, array $ancestors, string $surname, bool $soundex_dm, bool $soundex_std, Individual $individual, Family|null $parents = null): string
{
$module = $this->module_service
->findByComponent(ModuleChartInterface::class, $tree, Auth::user())
->first(static fn (ModuleInterface $module) => $module instanceof RelationshipsChartModule);
- 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 reformatRecord
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
private function reformatRecord(string $rec, Tree $tree): string
{
$gedcom_service = Registry::container()->get(GedcomService::class);
// Strip out mac/msdos line endings
- 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 39 (exceeds 5 allowed). Consider refactoring. Open
public function render($renderer): void
{
if (str_contains($this->text, '{{:ptp:}}')) {
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 gedcomValueStartHandler
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
protected function gedcomValueStartHandler(array $attrs): void
{
$id = '';
$match = [];
if (preg_match('/0 @(.+)@/', $this->gedrec, $match)) {
- 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 drawPerson
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
private function drawPerson(Individual $person, int $gen, int $state, Family|null $pfamily, string $line, bool $isRoot): string
{
if ($gen < 0) {
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 addDescendancy
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
private function addDescendancy(&$list, $pid, $parents = false, $generations = -1): void
{
$person = Registry::individualFactory()->make($pid, $this->tree);
if ($person === null) {
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 relationships
has 140 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function relationships(): array
{
// Construct the genitive form in French
$genitive = static fn (string $s, string $genitive_link): array => [$s, '%s ' . $genitive_link . $s];
Method handle
has 140 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handle(ServerRequestInterface $request): ResponseInterface
{
$data_filesystem = Registry::filesystem()->data();
$files = Validator::queryParams($request)->isInArray(['local', 'external', 'unused'])->string('files');
Function chart
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
public function chart(Individual $individual1, Individual $individual2, int $recursion, int $ancestors): ResponseInterface
{
$tree = $individual1->tree();
$max_recursion = (int) $tree->getPreference('RELATIONSHIP_RECURSION', static::DEFAULT_RECURSION);
- 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 export
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
public function export(
Tree $tree,
bool $sort_by_xref = false,
string $encoding = UTF8::NAME,
int $access_level = Auth::PRIV_HIDE,
- 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 ageOfMarriageQuery
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
private function ageOfMarriageQuery(string $type, string $age_dir, int $total): string
{
$hrows = DB::table('families')
->where('f_file', '=', $this->tree->id())
->join('dates AS married', static function (JoinClause $join): void {
- 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 textBoxStartHandler
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
protected function textBoxStartHandler(array $attrs): void
{
// string Background color code
$bgcolor = '';
if (!empty($attrs['bgcolor'])) {
- 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 parentFacts
has 139 lines of code (exceeds 25 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 = [
Method ageOfMarriageQuery
has 136 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function ageOfMarriageQuery(string $type, string $age_dir, int $total): string
{
$hrows = DB::table('families')
->where('f_file', '=', $this->tree->id())
->join('dates AS married', static function (JoinClause $join): void {