Showing 1,725 of 2,402 total issues
Method chartIndisWithSources
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function chartIndisWithSources(
int $tot_indi,
int $tot_indi_source,
string|null $color_from = null,
string|null $color_to = null
Method chartCommonGiven
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function chartCommonGiven(
int $tot_indi,
array $given,
string|null $color_from = null,
string|null $color_to = null
Method chartFamsWithSources
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function chartFamsWithSources(
int $tot_fam,
int $tot_fam_source,
string|null $color_from = null,
string|null $color_to = null
Method columns
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function columns(): array
{
return [
new CensusColumnGivenNameInitial($this, 'Name', 'Christian name in full, and initial of middle name'),
new CensusColumnSurname($this, 'Surname', 'Surname'),
Method chartMortality
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function chartMortality(
int $tot_l,
int $tot_d,
string|null $color_living = null,
string|null $color_dead = null
Method chartCommonSurnames
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function chartCommonSurnames(
int $tot_indi,
array $all_surnames,
string|null $color_from = null,
string|null $color_to = null
Method columns
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function columns(): array
{
return [
new CensusColumnSurnameGivenNameInitial($this, 'Name', 'Name'),
new CensusColumnRelationToHeadEnglish($this, 'Relation', 'Relationship of each person to the head of the family'),
Method updateRecord
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function updateRecord(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);
Method getSubRecord
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getSubRecord(int $level, string $tag, string $gedrec, int $num = 1): string
{
if ($gedrec === '') {
return '';
}
Method getDescendantsHtml
has 8 arguments (exceeds 4 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
Method export
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Tree $tree,
bool $sort_by_xref = false,
string $encoding = UTF8::NAME,
int $access_level = Auth::PRIV_HIDE,
string $line_endings = 'CRLF',
Consider simplifying this complex logical expression. Open
if (str_starts_with($field_name, 'INDI:NAME:')) {
switch ($field_name) {
case 'INDI:NAME:GIVN':
switch ($modifiers[$field_name]) {
case 'EXACT':
Method __construct
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
AdminService $admin_service,
HousekeepingService $housekeeping_service,
MessageService $message_service,
ModuleService $module_service,
ServerCheckService $server_check_service,
Method downloadResponse
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Tree $tree,
bool $sort_by_xref,
string $encoding,
string $privacy,
string $line_endings,
Consider simplifying this complex logical expression. Open
if ($one && !in_array($fam->family, $dist, true)) {
if ($family !== null && $child1 !== null && $child2 !== null && $child1->canShow() && $child2->canShow()) {
$top10[] = [
'child1' => $child1,
'child2' => $child2,
Function tryContinue
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function tryContinue(Cursor $cursor, BlockContinueParserInterface $activeBlockParser): BlockContinue|null
{
$line = $cursor->getLine();
if ($line === CensusTableExtension::CA_SUFFIX) {
- 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 name
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function name(): string
{
$items = [$this->label()];
$target = $this->target();
- 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 isXref
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function isXref(): self
{
$this->rules[] = static function ($value) {
if (is_string($value) && preg_match('/^' . Gedcom::REGEX_XREF . '$/', $value) === 1) {
return $value;
- 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 9 (exceeds 5 allowed). Consider refactoring. Open
public function getBlock(Tree $tree, int $block_id, string $context, array $config = []): string
{
$calendar_service = new CalendarService();
$default_events = implode(',', self::DEFAULT_EVENTS);
- 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 mapData
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function mapData(Place $place): array
{
$children = $place->getChildPlaces();
$features = [];
$sidebar = '';
- 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"