Showing 1,726 of 2,403 total issues
Avoid deeply nested control flow statements. Open
if ($first === 'sis' && $sex1 === 'M') {
return I18N::translateContext('(a man’s) sister’s great ×(%s-1) granddaughter', 'great ×%s niece', I18N::number($down - 1));
}
Avoid deeply nested control flow statements. Open
switch ($event->tag()) {
case 'FAM:ANUL':
case 'FAM:DIV':
return I18N::translate('ex-spouse');
case 'FAM:MARR':
Avoid deeply nested control flow statements. Open
if ($first === 'sis' && $sex1 === 'M') {
return I18N::translateContext('(a man’s) sister’s great ×(%s-1) granddaughter', 'great ×%s niece', I18N::number($down - 3));
}
Avoid deeply nested control flow statements. Open
if ($first === 'sis' && $sex1 === 'M') {
return I18N::translateContext('(a man’s) sister’s great ×(%s-1) granddaughter', 'great ×%s niece', I18N::number($down - 3));
}
Avoid deeply nested control flow statements. Open
if ($first === 'sis' && $sex1 === 'M') {
return I18N::translateContext('(a man’s) sister’s great ×(%s-1) grandson', 'great ×%s nephew', I18N::number($down - 1));
}
Avoid deeply nested control flow statements. Open
if ($first === 'bro' && $sex1 === 'M') {
return I18N::translateContext('(a man’s) brother’s great ×(%s-1) grandson', 'great ×%s nephew', I18N::number($down - 1));
}
Avoid deeply nested control flow statements. Open
if ($bef_last === 'fat') {
return I18N::translateContext('great ×(%s-1) grandfather’s brother', 'great ×%s uncle', I18N::number($up - 2));
}
Avoid deeply nested control flow statements. Open
if ($first === 'bro' && $sex1 === 'M') {
return I18N::translateContext('(a man’s) brother’s great ×(%s-1) granddaughter', 'great ×%s niece', I18N::number($down - 3));
}
Avoid deeply nested control flow statements. Open
if ($first === 'bro' && $sex1 === 'M') {
return I18N::translateContext('(a man’s) brother’s great ×(%s-1) grandson', 'great ×%s nephew', I18N::number($down - 0));
}
Avoid deeply nested control flow statements. Open
if ($first === 'sis' && $sex1 === 'M') {
return I18N::translateContext('(a man’s) sister’s great ×(%s-1) grandson', 'great ×%s nephew', I18N::number($down - 0));
}
Avoid deeply nested control flow statements. Open
switch ($event->tag()) {
case 'FAM:ANUL':
case 'FAM:DIV':
return I18N::translate('ex-wife');
case 'FAM:MARR':
Avoid deeply nested control flow statements. Open
if ($first === 'bro' && $sex1 === 'M') {
return I18N::translateContext('(a man’s) brother’s great ×(%s-1) grandson', 'great ×%s nephew', I18N::number($down - 3));
}
Avoid deeply nested control flow statements. Open
if ($first === 'sis' && $sex1 === 'M') {
return I18N::translateContext('(a man’s) sister’s great ×(%s-1) grandson', 'great ×%s nephew', I18N::number($down - 3));
}
Function importTNGPlac
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function importTNGPlac(string $gedcom): void
{
if (preg_match('/^0 _PLAC (.+)/', $gedcom, $match)) {
$place_name = $match[1];
} 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
Function handle
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function handle(ServerRequestInterface $request): ResponseInterface
{
$tree = Validator::attributes($request)->tree();
// For backwards compatibility with webtrees 1.x we store the two calendar formats in one variable
- 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 doValidateRegistration
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
ServerRequestInterface $request,
string $username,
string $email,
string $realname,
string $comments,
Method deliverMessage
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function deliverMessage(UserInterface $sender, UserInterface $recipient, string $subject, string $body, string $url, string $ip): bool
Method getEventsList
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function getEventsList(int $jd1, int $jd2, string $events, bool $only_living, string $sort_by, Tree $tree): Collection
Function handle
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function handle(ServerRequestInterface $request): ResponseInterface
{
$tree = Validator::attributes($request)->tree();
$ip = Validator::attributes($request)->string('client-ip');
$base_url = Validator::attributes($request)->string('base_url');
- 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 8 (exceeds 5 allowed). Consider refactoring. Open
public function handle(ServerRequestInterface $request): ResponseInterface
{
$tree = Validator::attributes($request)->tree();
$xref = Validator::attributes($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"