Showing 1,726 of 2,403 total issues
Function calLocalize
has 20 arguments (exceeds 4 allowed). Consider refactoring. Open
webtrees.calLocalize = function (jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec, sun, mon, tue, wed, thu, fri, sat, day) {
Method siteMapIndex
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function siteMapIndex(ServerRequestInterface $request): ResponseInterface
{
$content = Registry::cache()->file()->remember('sitemap.xml', function (): string {
// Which trees have sitemaps enabled?
$tree_ids = $this->tree_service->all()
Method marriageQuery
has 62 lines of code (exceeds 25 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 {
Method parentsQuery
has 62 lines of code (exceeds 25 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 {
Function buildLeafletJsMap
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
webtrees.buildLeafletJsMap = function (id, config, resetCallback) {
const zoomControl = new L.control.zoom({
zoomInTitle: config.i18n.zoomIn,
zoomoutTitle: config.i18n.zoomOut,
});
Method mapData
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function mapData(Place $place): array
{
$children = $place->getChildPlaces();
$features = [];
$sidebar = '';
Function oldStyleRelationshipPath
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
private function oldStyleRelationshipPath(Tree $tree, array $path): array
{
$spouse_codes = [
'M' => 'hus',
'F' => 'wif',
- 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 getBlock
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public function getBlock(Tree $tree, int $block_id, string $context, array $config = []): string
{
$default_events = implode(',', self::DEFAULT_EVENTS);
$days = (int)$this->getBlockSetting($block_id, 'days', self::DEFAULT_DAYS);
- 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 createMediaObject
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
private function createMediaObject(string $gedcom, Tree $tree): string
{
preg_match('/\n\d FILE (.+)/', $gedcom, $match);
$file = $match[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 handle
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public function handle(ServerRequestInterface $request): ResponseInterface
{
$tree = Validator::attributes($request)->tree();
$xref = Validator::attributes($request)->isXref()->string('xref');
$record = Registry::gedcomRecordFactory()->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"
Further reading
Function handle
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public function handle(ServerRequestInterface $request): ResponseInterface
{
$tree = Validator::attributes($request)->tree();
$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 18 (exceeds 5 allowed). Consider refactoring. Open
public function handle(ServerRequestInterface $request): ResponseInterface
{
$tree = Validator::attributes($request)->tree();
$xref = Validator::attributes($request)->isXref()->string('xref');
$fact_id = Validator::attributes($request)->string('fact_id');
- 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 18 (exceeds 5 allowed). Consider refactoring. Open
public function handle(ServerRequestInterface $request): ResponseInterface
{
$tree = Validator::attributes($request)->tree();
$xrefs = $this->admin_service->duplicateXrefs($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"
Further reading
Function handle
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public function handle(ServerRequestInterface $request): ResponseInterface
{
$topic = $request->getAttribute('topic');
$dmy = I18N::language()->dateOrder();
- 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 addName
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
protected function addName(string $type, string $value, string $gedcom): void
{
////////////////////////////////////////////////////////////////////////////
// Extract the structured name parts - use for "sortable" names and indexes
////////////////////////////////////////////////////////////////////////////
- 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 updateFact
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public function updateFact(string $fact_id, string $gedcom, bool $update_chan): void
{
// Not all record types allow a CHAN event.
$update_chan = $update_chan && in_array(static::RECORD_TYPE, Gedcom::RECORDS_WITH_CHAN, true);
- 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 commonGivenQuery
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
private function commonGivenQuery(string $sex, string $type, bool $show_tot, int $threshold, int $maxtoshow)
{
$query = DB::table('name')
->join('individuals', static function (JoinClause $join): void {
$join
- 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 ifStartHandler
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
protected function ifStartHandler(array $attrs): void
{
if ($this->process_ifs > 0) {
$this->process_ifs++;
- 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 BadBotBlocker.php
has 267 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* webtrees: online genealogy
* Copyright (C) 2023 webtrees development team
Function updateTree
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
TreeViewHandler.prototype.updateTree = function (center, button) {
var tv = this; // Store "this" for usage within jQuery functions where "this" is not this ;-)
var to_load = [];
var elts = [];
this.getSize();