Showing 1,726 of 2,403 total issues
Method columns
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function columns(): array
{
return [
new CensusColumnFullName($this, 'Name', 'Name of each person in family, household or institution'),
new CensusColumnNull($this, 'Place of Abode', 'In rural localities give parish or township. In cities, towns and villages, give street and number of dwelling'),
Function getBlock
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function getBlock(Tree $tree, int $block_id, string $context, array $config = []): string
{
$show_other = $this->getBlockSetting($block_id, 'show_other', self::DEFAULT_SHOW_OTHER);
$show_unassigned = $this->getBlockSetting($block_id, 'show_unassigned', self::DEFAULT_SHOW_UNASSIGNED);
$show_future = $this->getBlockSetting($block_id, 'show_future', self::DEFAULT_SHOW_FUTURE);
- 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 wrapLongLines
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function wrapLongLines(string $gedcom, int $max_line_length): string
{
$lines = [];
foreach (explode("\n", $gedcom) as $line) {
- 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 13 (exceeds 5 allowed). Consider refactoring. Open
public function handle(ServerRequestInterface $request): ResponseInterface
{
$parent_id = Validator::parsedBody($request)->string('parent_id');
$place_id = Validator::parsedBody($request)->string('place_id');
$latitude = Validator::parsedBody($request)->string('new_place_lati');
- 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 compare
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public static function compare(Date $a, Date $b): int
{
// Get min/max JD for each date.
switch ($a->qual1) {
case 'BEF':
- 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 getEstimatedDeathDate
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function getEstimatedDeathDate(): Date
{
if ($this->estimated_death_date === null) {
foreach ($this->getAllDeathDates() as $date) {
if ($date->isOK()) {
- 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 marriageQuery
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
private function marriageQuery(string $type, string $age_dir, string $sex, bool $show_years): string
{
if ($sex === 'F') {
$sex_field = 'f_wife';
} 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 parentsQuery
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
private function parentsQuery(string $type, string $age_dir, string $sex, bool $show_years): string
{
if ($sex === 'F') {
$sex_field = 'WIFE';
} 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
Method searchPlaces
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function searchPlaces(Tree $tree, string $search, int $offset = 0, int $limit = PHP_INT_MAX): Collection
{
$query = DB::table('places AS p0')
->where('p0.p_file', '=', $tree->id())
->leftJoin('places AS p1', 'p1.p_id', '=', 'p0.p_parent_id')
Method handle
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handle(ServerRequestInterface $request): ResponseInterface
{
$this->layout = 'layouts/administration';
$tree = Validator::attributes($request)->tree();
Method countCommonXrefs
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function countCommonXrefs(Tree $tree1, Tree $tree2): int
{
$subquery1 = DB::table('individuals')
->where('i_file', '=', $tree1->id())
->select(['i_id AS xref'])
Method handle
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handle(ServerRequestInterface $request): ResponseInterface
{
$this->layout = 'layouts/administration';
// First and last change in the database
Method bootstrap
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function bootstrap(): self
{
// Show all errors and warnings in development, fewer in production.
error_reporting(self::ERROR_REPORTING);
Method render
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function render($renderer, bool $attrib = true): void
{
// Set up the style
if ($renderer->getCurrentStyle() !== $this->styleName) {
$renderer->setCurrentStyle($this->styleName);
Function initializeTomSelect
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
webtrees.initializeTomSelect = function (element) {
if (element.tomselect) {
return element.tomselect;
}
Method getAdminAction
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getAdminAction(ServerRequestInterface $request): ResponseInterface
{
$this->layout = 'layouts/administration';
// This module can't run without a tree
Method getMenu
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getMenu(Tree $tree): Menu|null
{
$request = Registry::container()->get(ServerRequestInterface::class);
$route = Validator::attributes($request)->route();
$cart = Session::get('cart');
Method tags
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function tags(): array
{
return [
'FAM:MARR_CIVIL' => new Marriage(I18N::translate('Civil marriage')),
'FAM:MARR_PARTNERS' => new Marriage(I18N::translate('Registered partnership')),
Method mediaFileThumbnailResponse
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function mediaFileThumbnailResponse(
MediaFile $media_file,
int $width,
int $height,
string $fit,
Method handle
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handle(ServerRequestInterface $request): ResponseInterface
{
$tree = Validator::attributes($request)->tree();
$note = Validator::parsedBody($request)->string('media-note');
$title = Validator::parsedBody($request)->string('title');