Showing 1,726 of 2,403 total issues
Avoid too many return
statements within this method. Open
return $individual_privacy[$this->xref()] >= $access_level;
Avoid too many return
statements within this method. Open
return ltrim($subrec);
Avoid too many return
statements within this method. Open
return '';
Function process
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
{
$route = Validator::attributes($request)->route();
$tree = Validator::attributes($request)->treeOptional();
$user = Validator::attributes($request)->user();
- 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 6 (exceeds 5 allowed). Consider refactoring. Open
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
{
if ($this->upgrade_service->isUpgradeAvailable()) {
$latest_version = $this->upgrade_service->latestVersion();
$latest_version_email = Site::getPreference('LATEST_WT_VERSION_EMAIL');
- 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 getPedigreeMapFacts
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function getPedigreeMapFacts(ServerRequestInterface $request, ChartService $chart_service): array
{
$tree = Validator::attributes($request)->tree();
$generations = Validator::attributes($request)->isBetween(self::MINIMUM_GENERATIONS, self::MAXIMUM_GENERATIONS)->integer('generations');
$xref = Validator::attributes($request)->isXref()->string('xref');
- 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 allAncestors
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function allAncestors(string $xref1, string $xref2, int $tree_id): array
{
$ancestors = [
$xref1,
$xref2,
- 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 drawPersonName
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function drawPersonName(Individual $individual, string $dashed): string
{
$family = $individual->childFamilies()->first();
if ($family) {
$family_name = strip_tags($family->fullName());
- 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 updateGedcom
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function updateGedcom(Fact $fact, array $params): string
{
$gedcom = $fact->gedcom();
if (preg_match('/\n\d CEME ?(.+)(?:\n\d PLOT ?(.+))?/', $gedcom, $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 updateMediaLinks
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function updateMediaLinks(Individual $individual, string $xref, bool $primary): void
{
$facts = $individual->facts([], false, null, true);
$facts1 = new Collection();
- 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 getMedia
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function getMedia(Individual $individual): Collection
{
$media = new Collection();
foreach ($this->getFactsWithMedia($individual) as $fact) {
- 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 getMenu
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getMenu(Tree $tree): Menu|null
{
$trees = $this->tree_service->all();
if ($trees->count() === 1 || Site::getPreference('ALLOW_CHANGE_GEDCOM') !== '1') {
- 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 findElementByWildcard
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function findElementByWildcard(string $tag): ElementInterface|null
{
foreach ($this->elements as $tags => $element) {
if (str_contains($tags, '*')) {
$regex = '/^' . strtr($tags, ['*' => '[^:]+']) . '$/';
- 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 readDegrees
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function readDegrees(string $text, string $positive, string $negative): float|null
{
$text = trim($text);
$hemisphere = substr($text, 0, 1);
$degrees = substr($text, 1);
- 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 spouseFacts
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function spouseFacts(Individual $individual, Individual $spouse, Date $min_date, Date $max_date): Collection
{
$SHOW_RELATIVES_EVENTS = $individual->tree()->getPreference('SHOW_RELATIVES_EVENTS');
$death_of_a_spouse = [
- 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 mediaFileInfo
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function mediaFileInfo(FilesystemOperator $data_filesystem, string $file): string
{
$html = '<dl>';
$html .= '<dt>' . I18N::translate('Filename') . '</dt>';
$html .= '<dd>' . e($file) . '</dd>';
- 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 descendantFamilies
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function descendantFamilies(Individual $individual, int $generations): Collection
{
$descendants = new Collection($individual->spouseFamilies());
if ($generations > 0) {
- 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 6 (exceeds 5 allowed). Consider refactoring. Open
public function handle(ServerRequestInterface $request): ResponseInterface
{
$this->checkRegistrationAllowed();
$tree = Validator::attributes($request)->treeOptional();
- 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 6 (exceeds 5 allowed). Consider refactoring. Open
public function handle(ServerRequestInterface $request): ResponseInterface
{
$recipients = $this->message_service->recipientTypes();
$user = Validator::attributes($request)->user();
- 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 6 (exceeds 5 allowed). Consider refactoring. Open
public function handle(ServerRequestInterface $request): ResponseInterface
{
$parent_id = $request->getAttribute('parent_id');
if ($parent_id === null) {
- 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"